use of org.junit.runner.JUnitCore in project h2o-3 by h2oai.
the class H2OTestRunner method run.
public Result run(String[] args) throws Exception {
// List all classes - adapted from JUnitCore code
List<Class<?>> classes = new ArrayList<Class<?>>();
List<Failure> missingClasses = new ArrayList<Failure>();
for (String arg : args) {
try {
classes.add(Class.forName(arg));
} catch (ClassNotFoundException e) {
Description description = Description.createSuiteDescription(arg);
Failure failure = new Failure(description, e);
missingClasses.add(failure);
}
}
// Create standard JUnitCore
JUnitCore jcore = new JUnitCore();
// Create default "system"
JUnitSystem jsystem = new RealSystem();
// Setup default listener
jcore.addListener(new TextListener(jsystem));
// Add XML generator listener
jcore.addListener(new XMLTestReporter());
Result result = jcore.run(classes.toArray(new Class[0]));
for (Failure each : missingClasses) {
System.err.println("FAIL Missing class in H2OTestRunner: " + each);
result.getFailures().add(each);
}
return result;
}
use of org.junit.runner.JUnitCore in project jna by java-native-access.
the class WininetTest method main.
public static void main(String[] args) {
JUnitCore jUnitCore = new JUnitCore();
jUnitCore.run(WininetTest.class);
}
use of org.junit.runner.JUnitCore in project jna by java-native-access.
the class WininetUtilTest method main.
public static void main(String[] args) {
JUnitCore jUnitCore = new JUnitCore();
jUnitCore.run(WininetUtilTest.class);
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class ExpectedExceptionTest method runTestAndVerifyResult.
@Test
public void runTestAndVerifyResult() {
EventCollector collector = new EventCollector();
JUnitCore core = new JUnitCore();
core.addListener(collector);
core.run(classUnderTest);
assertThat(collector, matcher);
}
use of org.junit.runner.JUnitCore in project junit4 by junit-team.
the class CategoriesAndParameterizedTest method doesNotRunTestsWithoutCategory.
@Test
public void doesNotRunTestsWithoutCategory() {
Result result = new JUnitCore().run(SuiteWithParameterizedTestWithoutCategory.class);
assertEquals(1, result.getRunCount());
assertEquals(0, result.getFailureCount());
}
Aggregations