You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "stataru8 (via GitHub)" <gi...@apache.org> on 2024/07/09 16:04:06 UTC
[PR] Add camel-base64 integration test [camel-karaf]
stataru8 opened a new pull request, #417:
URL: https://github.com/apache/camel-karaf/pull/417
Fixes https://github.com/apache/camel-karaf/issues/416
- Add camel-base64 integration test.
- Fix integration tests path for Windows.
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo merged PR #417:
URL: https://github.com/apache/camel-karaf/pull/417
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "stataru8 (via GitHub)" <gi...@apache.org>.
stataru8 commented on code in PR #417:
URL: https://github.com/apache/camel-karaf/pull/417#discussion_r1670861572
##########
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:
To fix this, I would need to use `file:///C:\Users...` instead of `file://C:\Users...`
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "stataru8 (via GitHub)" <gi...@apache.org>.
stataru8 commented on code in PR #417:
URL: https://github.com/apache/camel-karaf/pull/417#discussion_r1671833402
##########
tests/features/camel-base64/src/main/java/org/apache/karaf/camel/test/CamelBase64RouteSupplier.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.camel.test;
+
+import java.util.function.Function;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier;
+import org.apache.karaf.camel.itests.CamelRouteSupplier;
+import org.osgi.service.component.annotations.Component;
+
+@Component(name = "karaf-camel-base64-test", immediate = true, service = CamelRouteSupplier.class)
+public class CamelBase64RouteSupplier extends AbstractCamelSingleFeatureResultMockBasedRouteSupplier {
+
+ private static final String ORIGINAL_STRING = "Hello Base64! 1234567890 ~`!@#$%^&*()-_=+[]{}|;:'\",.<>?/";
+ private static final int ENCODER_LINE_LENGTH = 9;
+
+ @Override
+ protected void configureProducer(RouteBuilder builder, RouteDefinition producerRoute) {
+ producerRoute.process(ex -> ex.getIn().setBody(ORIGINAL_STRING))
+ .log("Will encode: ${body}")
+ .marshal().base64(ENCODER_LINE_LENGTH, System.lineSeparator(), true)
+ .log("Will send: ${body}")
+ .to("direct:base64Consumer");
+ }
+
+ @Override
+ protected Function<RouteBuilder, RouteDefinition> consumerRoute() {
+ return builder -> builder.from("direct:base64Consumer")
+ .log("Received: ${body}")
+ .unmarshal().base64()
+ .log("Decoded: ${body}")
+ .process(ex -> {
+ String originalString = ex.getIn().getBody(String.class);
+ if(ORIGINAL_STRING.equals(originalString)) {
+ ex.getIn().setBody("OK");
+ }
Review Comment:
But in a way, we are doing the same with "OK". I'll push the change.
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "stataru8 (via GitHub)" <gi...@apache.org>.
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "stataru8 (via GitHub)" <gi...@apache.org>.
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "f2par0 (via GitHub)" <gi...@apache.org>.
f2par0 commented on code in PR #417:
URL: https://github.com/apache/camel-karaf/pull/417#discussion_r1671192643
##########
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:
ok, I guess you're the first one to test on windows :)
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "stataru8 (via GitHub)" <gi...@apache.org>.
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\XXX\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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #417:
URL: https://github.com/apache/camel-karaf/pull/417#discussion_r1671808641
##########
tests/features/camel-base64/src/test/java/org/apache/karaf/camel/itest/CamelBase64ITest.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.camel.itest;
+
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteITest;
+import org.apache.karaf.camel.itests.CamelKarafTestHint;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+
+@CamelKarafTestHint
Review Comment:
Not needed
##########
tests/features/camel-base64/src/main/java/org/apache/karaf/camel/test/CamelBase64RouteSupplier.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.camel.test;
+
+import java.util.function.Function;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier;
+import org.apache.karaf.camel.itests.CamelRouteSupplier;
+import org.osgi.service.component.annotations.Component;
+
+@Component(name = "karaf-camel-base64-test", immediate = true, service = CamelRouteSupplier.class)
+public class CamelBase64RouteSupplier extends AbstractCamelSingleFeatureResultMockBasedRouteSupplier {
+
+ private static final String ORIGINAL_STRING = "Hello Base64! 1234567890 ~`!@#$%^&*()-_=+[]{}|;:'\",.<>?/";
+ private static final int ENCODER_LINE_LENGTH = 9;
+
+ @Override
+ protected void configureProducer(RouteBuilder builder, RouteDefinition producerRoute) {
+ producerRoute.process(ex -> ex.getIn().setBody(ORIGINAL_STRING))
+ .log("Will encode: ${body}")
+ .marshal().base64(ENCODER_LINE_LENGTH, System.lineSeparator(), true)
+ .log("Will send: ${body}")
+ .to("direct:base64Consumer");
+ }
+
+ @Override
+ protected Function<RouteBuilder, RouteDefinition> consumerRoute() {
+ return builder -> builder.from("direct:base64Consumer")
+ .log("Received: ${body}")
+ .unmarshal().base64()
+ .log("Decoded: ${body}")
+ .process(ex -> {
+ String originalString = ex.getIn().getBody(String.class);
+ if(ORIGINAL_STRING.equals(originalString)) {
+ ex.getIn().setBody("OK");
+ }
Review Comment:
Why don't you do this assertion in the ITest class instead of changing it for OK?
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "stataru8 (via GitHub)" <gi...@apache.org>.
stataru8 commented on code in PR #417:
URL: https://github.com/apache/camel-karaf/pull/417#discussion_r1671830323
##########
tests/features/camel-base64/src/main/java/org/apache/karaf/camel/test/CamelBase64RouteSupplier.java:
##########
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.camel.test;
+
+import java.util.function.Function;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.karaf.camel.itests.AbstractCamelSingleFeatureResultMockBasedRouteSupplier;
+import org.apache.karaf.camel.itests.CamelRouteSupplier;
+import org.osgi.service.component.annotations.Component;
+
+@Component(name = "karaf-camel-base64-test", immediate = true, service = CamelRouteSupplier.class)
+public class CamelBase64RouteSupplier extends AbstractCamelSingleFeatureResultMockBasedRouteSupplier {
+
+ private static final String ORIGINAL_STRING = "Hello Base64! 1234567890 ~`!@#$%^&*()-_=+[]{}|;:'\",.<>?/";
+ private static final int ENCODER_LINE_LENGTH = 9;
+
+ @Override
+ protected void configureProducer(RouteBuilder builder, RouteDefinition producerRoute) {
+ producerRoute.process(ex -> ex.getIn().setBody(ORIGINAL_STRING))
+ .log("Will encode: ${body}")
+ .marshal().base64(ENCODER_LINE_LENGTH, System.lineSeparator(), true)
+ .log("Will send: ${body}")
+ .to("direct:base64Consumer");
+ }
+
+ @Override
+ protected Function<RouteBuilder, RouteDefinition> consumerRoute() {
+ return builder -> builder.from("direct:base64Consumer")
+ .log("Received: ${body}")
+ .unmarshal().base64()
+ .log("Decoded: ${body}")
+ .process(ex -> {
+ String originalString = ex.getIn().getBody(String.class);
+ if(ORIGINAL_STRING.equals(originalString)) {
+ ex.getIn().setBody("OK");
+ }
Review Comment:
I would need to keep track of `ORIGINAL_STRING`'s value in both classes, `CamelBase64RouteSupplier` and `CamelBase64ITest`.
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add camel-base64 integration test [camel-karaf]
Posted by "f2par0 (via GitHub)" <gi...@apache.org>.
f2par0 commented on code in PR #417:
URL: https://github.com/apache/camel-karaf/pull/417#discussion_r1670833456
##########
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:
is there a behavior changed with this modification ?
--
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-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org