Package org.junit.runner.notification

Examples of org.junit.runner.notification.RunListener


   
    @Override
    public void run(RunNotifier notifier) {       

        //a listener that changes the failure's exception in a very hacky way...
        RunListener listener = new RunListener() {
           
            WarningsCollector warningsCollector;
                      
            @Override
            public void testStarted(Description description) throws Exception {
View Full Code Here


        this.logger = logger;
    }
   
    @Override
    public void run(RunNotifier notifier) {
        RunListener listener = new RunListener() {
            WarningsCollector warningsCollector;
           
            @Override
            public void testStarted(Description description) throws Exception {
                warningsCollector = new WarningsCollector();
View Full Code Here

        this.logger = logger;
    }
   
    @Override
    public void run(RunNotifier notifier) {
        RunListener listener = new RunListener() {
            WarningsCollector warningsCollector;
           
            @Override
            public void testStarted(Description description) throws Exception {
                warningsCollector = new WarningsCollector();
View Full Code Here

      LuceneTestCase.ignoreAfterMaxFailures.maxFailures = 2;
      LuceneTestCase.ignoreAfterMaxFailures.failuresSoFar = 0;

      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

               State.caughtInitializationException(e);
               notifier.fireTestFailure(new Failure(getDescription(), e));
            }
         }
      }
      notifier.addListener(new RunListener()
      {
         @Override
         public void testRunFinished(Result result) throws Exception
         {
            State.runnerFinished();
View Full Code Here

        return super.getDescription();
    }

    @Override
    public void run(final RunNotifier notifier) {
        notifier.addListener(new RunListener() {
            @Override
            public void testStarted(Description description) throws Exception {
                DebuggingSlicePool.currentLabel = description.getClassName() + "." + description.getMethodName();
                super.testStarted(description);
            }
View Full Code Here

                }
                server.resumeAccepts();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
            notifier.addListener(new RunListener() {
                @Override
                public void testRunFinished(final Result result) throws Exception {
                    server.close();
                    stopSSLServer();
                    worker.shutdown();
View Full Code Here

   * Test execution logic for the entire suite, executing under designated
   * {@link RunnerThreadGroup}.
   */
  private void runSuite(final RandomizedContext context, final RunNotifier notifier) {
    final Result result = new Result();
    final RunListener accounting = result.createListener();
    notifier.addListener(accounting);

    context.push(runnerRandomness);
    try {
      // Check for automatically hookable listeners.
View Full Code Here

  /** Subscribe annotation listeners to the notifier. */
  private void subscribeListeners(RunNotifier notifier) {
    for (Listeners ann : getAnnotationsFromClassHierarchy(suiteClass, Listeners.class)) {
      for (Class<? extends RunListener> clazz : ann.value()) {
        try {
          RunListener listener = clazz.newInstance();
          autoListeners.add(listener);
          notifier.addListener(listener);
        } catch (Throwable t) {
          throw new RuntimeException("Could not initialize suite class: "
              + suiteClass.getName() + " because its @Listener is not instantiable: "
View Full Code Here

  private static int assumptionFailures= 0;
  @Test
  public void failedAssumptionsCanBeDetectedByListeners() {
    assumptionFailures= 0;
    JUnitCore core= new JUnitCore();
    core.addListener(new RunListener() {
      @Override
      public void testAssumptionFailure(Failure failure) {
        assumptionFailures++;
      }
    });
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.