Package org.junit.runner.notification

Examples of org.junit.runner.notification.Failure


  }
 
  @Test public void noRunnableMethods() {
    JUnitCore core = new JUnitCore();
    Result result = core.run(new Class[] {NoTests.class});
    Failure failure = result.getFailures().get(0);
    assertEquals("No runnable methods", failure.getException().getMessage());
  }
View Full Code Here


        }
        catch ( Exception e )
        {
            LOG.error( I18n.err( I18n.ERR_181, getTestClass().getName() ) );
            LOG.error( e.getLocalizedMessage() );
            notifier.fireTestFailure( new Failure( getDescription(), e ) );
        }
        finally
        {
            // help GC to get rid of the directory service with all its references
            classDS = null;
View Full Code Here

        }
        catch ( Exception e )
        {
            LOG.error( I18n.err( I18n.ERR_182, method.getName() ) );
            LOG.error( "", e );
            notifier.fireTestFailure( new Failure( getDescription(), e ) );
        }
    }
View Full Code Here

            public void run()
            {
                try
                {
                    jUnit4TestSetReporter.testStarted( testSomething2 );
                    jUnit4TestSetReporter.testFailure( new Failure( testSomething2, new AssertionError( "Fud" ) ) );
                    jUnit4TestSetReporter.testFinished( testSomething2 );
                    countDownLatch.countDown();
                }
                catch ( Exception e )
                {
View Full Code Here

        }
        catch ( Exception e )
        {
            LOG.error( I18n.err( I18n.ERR_181, getTestClass().getName() ) );
            LOG.error( e.getLocalizedMessage() );
            notifier.fireTestFailure( new Failure( getDescription(), e ) );
        }
        finally
        {
            // help GC to get rid of the directory service with all its references
            classDS = null;
View Full Code Here

        }
        catch ( Exception e )
        {
            LOG.error( I18n.err( I18n.ERR_182, method.getName() ) );
            LOG.error( "", e );
            notifier.fireTestFailure( new Failure( getDescription(), e ) );
        }
    }
View Full Code Here

         if(State.hasInitializationException()) 
         {
            // failed on suite level, ignore children
            //notifier.fireTestIgnored(getDescription());
            notifier.fireTestFailure(
                  new Failure(getDescription(),
                        new RuntimeException(
                              "Arquillian has previously been attempted initialized, but failed. See cause for previous exception",
                              State.getInitializationException())));
         }
         else
         {
            try
            {
               // ARQ-1742 If exceptions happen during boot
               TestRunnerAdaptor adaptor = TestRunnerAdaptorBuilder.build();
               // don't set it if beforeSuite fails
               adaptor.beforeSuite();
               State.testAdaptor(adaptor);
            }
            catch (Exception e
            {
               // caught exception during BeforeSuite, mark this as failed
               State.caughtInitializationException(e);
               notifier.fireTestFailure(new Failure(getDescription(), e));
            }
         }
      }
      notifier.addListener(new RunListener()
      {
View Full Code Here

            notifier.fireTestStarted(asDescription(test));
        }

        // Implement junit.framework.TestListener
        public void addError(Test test, Throwable e) {
            Failure failure = new Failure(asDescription(test), e);
            notifier.fireTestFailure(failure);
        }
View Full Code Here

    }

    private void runCause(Throwable child, RunNotifier notifier) {
        Description description = describeCause(child);
        notifier.fireTestStarted(description);
        notifier.fireTestFailure(new Failure(description, child));
        notifier.fireTestFinished(description);
    }
View Full Code Here

    public void addFailure(Throwable targetException) {
        if (targetException instanceof MultipleFailureException) {
            addMultipleFailureException((MultipleFailureException) targetException);
        } else {
            notifier.fireTestFailure(new Failure(description, targetException));
        }
    }
View Full Code Here

TOP

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

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.