Search in sources :

Example 26 with ClassPath

use of com.oracle.bedrock.runtime.java.ClassPath in project oracle-bedrock by coherence-community.

the class TestClassesClassPathClassesTest method shouldLoadJUnit3TestClassFromJar.

@Test
public void shouldLoadJUnit3TestClassFromJar() throws Exception {
    File jar = createJar(JUnit3Test.class);
    ClassPath classPath = ClassPath.ofFile(jar);
    TestClasses.ClassPathClasses testClasses = new TestClasses.ClassPathClasses(classPath);
    Set<Class<?>> classes = testClasses.resolveTestClasses();
    assertThat(classes, is(notNullValue()));
    assertThat(classes, containsInAnyOrder(JUnit3Test.class));
}
Also used : TestClasses(com.oracle.bedrock.testsupport.junit.options.TestClasses) ClassPath(com.oracle.bedrock.runtime.java.ClassPath) JUnit3Test(com.oracle.bedrock.testsupport.junit.JUnit3Test) File(java.io.File) RunWithAnnotatedTest(com.oracle.bedrock.testsupport.junit.RunWithAnnotatedTest) AbstractJUnit4Test(com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test) JUnit4Test(com.oracle.bedrock.testsupport.junit.JUnit4Test) JUnit3Test(com.oracle.bedrock.testsupport.junit.JUnit3Test) Test(org.junit.Test)

Example 27 with ClassPath

use of com.oracle.bedrock.runtime.java.ClassPath in project oracle-bedrock by coherence-community.

the class TestClassesClassPathClassesTest method shouldLoadJUnit3TestClass.

@Test
public void shouldLoadJUnit3TestClass() throws Exception {
    File folder = createClassesFolder(JUnit3Test.class);
    ClassPath classPath = ClassPath.ofFile(folder);
    TestClasses.ClassPathClasses testClasses = new TestClasses.ClassPathClasses(classPath);
    Set<Class<?>> classes = testClasses.resolveTestClasses();
    assertThat(classes, is(notNullValue()));
    assertThat(classes, containsInAnyOrder(JUnit3Test.class));
}
Also used : TestClasses(com.oracle.bedrock.testsupport.junit.options.TestClasses) ClassPath(com.oracle.bedrock.runtime.java.ClassPath) JUnit3Test(com.oracle.bedrock.testsupport.junit.JUnit3Test) File(java.io.File) RunWithAnnotatedTest(com.oracle.bedrock.testsupport.junit.RunWithAnnotatedTest) AbstractJUnit4Test(com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test) JUnit4Test(com.oracle.bedrock.testsupport.junit.JUnit4Test) JUnit3Test(com.oracle.bedrock.testsupport.junit.JUnit3Test) Test(org.junit.Test)

Example 28 with ClassPath

use of com.oracle.bedrock.runtime.java.ClassPath in project oracle-bedrock by coherence-community.

the class TestClassesClassPathClassesTest method shouldLoadJUnit3SuiteClassFromJar.

@Test
public void shouldLoadJUnit3SuiteClassFromJar() throws Exception {
    File jar = createJar(JUnit3Suite.class);
    ClassPath classPath = ClassPath.ofFile(jar);
    TestClasses.ClassPathClasses testClasses = new TestClasses.ClassPathClasses(classPath);
    Set<Class<?>> classes = testClasses.resolveTestClasses();
    assertThat(classes, is(notNullValue()));
    assertThat(classes, containsInAnyOrder(JUnit3Suite.class));
}
Also used : TestClasses(com.oracle.bedrock.testsupport.junit.options.TestClasses) JUnit3Suite(com.oracle.bedrock.testsupport.junit.JUnit3Suite) ClassPath(com.oracle.bedrock.runtime.java.ClassPath) File(java.io.File) RunWithAnnotatedTest(com.oracle.bedrock.testsupport.junit.RunWithAnnotatedTest) AbstractJUnit4Test(com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test) JUnit4Test(com.oracle.bedrock.testsupport.junit.JUnit4Test) JUnit3Test(com.oracle.bedrock.testsupport.junit.JUnit3Test) Test(org.junit.Test)

Example 29 with ClassPath

use of com.oracle.bedrock.runtime.java.ClassPath in project oracle-bedrock by coherence-community.

the class TestClassesClassPathClassesTest method shouldLoadJUnit4TestClassFromJar.

@Test
public void shouldLoadJUnit4TestClassFromJar() throws Exception {
    File jar = createJar(JUnit4Test.class);
    ClassPath classPath = ClassPath.ofFile(jar);
    TestClasses.ClassPathClasses testClasses = new TestClasses.ClassPathClasses(classPath);
    Set<Class<?>> classes = testClasses.resolveTestClasses();
    assertThat(classes, is(notNullValue()));
    assertThat(classes, containsInAnyOrder(JUnit4Test.class));
}
Also used : TestClasses(com.oracle.bedrock.testsupport.junit.options.TestClasses) ClassPath(com.oracle.bedrock.runtime.java.ClassPath) AbstractJUnit4Test(com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test) JUnit4Test(com.oracle.bedrock.testsupport.junit.JUnit4Test) File(java.io.File) RunWithAnnotatedTest(com.oracle.bedrock.testsupport.junit.RunWithAnnotatedTest) AbstractJUnit4Test(com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test) JUnit4Test(com.oracle.bedrock.testsupport.junit.JUnit4Test) JUnit3Test(com.oracle.bedrock.testsupport.junit.JUnit3Test) Test(org.junit.Test)

Aggregations

ClassPath (com.oracle.bedrock.runtime.java.ClassPath)29 Test (org.junit.Test)21 File (java.io.File)12 TestClasses (com.oracle.bedrock.testsupport.junit.options.TestClasses)10 AbstractJUnit4Test (com.oracle.bedrock.testsupport.junit.AbstractJUnit4Test)9 JUnit3Test (com.oracle.bedrock.testsupport.junit.JUnit3Test)9 JUnit4Test (com.oracle.bedrock.testsupport.junit.JUnit4Test)9 RunWithAnnotatedTest (com.oracle.bedrock.testsupport.junit.RunWithAnnotatedTest)9 OptionsByType (com.oracle.bedrock.OptionsByType)4 LocalPlatform (com.oracle.bedrock.runtime.LocalPlatform)4 MetaClass (com.oracle.bedrock.runtime.MetaClass)4 JavaAgent (com.oracle.bedrock.runtime.java.options.JavaAgent)3 DummyClass (classloader.child.DummyClass)2 AvailablePortIterator (com.oracle.bedrock.runtime.network.AvailablePortIterator)2 JUnit3Suite (com.oracle.bedrock.testsupport.junit.JUnit3Suite)2 Capture (com.oracle.bedrock.util.Capture)2 LinkedHashSet (java.util.LinkedHashSet)2 DummyParentLoadedClass (classloader.parent.DummyParentLoadedClass)1 JavaApplication (com.oracle.bedrock.runtime.java.JavaApplication)1 ContainerClassLoader (com.oracle.bedrock.runtime.java.container.ContainerClassLoader)1