Java Code Examples for org.junit.runner.Request#classes()
The following examples show how to use
org.junit.runner.Request#classes() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestRunner.java From spoon-examples with GNU General Public License v2.0 | 5 votes |
public static List<Failure> runTest(String fullQualifiedName, String[] classpath) throws MalformedURLException, ClassNotFoundException { ClassLoader classLoader = new URLClassLoader( arrayStringToArrayUrl.apply(classpath), ClassLoader.getSystemClassLoader() ); Request request = Request.classes(classLoader.loadClass(fullQualifiedName)); Runner runner = request.getRunner(); RunNotifier fNotifier = new RunNotifier(); final TestListener listener = new TestListener(); fNotifier.addFirstListener(listener); fNotifier.fireTestRunStarted(runner.getDescription()); runner.run(fNotifier); return listener.getTestFails(); }
Example 2
Source File: TestRunner.java From bazel with Apache License 2.0 | 5 votes |
private static Request createRequest(String[] filepaths) throws ClassNotFoundException { List<Class<?>> classes = new ArrayList<>(filepaths.length); for (String path : filepaths) { classes.add(getClass(path)); } return Request.classes(classes.toArray(new Class<?>[0])); }