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

        final Statement beforeClasses = super.withBeforeClasses(statement);
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                Thread.currentThread().setContextClassLoader(testLoader);
                beforeClasses.evaluate();
            }
        };
    }

    @Override
View Full Code Here

        final Statement afterClasses = super.withAfterClasses(statement);
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                try {
                    afterClasses.evaluate();
                } finally {
                    Thread.currentThread().setContextClassLoader(originalLoader);
                }
            }
        };
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

      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

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.