use of org.junit.runner.Runner in project jena by apache.
the class AbstractRunnerOfTests method prepareTests.
public static void prepareTests(EarlReport report, RunnerOneManifest level, Manifest manifest, Function<ManifestEntry, Runnable> maker, String prefix) {
manifest.entries().forEach(entry -> {
String label = prepareTestLabel(entry, prefix);
Runnable runnable = maker.apply(entry);
if (runnable != null) {
Runner r = new RunnerOneTest(label, runnable, entry.getURI(), report);
level.add(r);
}
});
}
use of org.junit.runner.Runner in project junit4 by junit-team.
the class TheoryTestUtils method runTheoryClass.
public static Result runTheoryClass(Class<?> testClass) throws InitializationError {
Runner theoryRunner = new Theories(testClass);
Request request = Request.runner(theoryRunner);
return new JUnitCore().run(request);
}
use of org.junit.runner.Runner in project junit4 by junit-team.
the class MaxStarterTest method correctErrorFromHalfMalformedTest.
@Test
public void correctErrorFromHalfMalformedTest() {
Request request = Request.aClass(HalfMalformedJUnit38TestMethod.class);
JUnitCore core = new JUnitCore();
Request sorted = fMax.sortRequest(request);
Runner runner = sorted.getRunner();
Result result = core.run(runner);
Failure failure = result.getFailures().get(0);
assertThat(failure.toString(), containsString("MalformedJUnit38TestMethod"));
assertThat(failure.toString(), containsString("testNothing"));
assertThat(failure.toString(), containsString("isn't public"));
}
use of org.junit.runner.Runner in project junit4 by junit-team.
the class MaxStarterTest method correctErrorFromMalformedTest.
@Test
public void correctErrorFromMalformedTest() {
Request request = Request.aClass(MalformedJUnit38TestMethod.class);
JUnitCore core = new JUnitCore();
Request sorted = fMax.sortRequest(request);
Runner runner = sorted.getRunner();
Result result = core.run(runner);
Failure failure = result.getFailures().get(0);
assertThat(failure.toString(), containsString("MalformedJUnit38TestMethod"));
assertThat(failure.toString(), containsString("testNothing"));
assertThat(failure.toString(), containsString("isn't public"));
}
use of org.junit.runner.Runner in project ceylon-compiler by ceylon.
the class CeylonModuleRunner method compileAndRun.
private void compileAndRun(File srcDir, File resDir, File outRepo, String[] modules, String[] dependencies, String[] options, Set<String> removeAtRuntime, String[] modulesUsingCheckFunction, String[] modulesUsingCheckModule) throws Exception {
// Compile all the .ceylon files into a .car
Context context = new Context();
final ErrorCollector listener = new ErrorCollector();
// can't create it until Log
CeyloncFileManager.preRegister(context);
// has been set up
CeylonLog.preRegister(context);
context.put(DiagnosticListener.class, listener);
com.redhat.ceylon.compiler.java.launcher.Main compiler = new com.redhat.ceylon.compiler.java.launcher.Main("ceylonc");
List<String> args = new ArrayList<>();
// args.add("-verbose:code");
args.add("-g");
args.add("-src");
args.add(srcDir.getCanonicalPath());
args.add("-res");
args.add(resDir.getCanonicalPath());
args.add("-out");
args.add(outRepo.getAbsolutePath());
for (String option : options) {
args.add(option);
}
for (String module : modules) args.add(module);
for (String module : dependencies) args.add(module);
compiler.compile(args.toArray(new String[args.size()]), context);
TreeSet<CompilerError> errors = listener.get(Kind.ERROR);
if (!errors.isEmpty()) {
List<Runner> errorRunners = new LinkedList<Runner>();
for (final CompilerError compileError : errors) {
createFailingTest(errorRunners, compileError.filename, new CompilationException(compileError.toString()));
}
for (Runner errorRunner : errorRunners) {
children.put(errorRunner, errorRunner.getDescription());
}
}
// remove what we need for runtime
for (String module : removeAtRuntime) {
File moduleFolder = new File(outRepo, module.replace('.', File.separatorChar));
FileUtil.delete(moduleFolder);
}
for (String module : modules) {
postCompile(context, listener, module, srcDir, dependencies, removeAtRuntime, modulesUsingCheckFunction, modulesUsingCheckModule);
}
}
Aggregations