1

我使用 Equinox 3.10.1.v20140909-1633 和 Felix 4.6.1 将我的构建迁移到 OSGi R6。不幸的是,Pax Exam 测试在这两个框架中都失败了。我正在使用 Pax Exam 4.4.0。

在 Equinox 3.10.1.v20140909-1633 上执行的测试:

org.osgi.framework.BundleException: Error while renaming bundle file to final location: C:\Temp\1428560128319-0\org.eclipse.osgi\1\0\bundleFile
        at org.eclipse.osgi.storage.Storage.getContentFile0(Storage.java:765)
        at org.eclipse.osgi.storage.Storage.getContentFile(Storage.java:741)
        at org.eclipse.osgi.storage.Storage.install(Storage.java:506)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:146)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:139)
        at org.ops4j.pax.swissbox.framework.RemoteFrameworkImpl.installBundle(RemoteFrameworkImpl.java:120)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
        at sun.rmi.transport.Transport$1.run(Transport.java:178)
        at sun.rmi.transport.Transport$1.run(Transport.java:175)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:174)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
        at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
        at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
        at com.sun.proxy.$Proxy8.installBundle(Unknown Source)
        at org.ops4j.pax.exam.forked.ForkedTestContainer.installAndStartBundles(ForkedTestContainer.java:282)
        at org.ops4j.pax.exam.forked.ForkedTestContainer.start(ForkedTestContainer.java:165)
        at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:79)
        at org.ops4j.pax.exam.junit.impl.ProbeRunner$2.evaluate(ProbeRunner.java:267)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:98)
        at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

在 Felix 4.6.1 上执行的测试:

ERROR: Error reloading cached bundle, removing it: C:\TEMP\1428560514273-0\bundle1 (java.io.FileNotFoundException: C:\TEMP\1428560514273-0\bundle1\bundle.location (Das System kann
die angegebene Datei nicht finden))
java.io.FileNotFoundException: C:\TEMP\1428560514273-0\bundle1\bundle.location (Das System kann die angegebene Datei nicht finden)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.apache.felix.framework.util.SecureAction.getFileInputStream(SecureAction.java:453)
        at org.apache.felix.framework.cache.BundleArchive.readLocation(BundleArchive.java:1107)
        at org.apache.felix.framework.cache.BundleArchive.readBundleInfo(BundleArchive.java:973)
        at org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:182)
        at org.apache.felix.framework.cache.BundleCache.getArchives(BundleCache.java:247)
        at org.apache.felix.framework.Felix.init(Felix.java:754)
        at org.apache.felix.framework.Felix.init(Felix.java:624)
        at org.ops4j.pax.swissbox.framework.RemoteFrameworkImpl.init(RemoteFrameworkImpl.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
        at sun.rmi.transport.Transport$1.run(Transport.java:178)
        at sun.rmi.transport.Transport$1.run(Transport.java:175)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:174)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:557)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:812)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:671)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

我使用 Equinox 3.9.1.v20130814-1242 和 Felix 4.4.1 恢复了我的更改并使用 OSGi R5 执行了 Pax Exam 测试。一切都按预期工作。

Pax Exam 是否对 OSGi R6 框架实现有问题?

更新

我正在使用@ExamReactorStrategy(PerMethod.class)并且所有运行都失败了,除了第一个。第一次运行总是成功。我已经尝试了选项keepCachescleanCaches,但它没有帮助。为什么问题只出现在 R6 框架实现中?有修复或解决方法吗?

4

1 回答 1

0

问题跟踪为PAXEXAM-701。将在 Pax Exam 4.5.0 中修复。

于 2015-04-16T18:50:19.237 回答