Package junit.framework

Examples of junit.framework.TestResult.errorCount()


 
  @Test
  public void initializationErrorsAreThrownAtRuntime() {
    TestResult result= new TestResult();
    fAdapter.run(result);
    assertEquals(1, result.errorCount());
    assertEquals(CantInitialize.UNIQUE_ERROR_MESSAGE, result.errors()
        .nextElement().exceptionMessage());
  }

  private final class ErrorRememberingListener implements TestListener {
View Full Code Here


    @Test
    public void testRunSuccessfulTestCase() throws Throwable {
        RuntimeStub runtime = new RuntimeStub();
        MarathonTestCase t = new MarathonTestCase(new File("./success.py"), runtime);
        TestResult result = t.run();
        if (result.errorCount() > 0) {
            TestFailure failure = (TestFailure) result.errors().nextElement();
            throw failure.thrownException();
        }
        assertEquals("failed", true, result.wasSuccessful());
    }
View Full Code Here

        runtime.scriptsFail = true;
        MarathonTestCase t = new MarathonTestCase(new File("./failure.py"), runtime);
        TestResult result = t.run();
        assertEquals("test case should have failed", false, result.wasSuccessful());
        assertEquals("each failing testcase should have one failure, and no errors", 1, result.failureCount());
        assertEquals("each failing testcase should have one failure, and no errors", 0, result.errorCount());
    }
}
View Full Code Here

    static public void runAndReport(Test ts, PrintStream out)
    {
        if ( out == null )
            out = System.out ;
        TestResult result = runNoReport(ts) ;
        if ( result.errorCount() > 0 || result.failureCount() > 0 )
        {
            out.println() ;
            out.println("===========================================") ;
        }
        int goodCount = result.runCount() - result.errorCount() - result.failureCount() ;
View Full Code Here

        if ( result.errorCount() > 0 || result.failureCount() > 0 )
        {
            out.println() ;
            out.println("===========================================") ;
        }
        int goodCount = result.runCount() - result.errorCount() - result.failureCount() ;
        out.println("Tests = "+result.runCount()+
                           " : Successes = "+goodCount+
                           " : Errors = "+result.errorCount()+
                           " : Failures = "+result.failureCount()) ;
       
View Full Code Here

            out.println("===========================================") ;
        }
        int goodCount = result.runCount() - result.errorCount() - result.failureCount() ;
        out.println("Tests = "+result.runCount()+
                           " : Successes = "+goodCount+
                           " : Errors = "+result.errorCount()+
                           " : Failures = "+result.failureCount()) ;
       
        for ( Enumeration<?> e = result.errors() ; e.hasMoreElements() ; )
        {
            out.println() ;
View Full Code Here

    public static void main(String [] args) {
        TestResult tr = new TestResult();
        Test t = suite();
        t.run(tr);
        System.out.println(tr.errorCount());
        Enumeration e = tr.failures();
        while (e.hasMoreElements()) {
            ((TestFailure)e.nextElement ()).thrownException().printStackTrace();
        }
        System.out.println(tr.failureCount());
View Full Code Here

    public static void main(String [] args) {
        TestResult tr = new TestResult();
        Test t = suite();
        t.run(tr);
        System.out.println(tr.errorCount());
        Enumeration e = tr.failures();
        while (e.hasMoreElements()) {
            ((TestFailure)e.nextElement ()).thrownException().printStackTrace();
        }
        System.out.println(tr.failureCount());
View Full Code Here

    }
    public static void main(String [] args) {
        TestResult tr = new TestResult();
        Test t = suite();
        t.run(tr);
        System.out.println(tr.errorCount());
        Enumeration e = tr.failures();
        while (e.hasMoreElements()) {
            ((TestFailure)e.nextElement ()).thrownException().printStackTrace();
        }
        System.out.println(tr.failureCount());
View Full Code Here

     */
    public static void main(String[] args)
    {
        processArgs(args);
        TestResult testResult = TestRunner.run(SVNTestSuite.suite());
        if (testResult.errorCount() > 0 || testResult.failureCount() > 0)
        {
            System.exit(1);
        }
    }

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.