Search in sources :

Example 1 with MyOtherTest

use of com.oracle.bedrock.testsupport.junit.MyOtherTest in project oracle-bedrock by coherence-community.

the class JUnitTest method shouldRunJUnitTestsWithClassExcludes.

@Test
public void shouldRunJUnitTestsWithClassExcludes() throws Exception {
    SimpleJUnitTestListener listener = new SimpleJUnitTestListener();
    try (JUnitTestRun jUnit = platform.launch(JUnitTestRun.class, listener.asOption(), TestClasses.of(JUnit4Test.class, MyOtherTest.class).exclude("(.)*MyOtherTest(.)*"))) {
        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));
}
Also used : JUnitTestRun(com.oracle.bedrock.testsupport.junit.JUnitTestRun) SimpleJUnitTestListener(com.oracle.bedrock.testsupport.junit.SimpleJUnitTestListener) AbstractJUnit4Test(com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test) MyBadTest(com.oracle.bedrock.testsupport.junit.MyBadTest) JUnit4Test(com.oracle.bedrock.testsupport.junit.JUnit4Test) MyOtherTest(com.oracle.bedrock.testsupport.junit.MyOtherTest) Test(org.junit.Test)

Aggregations

AbstractJUnit4Test (com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test)1 JUnit4Test (com.oracle.bedrock.testsupport.junit.JUnit4Test)1 JUnitTestRun (com.oracle.bedrock.testsupport.junit.JUnitTestRun)1 MyBadTest (com.oracle.bedrock.testsupport.junit.MyBadTest)1 MyOtherTest (com.oracle.bedrock.testsupport.junit.MyOtherTest)1 SimpleJUnitTestListener (com.oracle.bedrock.testsupport.junit.SimpleJUnitTestListener)1 Test (org.junit.Test)1