Java 类org.junit.internal.builders.JUnit4Builder 实例源码
项目:effektif
文件:TestSuiteHelper.java
public static void run(Configuration configuration, Class<?> clazz, String methodName) {
try {
Request request = null;
if (clazz!=null && methodName!=null) {
request = Request.method(clazz, methodName);
} else {
Suite suite = new Suite(new JUnit4Builder(), API_TEST_CLASSES);
request = Request.runner(suite);
}
Configuration originalConfiguration = WorkflowTest.cachedConfiguration;
WorkflowTest.cachedConfiguration = configuration;
JUnitCore junitCore = new JUnitCore();
Result result = junitCore.run(request);
WorkflowTest.cachedConfiguration = originalConfiguration;
checkResult(result);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
项目:effektif
文件:TestSuiteHelper.java
public static void run(Configuration configuration, Class<?> clazz, String methodName) {
try {
Request request = null;
if (clazz!=null && methodName!=null) {
request = Request.method(clazz, methodName);
} else {
Suite suite = new Suite(new JUnit4Builder(), API_TEST_CLASSES);
request = Request.runner(suite);
}
Configuration originalConfiguration = WorkflowTest.cachedConfiguration;
WorkflowTest.cachedConfiguration = configuration;
JUnitCore junitCore = new JUnitCore();
Result result = junitCore.run(request);
WorkflowTest.cachedConfiguration = originalConfiguration;
checkResult(result);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
项目:sweet-junit-runner
文件:SuiteRunnerTest.java
@Test
public void shouldProcessTestFiles() throws Exception {
// when
SuiteRunner suiteRunner = new SuiteRunner(IntegrationTestSuite.class, new JUnit4Builder());
// then
assertEquals(IntegrationTestSuite.class.getName(), suiteRunner.getTestClass().getName());
}
项目:Reer
文件:AllExceptIgnoredTestRunnerBuilder.java
@Override
protected JUnit4Builder junit4Builder() {
return new FallbackJUnit4Builder();
}
项目:sweet-junit-runner
文件:SuiteRunnerTest.java
@Test(expected = InitializationError.class)
public void shouldFailIfConfigurationIsMissing() throws Exception {
new SuiteRunner(IgnoredNotAnnotatedTest.class, new JUnit4Builder());
}
项目:Pushjet-Android
文件:AllExceptIgnoredTestRunnerBuilder.java
protected JUnit4Builder junit4Builder() {
return new FallbackJUnit4Builder();
}
项目:Pushjet-Android
文件:AllExceptIgnoredTestRunnerBuilder.java
protected JUnit4Builder junit4Builder() {
return new FallbackJUnit4Builder();
}