java - Pax-exam 4 no felix() method -


i had been using following code snippet osgi tests in eclipselink project 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, switched build jdk 8 , using pax exam 4.4.0, because pax exam 3.x not build jdk 8. issue pax exam 4 no longer provides convenient org.ops4j.pax.exam.coreoptions.felix() method. how can go around issue? goal run osgi tests least configuration possible.

if remove felix() method, 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 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

felix() , other framework options have been deprecated long time ago, before pax exam 3.3.0, if remember correctly, i'm bit surprised version information.

anyway, if want run tests on felix, make sure felix osgi implementation on classpath, , that's it. no need explicit option.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -