Methods Summary |
---|
protected org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunnerTest$TestRunner | createRunner(java.lang.Class clazz)
return new TestRunner(new JUnitTest(clazz.getName()), true, true, true);
|
public static void | main(java.lang.String[] args)
junit.textui.TestRunner.run(JUnitTestRunnerTest.class);
|
public void | testInvalidSuite()
TestRunner runner = createRunner(InvalidSuiteTestCase.class);
runner.run();
String error = runner.getFormatter().getError();
assertEquals(error, JUnitTestRunner.ERRORS, runner.getRetCode());
assertTrue(error, error.indexOf("thrown on purpose") != -1);
|
public void | testInvalidTestCase()
TestRunner runner = createRunner(InvalidTestCase.class);
runner.run();
// On junit3 this is a FAILURE, on junit4 this is an ERROR
int ret = runner.getRetCode();
if (ret != JUnitTestRunner.FAILURES && ret != JUnitTestRunner.ERRORS) {
fail("Unexpected result " + ret + " from junit runner");
}
// JUNIT3 test
//assertEquals(error, JUnitTestRunner.FAILURES, runner.getRetCode());
//@fixme as of now does not report the original stacktrace.
//assertTrue(error, error.indexOf("thrown on purpose") != -1);
|
public void | testNoSuite()
TestRunner runner = createRunner(NoSuiteTestCase.class);
runner.run();
assertEquals(runner.getFormatter().getError(), JUnitTestRunner.SUCCESS, runner.getRetCode());
|
public void | testNoTestCase()
TestRunner runner = createRunner(NoTestCase.class);
runner.run();
// On junit3 this is a FAILURE, on junit4 this is an ERROR
int ret = runner.getRetCode();
if (ret != JUnitTestRunner.FAILURES && ret != JUnitTestRunner.ERRORS) {
fail("Unexpected result " + ret + " from junit runner");
}
// JUnit3 test
//assertEquals(runner.getFormatter().getError(), JUnitTestRunner.FAILURES, runner.getRetCode());
|
public void | testSuite()
TestRunner runner = createRunner(SuiteTestCase.class);
runner.run();
assertEquals(runner.getFormatter().getError(), JUnitTestRunner.SUCCESS, runner.getRetCode());
|