Package junit.framework

Examples of junit.framework.TestResult


    Result result= runner.run(IgnoredTest.class);
    assertEquals(2, result.getIgnoreCount());
  }

  @Test public void compatibility() {
    TestResult result= new TestResult();
    new JUnit4TestAdapter(IgnoredTest.class).run(result);
    assertEquals(1, result.runCount());
  }
View Full Code Here


    assertEquals(0, result.getFailureCount());
    assertEquals(4, result.getIgnoreCount());
  }

  @Test public void prerequsitesRunnerCompatibility() {
    TestResult result = new TestResult();
    JUnit4TestAdapter adapter = new AnnotationHandlingJUnit4TestAdapter(APrereqTest.class);
    adapter.run(result);
    assertEquals(1+4, result.runCount());
    assertEquals(0, result.errorCount());
    assertEquals(0, result.failureCount());
  }
View Full Code Here

    assertEquals(6, result.getFailureCount());
    assertEquals(0, result.getIgnoreCount());
  }

  @Test public void prerequsitesRunnerInternalFailCompatibility() {
    TestResult result = new TestResult();
    JUnit4TestAdapter adapter = new AnnotationHandlingJUnit4TestAdapter(APrereqInternalFailTest.class);
    adapter.run(result);
    assertEquals(0, result.runCount());
    assertEquals(6, result.errorCount());
    // internal errors are reported as failures
    assertEquals(0, result.failureCount());
  }
View Full Code Here

    super (name);
  }
 
  public void testExceptionSubclass() {
    ExceptionTestCase test= new ThrowExceptionTestCase("test", IndexOutOfBoundsException.class);
    TestResult result= test.run();
    assertEquals(1, result.runCount());
    assertTrue(result.wasSuccessful());
  }
View Full Code Here

    assertEquals(1, result.runCount());
    assertTrue(result.wasSuccessful());
  }
  public void testExceptionTest() {
    ExceptionTestCase test= new ThrowExceptionTestCase("test", IndexOutOfBoundsException.class);
    TestResult result= test.run();
    assertEquals(1, result.runCount());
    assertTrue(result.wasSuccessful());
  }
View Full Code Here

    assertEquals(1, result.runCount());
    assertTrue(result.wasSuccessful());
  }
  public void testFailure() {
    ExceptionTestCase test= new ThrowRuntimeExceptionTestCase("test", IndexOutOfBoundsException.class);
    TestResult result= test.run();
    assertEquals(1, result.runCount());
    assertEquals(1, result.errorCount());
  }
View Full Code Here

    assertEquals(2, runner.testCount());
  }
 
  @Test public void ensureSuitesWorkWithForwardCompatibility() {
    junit.framework.Test test= new JUnit4TestAdapter(All.class);
    TestResult result= new TestResult();
    test.run(result);
    assertEquals(2, result.runCount());
  }
View Full Code Here

    assertEquals(1, result.runCount());
    assertEquals(1, result.errorCount());
  }
  public void testNoException() {
    ExceptionTestCase test= new ThrowNoExceptionTestCase("test", Exception.class);
    TestResult result= test.run();
    assertEquals(1, result.runCount());
    assertEquals(1, result.failureCount());
  }
View Full Code Here

    assertEquals(1, result.runCount());
    assertEquals(1, result.failureCount());
  }
  public void testWrongException() {
    ExceptionTestCase test= new ThrowRuntimeExceptionTestCase("test", IndexOutOfBoundsException.class);
    TestResult result= test.run();
    assertEquals(1, result.runCount());
    assertEquals(1, result.errorCount());
  }
View Full Code Here

      @Override
      public void tearDown() {
        throw new Error("tearingDown");
      }
    };
    TestResult result= new TestResult();
    t.run(result);
    TestFailure failure= result.errors().nextElement();
    assertEquals("running", failure.thrownException().getMessage());
  }
View Full Code Here

TOP

Related Classes of junit.framework.TestResult

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.