use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.
the class JUnit38ClassRunnerTest method canUnadaptAnAdapter.
@Test
public void canUnadaptAnAdapter() {
JUnit38ClassRunner runner = new JUnit38ClassRunner(new JUnit4TestAdapter(AnnotatedTest.class));
Result result = new JUnitCore().run(runner);
Failure failure = result.getFailures().get(0);
assertEquals(Description.createTestDescription(AnnotatedTest.class, "foo"), failure.getDescription());
}
use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.
the class ForwardCompatibilityPrintingTest method testErrorAdapted.
public void testErrorAdapted() {
ByteArrayOutputStream output = new ByteArrayOutputStream();
TestRunner runner = new TestRunner(new TestResultPrinter(new PrintStream(output)));
String expected = expected(new String[] { ".E", "Time: 0", "Errors here", "", "FAILURES!!!", "Tests run: 1, Failures: 0, Errors: 1", "" });
ResultPrinter printer = new TestResultPrinter(new PrintStream(output)) {
@Override
public void printErrors(TestResult result) {
getWriter().println("Errors here");
}
};
runner.setPrinter(printer);
runner.doRun(new JUnit4TestAdapter(ATest.class));
assertEquals(expected, output.toString());
}
use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.
the class JUnit4TestAdapterTest method doTest.
private static void doTest(Class<?> clazz) {
// JUnit 4 runner:
Result result = JUnitCore.runClasses(clazz);
assertEquals(1, result.getRunCount());
assertEquals(0, result.getFailureCount());
assertEquals(0, result.getIgnoreCount());
// JUnit 3 runner:
TestResult testResult = new TestResult();
new JUnit4TestAdapter(clazz).run(testResult);
assertEquals(1, testResult.runCount());
assertEquals(0, testResult.failureCount());
assertEquals(Collections.emptyList(), Collections.list(testResult.errors()));
}
use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.
the class TimeoutTest method compatibility.
@Test
public void compatibility() {
TestResult result = new TestResult();
new JUnit4TestAdapter(InfiniteLoopTest.class).run(result);
assertEquals(1, result.errorCount());
}
use of junit.framework.JUnit4TestAdapter in project JMRI by JMRI.
the class PackageTest method suite.
// test suite from all defined tests
public static Test suite() {
TestSuite suite = new TestSuite(PackageTest.class.getName());
suite.addTest(new JUnit4TestAdapter(BlockTableActionTest.class));
suite.addTest(LogixTableActionTest.suite());
suite.addTest(LRouteTableActionTest.suite());
suite.addTest(OBlockTableActionTest.suite());
suite.addTest(new JUnit4TestAdapter(RouteTableActionTest.class));
suite.addTest(SensorTableWindowTest.suite());
suite.addTest(new JUnit4TestAdapter(SignalGroupTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(SignalHeadTableActionTest.class));
suite.addTest(TurnoutTableWindowTest.suite());
suite.addTest(new JUnit4TestAdapter(BundleTest.class));
suite.addTest(new JUnit4TestAdapter(jmri.jmrit.beantable.signalmast.PackageTest.class));
suite.addTest(jmri.jmrit.beantable.sensor.PackageTest.suite());
suite.addTest(jmri.jmrit.beantable.oblock.PackageTest.suite());
suite.addTest(jmri.jmrit.beantable.beanedit.PackageTest.suite());
suite.addTest(new JUnit4TestAdapter(jmri.jmrit.beantable.usermessagepreferences.PackageTest.class));
suite.addTest(new JUnit4TestAdapter(MemoryTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(AudioTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(BeanTableFrameTest.class));
suite.addTest(new JUnit4TestAdapter(BeanTablePaneTest.class));
suite.addTest(new JUnit4TestAdapter(EnablingCheckboxRendererTest.class));
suite.addTest(new JUnit4TestAdapter(IdTagTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(LightTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(LightTableTabActionTest.class));
suite.addTest(new JUnit4TestAdapter(ListedTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(ListedTableFrameTest.class));
suite.addTest(new JUnit4TestAdapter(MaintenanceTest.class));
suite.addTest(new JUnit4TestAdapter(RailComTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(ReporterTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(SectionTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(SensorTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(SensorTableTabActionTest.class));
suite.addTest(new JUnit4TestAdapter(SignalGroupSubTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(SignalMastLogicTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(SignalMastTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(TransitTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(TurnoutTableActionTest.class));
suite.addTest(new JUnit4TestAdapter(TurnoutTableTabActionTest.class));
suite.addTest(new JUnit4TestAdapter(SetPhysicalLocationActionTest.class));
return suite;
}
Aggregations