I had been using the following code snippet for OSGi tests in EclipseLink project with Pax Exam 3.3.0:
@Configuration
public static Option[] config() {
return options(
repositories("http://repo1.maven.org/maven2"),
mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version("4.3.0"),
mavenBundle().groupId("org.eclipse.persistence").artifactId("org.eclipse.persistence.asm")
.version("2.5.1"),
//JAXB API
bundle("file:" + PLUGINS_DIR + "javax.xml.bind_2.2.12.v201410011542.jar"),
//WS API
bundle("file:" + PLUGINS_DIR + "javax.ws.rs_1.1.1.v20101004-1200.jar"),
//EclipseLink bundles
bundle("file:" + PLUGINS_DIR + "org.eclipse.persistence.moxy_2.7.0." + QUALIFIER + ".jar"),
bundle("file:" + PLUGINS_DIR + "org.eclipse.persistence.core_2.7.0." + QUALIFIER + ".jar"),
bundle("file:" + PLUGINS_DIR + "org.eclipse.persistence.asm_5.0.1.v201405080102.jar"),
junitBundles(),
felix());
}
Now, we switched the build to JDK 8 and I am using Pax Exam 4.4.0, because Pax Exam 3.x does not build with JDK 8. My issue is that Pax Exam 4 no longer provides the convenient org.ops4j.pax.exam.CoreOptions.felix() method. How can I go around this issue? My goal is to run OSGi tests with the least configuration possible.
If I remove the felix() method, I get the following error:
Running org.eclipse.persistence.testing.osgi.OSGiBundleTest
[main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 4.4.0) created.
[main] INFO org.ops4j.pax.exam.junit.impl.ProbeRunner - creating PaxExam runner for class org.eclipse.persistence.testing.osgi.OSGiBundleTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.167 sec <<< FAILURE!
initializationError(org.eclipse.persistence.testing.osgi.OSGiBundleTest) Time elapsed: 0.01 sec <<< ERROR!
org.ops4j.pax.exam.TestContainerException: No service org.osgi.framework.launch.FrameworkFactory found in META-INF/services on classpath
Thanks