use of org.junit.internal.TextListener in project junit4 by junit-team.
the class JUnitCore method runMain.
/**
* @param system
* @param args from main()
*/
Result runMain(JUnitSystem system, String... args) {
system.out().println("JUnit version " + Version.id());
JUnitCommandLineParseResult jUnitCommandLineParseResult = JUnitCommandLineParseResult.parse(args);
RunListener listener = new TextListener(system);
addListener(listener);
return run(jUnitCommandLineParseResult.createRequest(defaultComputer()));
}
use of org.junit.internal.TextListener in project mockito by mockito.
the class MockInjectionUsingConstructorTest method constructor_is_called_for_each_test_in_test_class.
@Test
public void constructor_is_called_for_each_test_in_test_class() throws Exception {
// given
junit_test_with_3_tests_methods.constructor_instantiation = 0;
JUnitCore jUnitCore = new JUnitCore();
jUnitCore.addListener(new TextListener(System.out));
// when
jUnitCore.run(junit_test_with_3_tests_methods.class);
// then
assertThat(junit_test_with_3_tests_methods.constructor_instantiation).isEqualTo(3);
}
use of org.junit.internal.TextListener in project robovm by robovm.
the class RoboVMAllTests method main.
public static void main(String[] args) throws Exception {
System.out.println("JUnit version " + Version.id());
JUnitCore core = new JUnitCore();
core.addListener(new TextListener(System.out) {
@Override
public void testStarted(Description description) {
System.out.print(description + " ... ");
}
@Override
public void testFinished(Description description) {
System.out.println();
}
@Override
public void testFailure(Failure failure) {
System.out.print("FAILED!");
}
@Override
public void testIgnored(Description description) {
System.out.println("IGNORED!");
}
});
core.run(suite(Pattern.compile(args.length > 0 ? args[0] : ".*"), Pattern.compile(args.length > 1 ? args[1] : " "), false));
}
use of org.junit.internal.TextListener in project robovm by robovm.
the class RunAllTests method main.
public static void main(String[] args) {
List<Class<?>> classes = new ArrayList<>();
for (Class<?> cls : VM.listClasses(Object.class, ClassLoader.getSystemClassLoader())) {
if (!cls.getName().startsWith("junit.") && !cls.getName().startsWith("org.junit.")) {
if (TestCase.class.isAssignableFrom(cls)) {
classes.add(cls);
continue;
}
for (Method m : cls.getMethods()) {
if (m.getAnnotation(Test.class) != null) {
classes.add(cls);
break;
}
}
}
}
JUnitCore jc = new JUnitCore();
jc.addListener(new TextListener(System.out));
jc.run(classes.toArray(new Class[classes.size()]));
System.out.flush();
System.exit(0);
}
use of org.junit.internal.TextListener in project spring-boot by spring-projects.
the class DelegateTestRunner method run.
public static void run(Class<?>[] testClasses, Result result) {
JUnitCore jUnitCore = new JUnitCore();
jUnitCore.addListener(new TextListener(System.out));
jUnitCore.addListener(result.createListener());
jUnitCore.run(testClasses);
}
Aggregations