use of junit.framework.JUnit4TestAdapter in project cucumber-jvm by cucumber.
the class SanityChecker method run.
public static void run(Class<?> testClass, boolean debug) {
JUnit4TestAdapter testAdapter = new JUnit4TestAdapter(testClass);
TestResult result = new TestResult();
SanityChecker listener = new SanityChecker();
result.addListener(listener);
testAdapter.run(result);
String output = listener.getOutput();
if (output.contains(INSANITY)) {
throw new RuntimeException("Something went wrong\n" + output);
}
if (debug) {
System.out.println("===== " + testClass.getName());
System.out.println(output);
System.out.println("=====");
}
}
use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.
the class SuiteTest method forwardCompatibilityWorksWithGetTests.
@Test
public void forwardCompatibilityWorksWithGetTests() {
JUnit4TestAdapter adapter = new JUnit4TestAdapter(All.class);
List<? extends junit.framework.Test> tests = adapter.getTests();
assertEquals(2, tests.size());
}
use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.
the class SuiteTest method forwardCompatibilityWorksWithTestCount.
@Test
public void forwardCompatibilityWorksWithTestCount() {
JUnit4TestAdapter adapter = new JUnit4TestAdapter(All.class);
assertEquals(2, adapter.countTestCases());
}
use of junit.framework.JUnit4TestAdapter 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.JUnit4TestAdapter 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());
}
Aggregations