0

Pax Exam 3.3.0 を使用した EclipseLink プロジェクトで、OSGi テストに次のコード スニペットを使用していました。

@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());
}

現在、ビルドを JDK 8 に切り替え、Pax Exam 4.4.0 を使用しています。これは、Pax Exam 3.x が JDK 8 でビルドされないためです。私の問題は、Pax Exam 4 が便利な org.ops4j.pax を提供しなくなったことです。 Exam.CoreOptions.felix() メソッド。この問題を回避するにはどうすればよいですか? 私の目標は、最小限の構成で OSGi テストを実行することです。

felix() メソッドを削除すると、次のエラーが発生します。

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

ありがとう

4

1 に答える 1