Package junit.framework

Examples of junit.framework.TestResult.errorCount()


  }
  void verifyFailure(TestCase test) {
    TestResult result= test.run();
    assertTrue(result.runCount() == 1);
    assertTrue(result.failureCount() == 1);
    assertTrue(result.errorCount() == 0);
  }
  void verifySuccess(TestCase test) {
    TestResult result= test.run();
    assertTrue(result.runCount() == 1);
    assertTrue(result.failureCount() == 0);
View Full Code Here


  }
  void verifySuccess(TestCase test) {
    TestResult result= test.run();
    assertTrue(result.runCount() == 1);
    assertTrue(result.failureCount() == 0);
    assertTrue(result.errorCount() == 0);
  }
}
View Full Code Here

 
  public void testSuccessfulRun() {
    TestResult result= new TestResult();
    fTest.run(result);
    assertEquals(fTest.countTestCases(), result.runCount());
    assertEquals(0, result.errorCount());
    assertEquals(0, result.failureCount());
  }
}
View Full Code Here

  }

  @Test public void compatibility() {
    TestResult result= new TestResult();
    new JUnit4TestAdapter(InfiniteLoopTest.class).run(result);
    assertEquals(1, result.errorCount());
  }
 
  static public junit.framework.Test suite() {
    return new JUnit4TestAdapter(TimeoutTest.class);
  }
View Full Code Here

    TestResult result= new TestResult();
    wrapper.run(result);

    assertEquals(1, result.failureCount());
    assertEquals(1, result.errorCount());
  }
  public void testSetupErrorDontTearDown() {
    WasRun test= new WasRun();

    TornDown wrapper= new TornDown(test) {
View Full Code Here

    reloadedTest.run(result);

    String message= reloadedTest.toString();
    if(result.wasSuccessful())
      showInfo(message+" was successful");
    else if (result.errorCount() == 1)
      showStatus(message+" had an error");
    else
      showStatus(message+" had a failure");
  }
View Full Code Here

 
  public void testExceptionInBefore() {
    TestResult result= new TestResult();
    junit.framework.Test adapter= new JUnit4TestAdapter(ExceptionInBeforeTest.class);
    adapter.run(result);
    assertEquals(1, result.errorCount());
  }
 
  public static class InvalidMethodTest {
    @BeforeClass public void shouldBeStatic() {}
  }
View Full Code Here

 
  public void testInvalidMethod() {
    TestResult result= new TestResult();
    junit.framework.Test adapter= new JUnit4TestAdapter(InvalidMethodTest.class);
    adapter.run(result);
    assertEquals(1, result.errorCount())
    TestFailure failure= result.errors().nextElement();
    assertTrue(failure.exceptionMessage().contains("Method shouldBeStatic() should be static"));
  }
 
  private static boolean wasRun= false;
View Full Code Here

    reloadedTest.run(result);

    String message= reloadedTest.toString();
    if(result.wasSuccessful())
      showInfo(message+" was successful");
    else if (result.errorCount() == 1)
      showStatus(message+" had an error");
    else
      showStatus(message+" had a failure");
  }
View Full Code Here

    Test test= createActiveTestSuite();
    TestResult result= new TestResult();
    test.run(result);
    assertEquals(100, result.runCount());
    assertEquals(0, result.failureCount());
    assertEquals(0, result.errorCount());
  }
 
  public void testActiveRepeatedTest() {   
    Test test= new RepeatedTest(createActiveTestSuite(), 5);
    TestResult result= new TestResult();
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.