Package org.junit.runners.model

Examples of org.junit.runners.model.Statement.evaluate()


                maybeCopy(String.format("%s/shared", className));
                maybeCopy(String.format("%s/%s", className, method.getName()));
                for (String extraResource : extraResources) {
                    maybeCopy(extraResource);
                }
                statement.evaluate();
            }
        };
    }

    private TemporaryFolder findTempDir(Object target) {
View Full Code Here


    final Statement statement = CliTester.this.outputCapture.apply(new RunLauncherStatement(base), description);
    return new Statement() {

      @Override
      public void evaluate() throws Throwable {
        statement.evaluate();
      }
    };
  }

  private final class RunLauncherStatement extends Statement {
View Full Code Here

            @Override
            public void evaluate() throws Throwable {
                ((AbstractTB3Test) target)
                        .setDesiredCapabilities(tb3method.capabilities);
                try {
                    realBefores.evaluate();
                } catch (Throwable t) {
                    // Give the test a chance to e.g. produce an error
                    // screenshot before failing the test by re-throwing the
                    // exception
                    ((AbstractTB3Test) target).onUncaughtException(t);
View Full Code Here

                Throwable failureReason = null;

                final Retry retry = method.getAnnotation(Retry.class);
                if (retry == null) {
                    // Do a single test run attempt.
                    singleTryStatement.evaluate();
                } else {
                    final int numRetries = retry.value();

                    for (int i = 0; i < numRetries; ++i) {
                        try {
View Full Code Here

                    final int numRetries = retry.value();

                    for (int i = 0; i < numRetries; ++i) {
                        try {
                            // Do a single test run attempt.
                            singleTryStatement.evaluate();
                            // Attempt succeeded, stop evaluation here.
                            return;
                        } catch (Throwable t) {
                            // Attempt failed, store the reason.
                            failureReason = t;
View Full Code Here

                           }
                       });
                       try {
                           State.caughtExceptionAfterJunit(null);
                           if(integer.get() > 0) {
                               withArounds.evaluate();
                           } else {
                               testStatement.evaluate();
                           }
                       }
                       catch (Throwable e) {
View Full Code Here

                    // register the test instance
                    TestFeatureManagerProvider.setFeatureManager(featureManager);
                    FeatureContext.clearCache();

                    // run the test
                    delegate.evaluate();

                }

                finally {
                    TestFeatureManagerProvider.setFeatureManager(null);
View Full Code Here

    public void run(final RunNotifier notifier) {
        EachTestNotifier testNotifier = new EachTestNotifier(notifier,
                getDescription());
        try {
            Statement statement = classBlock(notifier);
            statement.evaluate();
        } catch (AssumptionViolatedException e) {
            testNotifier.addFailedAssumption(e);
        } catch (StoppedByUserException e) {
            throw e;
        } catch (Throwable e) {
View Full Code Here

                    final Statement statement = super.methodBlock(method);
                    return new Statement() {
                        @Override
                        public void evaluate() throws Throwable {
                            try {
                                statement.evaluate();
                                handleDataPointSuccess();
                            } catch (AssumptionViolatedException e) {
                                handleAssumptionViolation(e);
                            } catch (Throwable e) {
                                reportParameterizedError(e, complete
View Full Code Here

  protected Statement withAfterClasses(Statement statement) {
    final Statement superStatement = super.withAfterClasses(statement);
    return new Statement() {
      @Override
      public void evaluate() throws Throwable {
        superStatement.evaluate();
        registryManager.afterTestClass();
      }
    };
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.