use of junit.framework.TestResult in project junit4 by junit-team.
the class TestCaseTest method verifyError.
void verifyError(TestCase test) {
TestResult result = test.run();
assertTrue(result.runCount() == 1);
assertTrue(result.failureCount() == 0);
assertTrue(result.errorCount() == 1);
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class TestCaseTest method verifySuccess.
void verifySuccess(TestCase test) {
TestResult result = test.run();
assertTrue(result.runCount() == 1);
assertTrue(result.failureCount() == 0);
assertTrue(result.errorCount() == 0);
}
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