Package org.junit.runners.model

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


          s = withClassAfters(s);
          s = withClassRules(s);
          s = withCloseContextResources(s, LifecycleScope.SUITE);
          s = threadLeakControl.forSuite(s, suiteDescription);
          try {
            s.evaluate();
          } catch (Throwable t) {
            t = augmentStackTrace(t, runnerRandomness);
            if (t instanceof AssumptionViolatedException) {
              // Fire assumption failure before method ignores. (GH-103).
              notifier.fireTestAssumptionFailed(new Failure(suiteDescription, t));
View Full Code Here


      s = wrapExpectedExceptions(s, c);
      s = wrapBeforeAndAfters(s, c, instance);
      s = wrapMethodRules(s, c, instance);
      s = withCloseContextResources(s, LifecycleScope.TEST);
      s = threadLeakControl.forTest(s, c);
      s.evaluate();
    } catch (Throwable e) {
      e = augmentStackTrace(e);
      if (e instanceof AssumptionViolatedException) {
        notifier.fireTestAssumptionFailed(new Failure(c.description, e));
      } else {
View Full Code Here

        @Override
        public void evaluate() throws Throwable {
          for (Method m : befores) {
            invoke(m, instance);
          }
          afterBefores.evaluate();
        }
      };
    }

    // Process @After hooks. All @After hooks are processed, regardless of their own exceptions.
View Full Code Here

      s = new Statement() {
        @Override
        public void evaluate() throws Throwable {
          List<Throwable> cumulative = new ArrayList<Throwable>();
          try {
            afterAfters.evaluate();
          } catch (Throwable t) {
            cumulative.add(t);
          }

          // All @Afters must be called.
View Full Code Here

      if (!after.isEmpty()) {
        statement = new RunAfters(statement, after, this.instance);
      }

      try {
        statement.evaluate();
      } catch (Throwable e) { // lint: disable=IllegalCatchCheck
        notifier.fireTestFailure(new Failure(d, e));
      }
    }
View Full Code Here

                final String loadDirectory = BMRunnerUtil.normaliseLoadDirectory(scriptAnnotation);
                result = new Statement() {
                    public void evaluate() throws Throwable {
                        BMUnit.loadScriptFile(testKlazz, name, loadDirectory);
                        try {
                            nextStatement.evaluate();
                        } finally {
                            BMUnit.unloadScriptFile(testKlazz, name);
                        }
                    }
                };
View Full Code Here

                result = new Statement() {
                    public void evaluate() throws Throwable {
                        try {
                            BMUnit.loadScriptFile(testKlazz, name, loadDirectory);
                            try {
                                nextStatement.evaluate();
                            } finally {
                                try {
                                    BMUnit.unloadScriptFile(testKlazz, name);
                                } catch (Exception e) {
                                    fnotifier.fireTestFailure(new Failure(description, e));
View Full Code Here

          Statement s = runTestsStatement(notifier, filtered);
          s = withClassBefores(notifier, s);
          s = withClassAfters(notifier, s);
          s = withClassRules(notifier, s);
          try {
            s.evaluate();
          } catch (Throwable t) {
            if (t instanceof AssumptionViolatedException) {
              // Class level assumptions cause all tests to be ignored.
              // see Rants#RANT_3
              for (final TestCandidate c : filtered) {
View Full Code Here

      };

      s = wrapExpectedExceptions(s, c, instance);
      s = wrapBeforeAndAfters(s, c, instance, notifier);
      s = wrapMethodRules(s, c, instance);
      s.evaluate();
    } catch (Throwable e) {
      boolean isKilled = runnerThreadGroup.isKilled(Thread.currentThread());

      // Check if it's the runner trying to kill the thread. If so,
      // there is no point in reporting such an exception back. Also,
View Full Code Here

        @Override
        public void evaluate() throws Throwable {
          for (Method m : befores) {
            invoke(m, instance);
          }
          afterBefores.evaluate();
        }
      };
    }

    // Process @After hooks. All @After hooks are processed, regardless of their own exceptions.
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.