Package org.junit.runner.notification

Examples of org.junit.runner.notification.RunListener


      }
    };

    private GroovyWorkerRunnable(GrinderContextExecutor groovyRunner) throws EngineException {
      this.m_groovyThreadRunner = groovyRunner;
      this.notifier.addListener(new RunListener() {
        @Override
        public void testFailure(Failure failure) throws Exception {
          // Skip Generic Shutdown... It's not failure.
          Throwable rootCause = exceptionProcessor.getRootCause(failure.getException());
          if (exceptionProcessor.isGenericShutdown(rootCause)) {
View Full Code Here


   }

   @Override
   public void run(RunNotifier notifier)
   {
      notifier.addListener(new RunListener()
      {
         @Override
         public void testRunFinished(Result result) throws Exception
         {
            try
View Full Code Here

            return instance;
  }
 
  public RunNotifier getNotifier(final TestResult result) {
            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

    }

    private void beforeRun(RunNotifier notifier, final DebuggingInfo debuggingInfo) {
        debuggingInfo.collectData();

        RunListener listener = new RunListener() {
            @Override public void testFailure(Failure failure) throws Exception {
                debuggingInfo.printWarnings(logger);
            }
        };
       
View Full Code Here

        System.out.println("Could not find class: " + each);
        Description description= Description.createSuiteDescription(each);
        Failure failure= new Failure(description, e);
        missingClasses.add(failure);
      }
    RunListener listener= new TextListener();
    addListener(listener);
    Result result= run(classes.toArray(new Class[0]));
    for (Failure each : missingClasses)
      result.getFailures().add(each);
    return result;
View Full Code Here

  /**
   * Do not use. Testing purposes only.
   */
  public Result run(Runner runner) {
    Result result= new Result();
    RunListener listener= result.createListener();
    addFirstListener(listener);
    try {
      fNotifier.fireTestRunStarted(runner.getDescription());
      runner.run(fNotifier);
      fNotifier.fireTestRunFinished(result);
View Full Code Here

  @Test
  public void testMaxFailures() {
    LuceneTestCase.replaceMaxFailureRule(new TestRuleIgnoreAfterMaxFailures(2));
    JUnitCore core = new JUnitCore();
    final StringBuilder results = new StringBuilder();
    core.addListener(new RunListener() {
      char lastTest;

      @Override
      public void testStarted(Description description) throws Exception {
        lastTest = 'S'; // success.
View Full Code Here

  @Test
  public void testZombieThreadFailures() throws Exception {
    LuceneTestCase.replaceMaxFailureRule(new TestRuleIgnoreAfterMaxFailures(1));
    JUnitCore core = new JUnitCore();
    final StringBuilder results = new StringBuilder();
    core.addListener(new RunListener() {
      char lastTest;

      @Override
      public void testStarted(Description description) throws Exception {
        lastTest = 'S'; // success.
View Full Code Here

    public CustomJUnitRunNotifier( final Event<TestResultMessage> testResultMessageEvent ) {

        this.testResultMessageEvent = testResultMessageEvent;

        addListener( new RunListener() {

            private boolean hasFailure = false;

            public void testFinished( final Description description ) throws Exception {
                if ( !hasFailure ) {
View Full Code Here

                warn("Event serializer exception.", t);
              }
            }));

    if (flushFrequently) {
      core.addListener(new RunListener() {
        public void testRunFinished(Result result) throws Exception {
          serializer.flush();
        }
       
        public void testFinished(Description description) throws Exception {
View Full Code Here

TOP

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

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.