Package junit.framework

Examples of junit.framework.TestResult.errors()


  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


    if (result.wasSuccessful()) {
      System.exit(0);
    } else {
      if (result.errorCount() > 0) {
        System.err.println("Errors:");
        for (Enumeration errors = result.errors(); errors
            .hasMoreElements();) {
          TestFailure error = (TestFailure) errors.nextElement();
          System.err.println(error.trace());
        }
      }
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.