Package org.junit.runner.notification

Examples of org.junit.runner.notification.RunNotifier


            fw.close();
        }
        catch (IOException e) {}
       
        final TestResult result = new TestResult();
        RunNotifier notifier = new RunNotifier();
        notifier.addListener(new RunListener() {

            public void testFailure(Failure failure) throws Exception {
                result.addError(asTest(failure.getDescription()), failure.getException());
            }
View Full Code Here


public class JUnitRunNotifierResultsListenerTest {

  @Test
  public void shouldProvideFirstFailure() {
    RunNotifier notifier = mock(RunNotifier.class);
    JUnitRunNotifierResultsListener listener = new JUnitRunNotifierResultsListener(notifier, getClass());

    TestResult testResult = SlimTestResult.fail("Actual", "Expected");

    listener.testAssertionVerified(null, testResult);
View Full Code Here

    assertThat(failure.getMessage(), is("[Actual] expected [Expected]"));
  }

  @Test
  public void shouldProvideFirstException() {
    RunNotifier notifier = mock(RunNotifier.class);
    JUnitRunNotifierResultsListener listener = new JUnitRunNotifierResultsListener(notifier, getClass());

    TestResult testResult = SlimTestResult.error("Message", "Actual");

    listener.testAssertionVerified(null, testResult);
View Full Code Here

   */
  public JUnitCore() {
    try {//我加上的
    DEBUG.P(this,"JUnitCore()");

    fNotifier= new RunNotifier();

    }finally{//我加上的
    DEBUG.P(0,this,"JUnitCore()");
    }
  }
View Full Code Here

public class OldTestClassAdaptingListenerTest {
  @Test
  public void addFailureDelegatesToNotifier() {
    Result result= new Result();
    RunListener listener= result.createListener();
    RunNotifier notifier= new RunNotifier();
    notifier.addFirstListener(listener);
    TestListener adaptingListener= JUnit38ClassRunner
        .createAdaptingListener(notifier);
    TestCase testCase= new TestCase() {
    };
    adaptingListener.addFailure(testCase, new AssertionFailedError());
View Full Code Here

        }
        return invocation.proceed();
      }
    });
    DefaultAopProxyFactory aopProxyFactory = new DefaultAopProxyFactory();
    RunNotifier runNotifierProxy = (RunNotifier) aopProxyFactory.createAopProxy(config).getProxy();
    super.run(runNotifierProxy);
  }
View Full Code Here

    unsubscribeListeners(notifier);
    context.popAndDestroy();   
  }

  private boolean areAllRemainingIgnored(List<TestCandidate> filtered) {
    RunNotifier fake = new RunNotifier();
    for (TestCandidate candidate : filtered) {
      if (!isTestIgnored(fake, candidate)) {
        return false;
      }
    }
View Full Code Here

public class UserStopTest {
  private RunNotifier fNotifier;

  @Before public void createNotifier() {
    fNotifier= new RunNotifier();
    fNotifier.pleaseStop();   
  }
View Full Code Here

  /**
   * Create a new <code>JUnitCore</code> to run tests.
   */
  public JUnitCore() {
    fNotifier= new RunNotifier();
  }
View Full Code Here

        final void addDescriptions(Description parent) {
            map(templateDescription, parent);
        }

        final void run(final RunNotifier notifier) {
            RunNotifier nested = new RunNotifier();
            NestedRunListener nestedListener = new NestedRunListener(notifier);
            nested.addListener(nestedListener);

            try {
                runEnabledTests(nested);
            } finally {
                nestedListener.cleanup();
            }

            for (Description disabledTest : disabledTests) {
                nested.fireTestStarted(disabledTest);
                nested.fireTestIgnored(disabledTest);
            }
        }
View Full Code Here

TOP

Related Classes of org.junit.runner.notification.RunNotifier

Copyright © 2018 www.massapicom. 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.