use of com.oracle.bedrock.testsupport.junit.JUnit4Test in project oracle-bedrock by coherence-community.
the class JUnitTest method shouldRunJUnitTestsWithClassIncludes.
@Test
public void shouldRunJUnitTestsWithClassIncludes() throws Exception {
SimpleJUnitTestListener listener = new SimpleJUnitTestListener();
try (JUnitTestRun jUnit = platform.launch(JUnitTestRun.class, listener.asOption(), TestClasses.of(JUnit4Test.class, MyOtherTest.class).include("(.)*JUnit4Test"))) {
jUnit.waitFor();
assertThat(listener.awaitCompletion(2, TimeUnit.MINUTES), is(true));
}
assertThat(listener.hasTestFailures(), is(true));
assertThat(listener.getTestCount(), is(3));
assertThat(listener.getErrorCount(), is(0));
assertThat(listener.getFailureCount(), is(1));
assertThat(listener.getSkipCount(), is(2));
}
use of com.oracle.bedrock.testsupport.junit.JUnit4Test in project oracle-bedrock by coherence-community.
the class JUnitTest method shouldRunJUnitTestsFromClassPathWithMethodIncludes.
@Test
public void shouldRunJUnitTestsFromClassPathWithMethodIncludes() throws Exception {
SimpleJUnitTestListener listener = new SimpleJUnitTestListener();
try (JUnitTestRun jUnit = platform.launch(JUnitTestRun.class, listener.asOption(), TestClasses.from(ClassPath.ofClass(AbstractJUnit4Test.class)).include("(.)*JUnit4Test#(.)*Pass(.*)"))) {
jUnit.waitFor();
assertThat(listener.awaitCompletion(2, TimeUnit.MINUTES), is(true));
}
assertThat(listener.hasTestFailures(), is(false));
assertThat(listener.getTestCount(), is(1));
assertThat(listener.getErrorCount(), is(0));
assertThat(listener.getFailureCount(), is(0));
assertThat(listener.getSkipCount(), is(0));
}
Aggregations