Package junit.framework

Examples of junit.framework.TestResult


    }
  }
 
  public void testNoArgTestCasePasses() {
    Test t= new TestSuite(NoArgTestCaseTest.class);
    TestResult result= new TestResult();
    t.run(result);
    assertTrue(result.runCount() == 1);
    assertTrue(result.failureCount() == 0);
    assertTrue(result.errorCount() == 0);
  }
View Full Code Here


    assertTrue(result.errorCount() == 0);
  }
 
  public void testNamelessTestCase() {
    TestCase t= new TestCase() {};
    TestResult result = t.run();
    assertEquals(1, result.failureCount());
  }
View Full Code Here

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

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

    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);
    assertTrue(result.errorCount() == 0);
  }
View Full Code Here

    };
    fTest= new DoubleTestCase(testCase);
  }
 
  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

    exception.printStackTrace(writer);
    assertTrue(writer.toString().contains("infiniteLoop")); // Make sure we have the stalled frame on the stack somewhere
  }

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

      }
    };

    TestSetup wrapper= new TestSetup(test);

    TestResult result= new TestResult();
    wrapper.run(result);
    assertTrue(!result.wasSuccessful());
  }
View Full Code Here

    suite.addTest(failure);
    suite.addTest(error);
   
    TestSetup wrapper= new TestSetup(suite);

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

    assertEquals(1, result.failureCount());
    assertEquals(1, result.errorCount());
  }
View Full Code Here

      public void setUp() {
        fail();
      }
    };

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

    assertTrue(!wrapper.fTornDown);
  }
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.