stataru8 commented on code in PR #417:
URL: https://github.com/apache/camel-karaf/pull/417#discussion_r1670855311


##########
tests/camel-integration-test/src/main/java/org/apache/karaf/camel/itests/AbstractCamelRouteWithBundleITest.java:
##########
@@ -41,7 +43,8 @@ protected List<String> installRequiredBundles() throws 
Exception {
             throw new IllegalArgumentException("The system property 
project.version must be set to the version of the " +
                     "test bundle to install or the method getTestBundleVersion 
must be overridden to provide the version");
         }
-        installBundle("file://%s/%s-%s.jar".formatted(getBaseDir(), 
testBundleName, testBundleVersion), true);
+        Path bundlePath = Paths.get("%s/%s-%s.jar".formatted(getBaseDir(), 
testBundleName, testBundleVersion));
+        installBundle(bundlePath.toUri().toString(), true);

Review Comment:
   Before the changes I wasn't able to run some integration tests, for 
instance, camel-weather:
   ```
   [ERROR] org.apache.karaf.camel.itest.CamelWeatherITest.testResultMock -- 
Time elapsed: 16.89 s <<< ERROR!
   org.osgi.framework.BundleException: Unable to cache bundle: 
file://C:\Users\stataru\Documents\gitTalend\camel-karaf\tests\features\camel-weather\target/camel-weather-test-4.6
   .0-SNAPSHOT.jar
           at org.apache.felix.framework.Felix.installBundle(Felix.java:3258)
           at 
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:147)
           at 
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:120)
           at 
org.apache.karaf.itests.KarafTestSupport.installBundle(KarafTestSupport.java:772)
           at 
org.apache.karaf.camel.itests.AbstractCamelRouteWithBundleITest.installRequiredBundles(AbstractCamelRouteWithBundleITest.java:44)
           at 
org.apache.karaf.camel.itests.AbstractCamelRouteITest.init(AbstractCamelRouteITest.java:215)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
           at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.base/java.lang.reflect.Method.invoke(Method.java:568)
           at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
           at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
           at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
           at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
           at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
           at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
           at 
org.apache.karaf.itests.KarafTestSupport$Retry$1.evaluate(KarafTestSupport.java:160)
           at org.junit.rules.RunRules.evaluate(RunRules.java:20)
           at 
org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runLeafWithRetry(ContainerTestRunner.java:97)
           at 
org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChildWithRetry(ContainerTestRunner.java:84)
           at 
org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:75)
           at 
org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:43)
           at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
           at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
           at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
           at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
           at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
           at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
           at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
           at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
           at 
org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.invokeViaJUnit(JUnitProbeInvoker.java:124)
           at 
org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.findAndInvoke(JUnitProbeInvoker.java:97)
           at 
org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.call(JUnitProbeInvoker.java:73)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
           at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.base/java.lang.reflect.Method.invoke(Method.java:568)
           at 
org.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl.remoteCall(RemoteBundleContextImpl.java:92)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
           at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.base/java.lang.reflect.Method.invoke(Method.java:568)
           at 
java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
           at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
           at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
           at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
           at 
java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
           at 
java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
           at 
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
           at 
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
           at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
           at 
java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
           at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
           at java.base/java.lang.Thread.run(Thread.java:833)
   Caused by: java.net.UnknownHostException: C
           at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:572)
           at java.base/java.net.Socket.connect(Socket.java:639)
           at 
java.base/sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:1045)
           at 
java.base/sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:1010)
           at java.base/sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1102)
           at java.base/sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1088)
           at 
java.base/sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:320)
           at 
java.base/sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:426)
           at 
org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:677)
           at 
org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
           at 
org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:76)
           at 
org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:819)
           at 
org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:491)
           at 
org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:155)
           at 
org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:457)
           at org.apache.felix.framework.Felix.installBundle(Felix.java:3254)
           ... 54 more
    ```       



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to