Java Code Examples for org.junit.runners.model.RunnerBuilder#runnerForClass()
The following examples show how to use
org.junit.runners.model.RunnerBuilder#runnerForClass() .
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: FastTestsOnlySuite.java From aws-encryption-sdk-java with Apache License 2.0 | 6 votes |
public CustomRunner(Class<?> klass, RunnerBuilder builder) throws InitializationError { super( klass, new RunnerBuilder() { @Override public Runner runnerForClass(Class<?> testClass) throws Throwable { Boolean oldValue = IS_FAST_TEST_SUITE_ACTIVE.get(); try { IS_FAST_TEST_SUITE_ACTIVE.set(true); Runner r = builder.runnerForClass(testClass); return r; } finally { IS_FAST_TEST_SUITE_ACTIVE.set(oldValue); } } } ); }
Example 2
Source File: AdaptedJUnitTestUnit.java From pitest with Apache License 2.0 | 5 votes |
public static Runner createRunner(final Class<?> clazz) { final RunnerBuilder builder = createRunnerBuilder(); try { return builder.runnerForClass(clazz); } catch (final Throwable ex) { LOG.log(Level.SEVERE, "Error while creating runner for " + clazz, ex); throw translateCheckedException(ex); } }