use of junit.framework.TestResult in project tomee by apache.
the class TestRunner method start.
public TestResult start(final String[] args) throws Exception {
TestResult result = null;
try {
TestManager.init(null);
TestManager.start();
} catch (final Exception e) {
System.out.println("Cannot initialize the test environment: " + e.getClass().getName() + " " + e.getMessage());
e.printStackTrace();
// System.exit(-1);
throw e;
}
try {
result = super.start(args);
} catch (final Exception ex) {
} finally {
try {
TestManager.stop();
} catch (final Exception e) {
// ignore it
;
}
}
// System.exit(0);
return result;
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class SuiteTest method ensureSuitesWorkWithForwardCompatibility.
@Test
public void ensureSuitesWorkWithForwardCompatibility() {
junit.framework.Test test = new JUnit4TestAdapter(All.class);
TestResult result = new TestResult();
test.run(result);
assertEquals(2, result.runCount());
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class ForwardCompatibilityTest method testNoException.
public void testNoException() {
TestResult result = new TestResult();
junit.framework.Test adapter = new JUnit4TestAdapter(NoExceptionTest.class);
adapter.run(result);
assertFalse(result.wasSuccessful());
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class ForwardCompatibilityTest method testExceptionInBefore.
public void testExceptionInBefore() {
TestResult result = new TestResult();
junit.framework.Test adapter = new JUnit4TestAdapter(ExceptionInBeforeTest.class);
adapter.run(result);
assertEquals(1, result.errorCount());
}
use of junit.framework.TestResult in project junit4 by junit-team.
the class ForwardCompatibilityTest method testException.
public void testException() {
TestResult result = new TestResult();
junit.framework.Test adapter = new JUnit4TestAdapter(ErrorTest.class);
adapter.run(result);
assertEquals(exception, result.errors().nextElement().thrownException());
}
Aggregations