use of junit.framework.TestResult in project junit4 by junit-team.
the class TestCaseTest method verifyFailure.
void verifyFailure(TestCase test) {
TestResult result = test.run();
assertTrue(result.runCount() == 1);
assertTrue(result.failureCount() == 1);
assertTrue(result.errorCount() == 0);
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class RepeatedTestTest method testRepeatedOnce.
public void testRepeatedOnce() {
Test test = new RepeatedTest(fSuite, 1);
assertEquals(2, test.countTestCases());
TestResult result = new TestResult();
test.run(result);
assertEquals(2, result.runCount());
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class ActiveTestTest method testActiveRepeatedTest0.
public void testActiveRepeatedTest0() {
Test test = new RepeatedTest(createActiveTestSuite(), 0);
TestResult result = new TestResult();
test.run(result);
assertEquals(0, result.runCount());
assertEquals(0, result.failureCount());
assertEquals(0, result.errorCount());
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class ExtensionTest method testSetupErrorInTestSetup.
public void testSetupErrorInTestSetup() {
WasRun test = new WasRun();
TestSetup wrapper = new TestSetup(test) {
@SuppressWarnings("deprecation")
@Override
public void setUp() {
fail();
}
};
TestResult result = new TestResult();
wrapper.run(result);
assertTrue(!test.fWasRun);
assertTrue(!result.wasSuccessful());
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class ExtensionTest method testRunningErrorInTestSetup.
public void testRunningErrorInTestSetup() {
TestCase test = new TestCase("failure") {
@Override
public void runTest() {
fail();
}
};
TestSetup wrapper = new TestSetup(test);
TestResult result = new TestResult();
wrapper.run(result);
assertTrue(!result.wasSuccessful());
}
Aggregations