You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/02/17 21:07:58 UTC
[camel-quarkus] branch 2.13.x updated (65541c5ff4 -> 8f4bd39223)
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a change to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
from 65541c5ff4 test - Define routes in YAML DSL using beans declared in Java
new 0e61013e12 Exclude org.testcontainers:postgresql from camel-pgevent
new 2fa67951c6 xml-io: Remove the use of XMLRoutesDefinitionLoader deprecated class #4564
new b324920bf5 Use XML DSL to define templated route in integration test
new cc2aaeabc8 xml-io: document the possibility to add all charsets in native mode #4572
new 4e411dbc86 Restore ability for camel.main.javaRoutesIncludePattern to be overridable at runtime
new 3b396e4373 create itest project for xml-io + bean #4579
new 58b998bc6d Multiple test methods do not work when extending CamelQuarkusTestSupport #4560
new 8f4bd39223 CamelQuarkusTestSupport: Lifecycle.PER_CLASS may cause following tests to fail #4569
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../pages/reference/extensions/xml-io-dsl.adoc | 10 +++
.../pages/user-guide/defining-camel-routes.adoc | 7 ++
.../quarkus/core/deployment/CamelProcessor.java | 25 ------
.../core/deployment/main/CamelMainProcessor.java | 7 +-
...ainRoutesExcludeFilterCombinedPropertyTest.java | 95 ---------------------
.../main/CamelMainRoutesExcludeFilterTest.java | 3 +-
...ainRoutesIncludeFilterCombinedPropertyTest.java | 96 ----------------------
.../core/DisabledXMLRoutesDefinitionLoader.java | 39 ---------
.../camel/quarkus/core/FastCamelContext.java | 6 --
.../camel/quarkus/main/CamelMainRecorder.java | 9 +-
.../quarkus/main/CamelMainRoutesCollector.java | 27 +-----
.../runtime/src/main/doc/configuration.adoc | 4 +
.../{flatpack => main-xml-io-with-beans}/pom.xml | 33 ++++----
.../main/CoreMainXmlIoWithBeansResource.java | 12 ++-
.../org/apache/camel/quarkus/main/MyBean.java} | 10 ++-
.../src/main/resources/application.properties | 11 ++-
.../resources/routes/my-route-with-beanType.xml} | 8 +-
.../quarkus/main/CoreMainXmlIoWithBeansIT.java} | 2 +-
.../quarkus/main/CoreMainXmlIoWithBeansTest.java | 12 +--
.../camel/quarkus/main/CoreMainXmlIoResource.java | 9 +-
.../src/main/resources/application.properties | 3 +-
.../resources/routes/my-routes-iso_8859_15.xml} | 10 +--
.../src/main/resources/routes/my-templated.xml | 13 ++-
.../camel/quarkus/main/CoreMainXmlIoTest.java | 14 +++-
.../quarkus/main/CoreMainXmlJaxbResource.java | 1 -
.../camel/quarkus/main/CoreMainXmlJaxbTest.java | 3 -
.../camel/quarkus/main/CoreMainResource.java | 2 -
.../apache/camel/quarkus/main/CoreMainTest.java | 3 -
integration-tests/pom.xml | 1 +
poms/bom/pom.xml | 4 +
poms/bom/src/main/generated/flattened-full-pom.xml | 4 +
.../src/main/generated/flattened-reduced-pom.xml | 4 +
.../generated/flattened-reduced-verbose-pom.xml | 4 +
.../DoubleRoutesTest.java} | 16 ++--
.../extensions/doubeRouteBuilder/FirstET.java} | 52 ++++++------
.../extensions/doubeRouteBuilder/RouteBuilder.java | 10 +--
.../extensions/doubeRouteBuilder/SecondET.java} | 52 ++++++------
.../DoubleRoutesPerClassTest.java} | 16 ++--
.../FirstPerClassET.java} | 51 ++++++------
.../RouteBuilderPerClass.java | 10 +--
.../SecondPerClassET.java} | 51 ++++++------
.../ProducedRouteBuilderTest.java | 4 +-
.../routeBuilder/RouteBuilderFailureTest.java | 18 +++-
.../extensions/routeBuilder/RouteBuilderUtil.java | 45 ----------
.../routeBuilder/RouteBuilderWarningET.java | 17 +---
.../routeBuilder/RouteBuilderWarningResource.java | 42 ----------
...RouteBuilderWarningWithProducedBuilderTest.java | 19 ++++-
...teBuilderWarningWithoutProducedBuilderTest.java | 18 +++-
.../{RouteBuilderHello.java => RouteProducer.java} | 17 ++--
.../camel/quarkus/test/AfterAllCallback.java | 6 +-
.../apache/camel/quarkus/test/CallbackUtil.java | 12 +--
.../quarkus/test/CamelQuarkusTestSupport.java | 31 ++++++-
.../test/common/CallbacksPerTestFalse01Test.java | 2 -
.../test/common/CallbacksPerTestFalse02Test.java | 7 +-
.../test/common/CallbacksPerTestTrue01Test.java | 2 -
.../test/common/CallbacksPerTestTrue02Test.java | 4 +-
.../test/junit5/patterns/AdviceWithLambdaTest.java | 2 +
.../AdviceInDoBeforeEachMethodsTest.java | 4 +-
tooling/scripts/test-categories.yaml | 1 +
59 files changed, 349 insertions(+), 651 deletions(-)
delete mode 100644 extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterCombinedPropertyTest.java
delete mode 100644 extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesIncludeFilterCombinedPropertyTest.java
delete mode 100644 extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java
create mode 100644 extensions-core/xml-io-dsl/runtime/src/main/doc/configuration.adoc
copy integration-tests/{flatpack => main-xml-io-with-beans}/pom.xml (91%)
copy integration-tests-jvm/groovy/src/main/java/org/apache/camel/quarkus/component/groovy/it/GroovyResource.java => integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansResource.java (87%)
copy integration-tests/{main-yaml/src/main/java/org/apache/camel/quarkus/main/ErrorBean.java => main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/MyBean.java} (86%)
copy integration-tests/{freemarker => main-xml-io-with-beans}/src/main/resources/application.properties (91%)
copy integration-tests/{csimple/src/main/resources/routes/my-routes.xml => main-xml-io-with-beans/src/main/resources/routes/my-route-with-beanType.xml} (87%)
copy integration-tests/{main-yaml/src/test/java/org/apache/camel/quarkus/main/CoreMainYamlIT.java => main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansIT.java} (92%)
copy integration-tests-jvm/groovy/src/test/java/org/apache/camel/quarkus/component/groovy/it/GroovyTest.java => integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansTest.java (78%)
copy integration-tests/{csimple/src/main/resources/routes/my-routes.xml => main-xml-io/src/main/resources/routes/my-routes-iso_8859_15.xml} (82%)
copy integration-tests-jvm/hbase/src/main/resources/hbase-site.xml => integration-tests/main-xml-io/src/main/resources/routes/my-templated.xml (74%)
copy test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/{producedRouteBuilder/ProducedRouteBuilderTest.java => doubeRouteBuilder/DoubleRoutesTest.java} (82%)
copy test-framework/{junit5/src/test/java/org/apache/camel/quarkus/test/common/AbstractSimpleMockTest.java => junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/FirstET.java} (55%)
copy integration-test-groups/foundation/browse/src/main/java/org/apache/camel/quarkus/component/browse/it/BrowseRoutes.java => test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/RouteBuilder.java (71%)
copy test-framework/{junit5/src/test/java/org/apache/camel/quarkus/test/common/AbstractSimpleMockTest.java => junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/SecondET.java} (55%)
copy test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/{producedRouteBuilder/ProducedRouteBuilderTest.java => doubeRouteBuilderPerClass/DoubleRoutesPerClassTest.java} (81%)
copy test-framework/{junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java => junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/FirstPerClassET.java} (53%)
copy integration-test-groups/foundation/browse/src/main/java/org/apache/camel/quarkus/component/browse/it/BrowseRoutes.java => test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/RouteBuilderPerClass.java (70%)
copy test-framework/{junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/FilterCreateCamelContextPerClassTest.java => junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/SecondPerClassET.java} (53%)
delete mode 100644 test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderUtil.java
delete mode 100644 test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningResource.java
rename test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/{RouteBuilderHello.java => RouteProducer.java} (76%)
[camel-quarkus] 08/08: CamelQuarkusTestSupport: Lifecycle.PER_CLASS may cause following tests to fail #4569
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 8f4bd39223b500315fe10a6df7cccfcfddb1dcfe
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Wed Feb 15 10:08:20 2023 +0100
CamelQuarkusTestSupport: Lifecycle.PER_CLASS may cause following tests to fail #4569
---
.../DoubleRoutesPerClassTest.java | 61 ++++++++++++++++++++++
.../doubeRouteBuilderPerClass/FirstPerClassET.java | 60 +++++++++++++++++++++
.../RouteBuilderPerClass.java} | 26 +++------
.../SecondPerClassET.java | 60 +++++++++++++++++++++
.../camel/quarkus/test/AfterAllCallback.java | 6 ++-
.../quarkus/test/CamelQuarkusTestSupport.java | 9 +++-
.../test/common/CallbacksPerTestFalse02Test.java | 2 +-
.../test/common/CallbacksPerTestTrue02Test.java | 2 +-
.../AdviceInDoBeforeEachMethodsTest.java | 2 +-
9 files changed, 202 insertions(+), 26 deletions(-)
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/DoubleRoutesPerClassTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/DoubleRoutesPerClassTest.java
new file mode 100644
index 0000000000..77baa4a278
--- /dev/null
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/DoubleRoutesPerClassTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.camel.quarkus.test.extensions.doubeRouteBuilderPerClass;
+
+import java.util.function.Supplier;
+
+import io.quarkus.test.ContinuousTestingTestUtils;
+import io.quarkus.test.QuarkusDevModeTest;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+/**
+ * Test for https://github.com/apache/camel-quarkus/issues/4560
+ */
+public class DoubleRoutesPerClassTest {
+
+ @RegisterExtension
+ static final QuarkusDevModeTest TEST = new QuarkusDevModeTest()
+ .setArchiveProducer(new Supplier<>() {
+ @Override
+ public JavaArchive get() {
+ return ShrinkWrap.create(JavaArchive.class).addClass(RouteBuilderPerClass.class)
+ .add(new StringAsset(
+ ContinuousTestingTestUtils.appProperties("#")),
+ "application.properties");
+ }
+ })
+ .setTestArchiveProducer(new Supplier<>() {
+ @Override
+ public JavaArchive get() {
+ return ShrinkWrap.create(JavaArchive.class).addClasses(FirstPerClassET.class, SecondPerClassET.class);
+ }
+ });
+
+ @Test
+ public void checkTests() {
+ ContinuousTestingTestUtils utils = new ContinuousTestingTestUtils();
+ ContinuousTestingTestUtils.TestStatus ts = utils.waitForNextCompletion();
+
+ Assertions.assertEquals(0L, ts.getTestsFailed());
+ Assertions.assertEquals(4L, ts.getTestsPassed());
+ }
+}
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/FirstPerClassET.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/FirstPerClassET.java
new file mode 100644
index 0000000000..759236ad4f
--- /dev/null
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/FirstPerClassET.java
@@ -0,0 +1,60 @@
+/*
+ * 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.camel.quarkus.test.extensions.doubeRouteBuilderPerClass;
+
+import io.quarkus.test.junit.QuarkusTest;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
+
+@QuarkusTest
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+public class FirstPerClassET extends CamelQuarkusTestSupport {
+
+ @Override
+ protected RoutesBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:startTest").to("direct:start").to("mock:result");
+ }
+ };
+ }
+
+ @Test
+ public void someTestA() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
+
+ template.sendBody("direct:startTest", null);
+
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ public void someTestB() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
+
+ template.sendBody("direct:startTest", null);
+
+ mockEndpoint.assertIsSatisfied();
+ }
+}
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/RouteBuilderPerClass.java
similarity index 53%
copy from test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
copy to test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/RouteBuilderPerClass.java
index 472d5d319f..a33b1d2b3e 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/RouteBuilderPerClass.java
@@ -14,27 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.test.common;
+package org.apache.camel.quarkus.test.extensions.doubeRouteBuilderPerClass;
-import java.util.concurrent.TimeUnit;
-
-import io.quarkus.test.junit.QuarkusTest;
-import org.hamcrest.Matchers;
-import org.junit.jupiter.api.Test;
-
-import static org.awaitility.Awaitility.await;
-
-// replaces CreateCamelContextPerTestTrueTest
-@QuarkusTest
-public class CallbacksPerTestTrue02Test {
-
- @Test
- public void testAfter01Class() {
-
- await().atMost(5, TimeUnit.SECONDS).until(() -> AbstractCallbacksTest.testFromAnotherClass(
- CallbacksPerTestTrue02Test.class.getSimpleName(),
- CallbacksPerTestTrue01Test.createAssertionConsumer()),
- Matchers.is(AbstractCallbacksTest.Callback.values().length));
+public class RouteBuilderPerClass extends org.apache.camel.builder.RouteBuilder {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").setBody(constant("Some Value")).log("The body is: ${body}");
+ from("timer:timeToAct?period=5000").routeId("TimerRoute").log("Calling direct:start").to("direct:start");
}
}
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/SecondPerClassET.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/SecondPerClassET.java
new file mode 100644
index 0000000000..563ebc565f
--- /dev/null
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilderPerClass/SecondPerClassET.java
@@ -0,0 +1,60 @@
+/*
+ * 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.camel.quarkus.test.extensions.doubeRouteBuilderPerClass;
+
+import io.quarkus.test.junit.QuarkusTest;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
+
+@QuarkusTest
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+public class SecondPerClassET extends CamelQuarkusTestSupport {
+
+ @Override
+ protected RoutesBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:startTest").to("direct:start").to("mock:result");
+ }
+ };
+ }
+
+ @Test
+ public void someTestA() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
+
+ template.sendBody("direct:startTest", null);
+
+ mockEndpoint.assertIsSatisfied();
+ }
+
+ @Test
+ public void someTestB() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
+
+ template.sendBody("direct:startTest", null);
+
+ mockEndpoint.assertIsSatisfied();
+ }
+}
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterAllCallback.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterAllCallback.java
index f6cb1f84be..ca01e45172 100644
--- a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterAllCallback.java
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/AfterAllCallback.java
@@ -18,6 +18,7 @@ package org.apache.camel.quarkus.test;
import io.quarkus.test.junit.callback.QuarkusTestAfterAllCallback;
import io.quarkus.test.junit.callback.QuarkusTestContext;
+import org.junit.jupiter.api.extension.ExtensionContext;
public class AfterAllCallback implements QuarkusTestAfterAllCallback {
@@ -27,7 +28,10 @@ public class AfterAllCallback implements QuarkusTestAfterAllCallback {
CamelQuarkusTestSupport testInstance = (CamelQuarkusTestSupport) context.getTestInstance();
if (CallbackUtil.isPerClass(testInstance)) {
- testInstance.internalAfterAll(context);
+ ExtensionContext mockContext = new CallbackUtil.MockExtensionContext(CallbackUtil.getLifecycle(testInstance),
+ null);
+
+ testInstance.internalAfterAll(context, mockContext);
CallbackUtil.resetContext(testInstance);
}
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java
index 50f6bd9c6e..eea4e71d43 100644
--- a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java
@@ -282,10 +282,15 @@ public class CamelQuarkusTestSupport extends CamelTestSupport
}
}
- void internalAfterAll(QuarkusTestContext context) {
+ void internalAfterAll(QuarkusTestContext context, ExtensionContext extensionContext) {
try {
- doPostTearDown();
+ if (isCreateCamelContextPerClass()) {
+ super.afterAll(extensionContext);
+ } else {
+ doPostTearDown();
+ }
cleanupResources();
+
} catch (Exception e) {
// ignore
}
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java
index 9bb7834a79..cfd85fff3e 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
-// replaces CreateCamelContextPerTestTrueTest
+// requires CallbacksPerTestFalse01Test to be run before
@QuarkusTest
public class CallbacksPerTestFalse02Test {
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
index 472d5d319f..9bcf600cdb 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
@@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
-// replaces CreateCamelContextPerTestTrueTest
+// requires CallbacksPerTestTrue01Test to be run before
@QuarkusTest
public class CallbacksPerTestTrue02Test {
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java
index d3df9b6662..1c27fcf7e8 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java
@@ -52,7 +52,7 @@ public class AdviceInDoBeforeEachMethodsTest extends CamelQuarkusTestSupport {
public void configure() {
from("direct:start")
.routeId("sampleRoute")
- .to("file:samples/");
+ .to("file:target/samples/");
}
};
}
[camel-quarkus] 03/08: Use XML DSL to define templated route in integration test
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit b324920bf5d861d450b67fd327ac2ebfed7db271
Author: Tomas Turek <tt...@redhat.com>
AuthorDate: Mon Feb 13 14:24:43 2023 +0100
Use XML DSL to define templated route in integration test
Signed-off-by: Tomas Turek <tt...@redhat.com>
---
.../camel/quarkus/main/CoreMainXmlIoResource.java | 7 ------
.../src/main/resources/application.properties | 2 +-
.../src/main/resources/routes/my-templated.xml | 25 ++++++++++++++++++++++
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
index 51cb960d23..50fcdae936 100644
--- a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
+++ b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
@@ -38,7 +38,6 @@ import javax.ws.rs.core.UriInfo;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.TemplatedRouteBuilder;
import org.apache.camel.dsl.xml.io.XmlRoutesBuilderLoader;
import org.apache.camel.spi.RoutesBuilderLoader;
@@ -63,12 +62,6 @@ public class CoreMainXmlIoResource {
JsonArrayBuilder routeBuilders = Json.createArrayBuilder();
main.configure().getRoutesBuilders().forEach(builder -> routeBuilders.add(builder.getClass().getName()));
- TemplatedRouteBuilder.builder(main.getCamelContext(), "myTemplate")
- .parameter("name", "Camel Quarkus")
- .parameter("greeting", "Hello")
- .routeId("templated-route")
- .add();
-
JsonArrayBuilder routes = Json.createArrayBuilder();
main.getCamelContext().getRoutes().forEach(route -> routes.add(route.getId()));
diff --git a/integration-tests/main-xml-io/src/main/resources/application.properties b/integration-tests/main-xml-io/src/main/resources/application.properties
index 2ff43c93ac..d02938b70c 100644
--- a/integration-tests/main-xml-io/src/main/resources/application.properties
+++ b/integration-tests/main-xml-io/src/main/resources/application.properties
@@ -28,4 +28,4 @@ camel.rest.component = platform-http
#
# Main
#
-camel.main.routes-include-pattern = routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml
+camel.main.routes-include-pattern = routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml
diff --git a/integration-tests/main-xml-io/src/main/resources/routes/my-templated.xml b/integration-tests/main-xml-io/src/main/resources/routes/my-templated.xml
new file mode 100644
index 0000000000..adb162fc94
--- /dev/null
+++ b/integration-tests/main-xml-io/src/main/resources/routes/my-templated.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<templatedRoutes xmlns="http://camel.apache.org/schema/spring">
+ <templatedRoute routeId="templated-route" routeTemplateRef="myTemplate">
+ <parameter name="name" value="Camel Quarkus"/>
+ <parameter name="greeting" value="Hello"/>
+ </templatedRoute>
+</templatedRoutes>
[camel-quarkus] 05/08: Restore ability for camel.main.javaRoutesIncludePattern to be overridable at runtime
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 4e411dbc86311ea300abb35126e119ff554143e6
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Feb 15 10:55:28 2023 +0000
Restore ability for camel.main.javaRoutesIncludePattern to be overridable at runtime
Fixes #4574
---
.../quarkus/core/deployment/CamelProcessor.java | 25 ------
.../core/deployment/main/CamelMainProcessor.java | 7 +-
...ainRoutesExcludeFilterCombinedPropertyTest.java | 95 ---------------------
.../main/CamelMainRoutesExcludeFilterTest.java | 3 +-
...ainRoutesIncludeFilterCombinedPropertyTest.java | 96 ----------------------
.../camel/quarkus/main/CamelMainRecorder.java | 9 +-
.../quarkus/main/CamelMainRoutesCollector.java | 27 +-----
7 files changed, 8 insertions(+), 254 deletions(-)
diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java
index ab57746e1f..b72b9ecaad 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java
@@ -23,7 +23,6 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashSet;
import java.util.List;
-import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.function.Predicate;
@@ -77,8 +76,6 @@ import org.apache.camel.quarkus.core.deployment.util.PathFilter;
import org.apache.camel.quarkus.core.util.FileUtils;
import org.apache.camel.spi.TypeConverterLoader;
import org.apache.camel.spi.TypeConverterRegistry;
-import org.eclipse.microprofile.config.Config;
-import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.jandex.AnnotationTarget;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
@@ -367,28 +364,6 @@ class CamelProcessor {
allKnownImplementors.addAll(index.getAllKnownSubclasses(ROUTE_BUILDER_TYPE));
allKnownImplementors.addAll(index.getAllKnownSubclasses(ADVICE_WITH_ROUTE_BUILDER_TYPE));
- Config config = ConfigProvider.getConfig();
- Optional<List<String>> camelMainRoutesExclude = config.getOptionalValues("camel.main.javaRoutesExcludePattern",
- String.class);
- Optional<List<String>> camelMainRoutesInclude = config.getOptionalValues("camel.main.javaRoutesIncludePattern",
- String.class);
-
- camelMainRoutesExclude.ifPresent(excludes -> {
- if (camelConfig.routesDiscovery.excludePatterns.isPresent()) {
- camelConfig.routesDiscovery.excludePatterns.get().addAll(excludes);
- } else {
- camelConfig.routesDiscovery.excludePatterns = Optional.of(excludes);
- }
- });
-
- camelMainRoutesInclude.ifPresent(includes -> {
- if (camelConfig.routesDiscovery.includePatterns.isPresent()) {
- camelConfig.routesDiscovery.includePatterns.get().addAll(includes);
- } else {
- camelConfig.routesDiscovery.includePatterns = Optional.of(includes);
- }
- });
-
final Predicate<DotName> pathFilter = new PathFilter.Builder()
.exclude(
routesBuilderClassExcludes.stream()
diff --git a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/main/CamelMainProcessor.java b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/main/CamelMainProcessor.java
index 395043bbbd..cc6194f989 100644
--- a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/main/CamelMainProcessor.java
+++ b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/main/CamelMainProcessor.java
@@ -79,11 +79,8 @@ public class CamelMainProcessor {
@Record(value = ExecutionTime.STATIC_INIT, optional = true)
public CamelRoutesCollectorBuildItem routesCollector(
CamelMainRecorder recorder,
- CamelRoutesLoaderBuildItems.Registry registryRoutesLoader,
- CamelConfig config) {
-
- RuntimeValue<RoutesCollector> routesCollector = recorder.newRoutesCollector(registryRoutesLoader.getLoader(),
- config.routesDiscovery.excludePatterns, config.routesDiscovery.includePatterns);
+ CamelRoutesLoaderBuildItems.Registry registryRoutesLoader) {
+ RuntimeValue<RoutesCollector> routesCollector = recorder.newRoutesCollector(registryRoutesLoader.getLoader());
return new CamelRoutesCollectorBuildItem(routesCollector);
}
diff --git a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterCombinedPropertyTest.java b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterCombinedPropertyTest.java
deleted file mode 100644
index 9b5583d5b8..0000000000
--- a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterCombinedPropertyTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.camel.quarkus.core.deployment.main;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.List;
-import java.util.Properties;
-
-import javax.inject.Inject;
-
-import io.quarkus.test.QuarkusUnitTest;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Route;
-import org.apache.camel.builder.RouteBuilder;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.Asset;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-public class CamelMainRoutesExcludeFilterCombinedPropertyTest {
- @RegisterExtension
- static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
- .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
- .addAsResource(applicationProperties(), "application.properties"));
-
- @Inject
- CamelContext context;
-
- public static Asset applicationProperties() {
- Writer writer = new StringWriter();
-
- Properties props = new Properties();
- props.setProperty("quarkus.banner.enabled", "false");
- props.setProperty("quarkus.camel.routes-discovery.enabled", "true");
- props.setProperty("quarkus.camel.routes-discovery.exclude-patterns", "**/*FilteredA");
- props.setProperty("camel.main.javaRoutesExcludePattern", "**/*FilteredB");
-
- try {
- props.store(writer, "");
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- return new StringAsset(writer.toString());
- }
-
- @Test
- public void testRoutesFilter() {
- List<Route> routes = context.getRoutes();
- assertEquals(1, routes.size());
- assertNotNull(context.getRoute("my-route"));
- }
-
- public static class MyRoute extends RouteBuilder {
- @Override
- public void configure() throws Exception {
- from("direct:in").routeId("my-route").to("log:out");
- }
- }
-
- public static class MyRouteFilteredA extends RouteBuilder {
- @Override
- public void configure() throws Exception {
- from("direct:filtered-a").routeId("my-route-filtered-a").to("log:filtered-a");
- }
- }
-
- public static class MyRouteFilteredB extends RouteBuilder {
- @Override
- public void configure() throws Exception {
- from("direct:filtered-b").routeId("my-route-filtered-b").to("log:filtered-b");
- }
- }
-}
diff --git a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterTest.java b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterTest.java
index 6b932dc5e7..a614284102 100644
--- a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterTest.java
+++ b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesExcludeFilterTest.java
@@ -55,7 +55,8 @@ public class CamelMainRoutesExcludeFilterTest {
Properties props = new Properties();
props.setProperty("quarkus.banner.enabled", "false");
props.setProperty("quarkus.camel.routes-discovery.enabled", "true");
- props.setProperty("quarkus.camel.routes-discovery.exclude-patterns", "**/*Filtered,**/*Bean,**/*Producer");
+ props.setProperty("quarkus.camel.routes-discovery.exclude-patterns", "**/*Filtered");
+ props.setProperty("camel.main.javaRoutesExcludePattern", "**/*Bean,**/*Producer");
try {
props.store(writer, "");
diff --git a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesIncludeFilterCombinedPropertyTest.java b/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesIncludeFilterCombinedPropertyTest.java
deleted file mode 100644
index 264b0f4c70..0000000000
--- a/extensions-core/core/deployment/src/test/java/org/apache/camel/quarkus/core/deployment/main/CamelMainRoutesIncludeFilterCombinedPropertyTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.camel.quarkus.core.deployment.main;
-
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.List;
-import java.util.Properties;
-
-import javax.inject.Inject;
-
-import io.quarkus.test.QuarkusUnitTest;
-import org.apache.camel.CamelContext;
-import org.apache.camel.Route;
-import org.apache.camel.builder.RouteBuilder;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.Asset;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-public class CamelMainRoutesIncludeFilterCombinedPropertyTest {
- @RegisterExtension
- static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
- .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
- .addAsResource(applicationProperties(), "application.properties"));
-
- @Inject
- CamelContext context;
-
- public static Asset applicationProperties() {
- Writer writer = new StringWriter();
-
- Properties props = new Properties();
- props.setProperty("quarkus.banner.enabled", "false");
- props.setProperty("quarkus.camel.routes-discovery.enabled", "true");
- props.setProperty("quarkus.camel.routes-discovery.include-patterns", "**/*FilteredA");
- props.setProperty("camel.main.javaRoutesIncludePattern", "**/*FilteredB");
-
- try {
- props.store(writer, "");
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- return new StringAsset(writer.toString());
- }
-
- @Test
- public void testRoutesFilter() {
- List<Route> routes = context.getRoutes();
- assertEquals(2, routes.size());
- assertNotNull(context.getRoute("my-route-filtered-a"));
- assertNotNull(context.getRoute("my-route-filtered-b"));
- }
-
- public static class MyRoute extends RouteBuilder {
- @Override
- public void configure() throws Exception {
- from("direct:in").routeId("my-route").to("log:out");
- }
- }
-
- public static class MyRouteFilteredA extends RouteBuilder {
- @Override
- public void configure() throws Exception {
- from("direct:filtered-a").routeId("my-route-filtered-a").to("log:filtered-a");
- }
- }
-
- public static class MyRouteFilteredB extends RouteBuilder {
- @Override
- public void configure() throws Exception {
- from("direct:filtered-b").routeId("my-route-filtered-b").to("log:filtered-b");
- }
- }
-}
diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
index 0e3b223a68..55e765102d 100644
--- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
+++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
@@ -17,7 +17,6 @@
package org.apache.camel.quarkus.main;
import java.util.List;
-import java.util.Optional;
import java.util.Set;
import io.quarkus.arc.runtime.BeanContainer;
@@ -70,12 +69,8 @@ public class CamelMainRecorder {
main.getValue().addMainListener(listener.getValue());
}
- public RuntimeValue<RoutesCollector> newRoutesCollector(
- RuntimeValue<RegistryRoutesLoader> registryRoutesLoader,
- Optional<List<String>> excludePatterns,
- Optional<List<String>> includePatterns) {
- return new RuntimeValue<>(
- new CamelMainRoutesCollector(registryRoutesLoader.getValue(), excludePatterns, includePatterns));
+ public RuntimeValue<RoutesCollector> newRoutesCollector(RuntimeValue<RegistryRoutesLoader> registryRoutesLoader) {
+ return new RuntimeValue<>(new CamelMainRoutesCollector(registryRoutesLoader.getValue()));
}
public void customizeContext(RuntimeValue<CamelMain> main, List<RuntimeValue<CamelContextCustomizer>> contextCustomizers) {
diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRoutesCollector.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRoutesCollector.java
index 44d86a0f8a..8595f531d0 100644
--- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRoutesCollector.java
+++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRoutesCollector.java
@@ -17,7 +17,6 @@
package org.apache.camel.quarkus.main;
import java.util.List;
-import java.util.Optional;
import org.apache.camel.CamelContext;
import org.apache.camel.RoutesBuilder;
@@ -26,16 +25,9 @@ import org.apache.camel.quarkus.core.RegistryRoutesLoader;
public class CamelMainRoutesCollector extends DefaultRoutesCollector {
private final RegistryRoutesLoader registryRoutesLoader;
- private final Optional<List<String>> excludePatterns;
- private final Optional<List<String>> includePatterns;
- public CamelMainRoutesCollector(
- RegistryRoutesLoader registryRoutesLoader,
- Optional<List<String>> excludePatterns,
- Optional<List<String>> includePatterns) {
+ public CamelMainRoutesCollector(RegistryRoutesLoader registryRoutesLoader) {
this.registryRoutesLoader = registryRoutesLoader;
- this.excludePatterns = excludePatterns;
- this.includePatterns = includePatterns;
}
public RegistryRoutesLoader getRegistryRoutesLoader() {
@@ -48,21 +40,6 @@ public class CamelMainRoutesCollector extends DefaultRoutesCollector {
String excludePattern,
String includePattern) {
- /**
- * The incoming excludePattern & includePattern are ignored since they are provided from camel-main via:
- *
- * camel.main.javaRoutesExcludePattern
- * camel.main.javaRoutesIncludePattern
- *
- * The values for those properties are combined with the quarkus.camel.routes-discovery equivalents at build time.
- */
- return registryRoutesLoader.collectRoutesFromRegistry(
- camelContext,
- getPatternString(excludePatterns),
- getPatternString(includePatterns));
- }
-
- private String getPatternString(Optional<List<String>> camelQuarkusPatterns) {
- return camelQuarkusPatterns.map(patterns -> String.join(",", patterns)).orElse(null);
+ return registryRoutesLoader.collectRoutesFromRegistry(camelContext, excludePattern, includePattern);
}
}
[camel-quarkus] 04/08: xml-io: document the possibility to add all charsets in native mode #4572
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit cc2aaeabc8f0f487beec1fd5c4f1b44817917551
Author: aldettinger <al...@gmail.com>
AuthorDate: Tue Feb 14 18:19:52 2023 +0100
xml-io: document the possibility to add all charsets in native mode #4572
---
.../pages/reference/extensions/xml-io-dsl.adoc | 10 +++++++
.../runtime/src/main/doc/configuration.adoc | 4 +++
.../src/main/resources/application.properties | 3 +-
.../resources/routes/my-routes-iso_8859_15.xml | 34 ++++++++++++++++++++++
.../camel/quarkus/main/CoreMainXmlIoTest.java | 11 +++++++
5 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc b/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc
index 484d27f7cb..0ae46ec85f 100644
--- a/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/xml-io-dsl.adoc
@@ -43,3 +43,13 @@ Or add the coordinates to your existing project:
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]
+
+[id="extensions-xml-io-dsl-additional-camel-quarkus-configuration"]
+== Additional Camel Quarkus configuration
+
+[id="extensions-xml-io-dsl-configuration-xml-file-encodings"]
+=== XML file encodings
+
+By default, some XML file encodings may not work out of the box in native mode.
+Please, check the xref:user-guide/native-mode.adoc#charsets[Character encodings section] to learn how to fix.
+
diff --git a/extensions-core/xml-io-dsl/runtime/src/main/doc/configuration.adoc b/extensions-core/xml-io-dsl/runtime/src/main/doc/configuration.adoc
new file mode 100644
index 0000000000..4778ce69c8
--- /dev/null
+++ b/extensions-core/xml-io-dsl/runtime/src/main/doc/configuration.adoc
@@ -0,0 +1,4 @@
+=== XML file encodings
+
+By default, some XML file encodings may not work out of the box in native mode.
+Please, check the xref:user-guide/native-mode.adoc#charsets[Character encodings section] to learn how to fix.
\ No newline at end of file
diff --git a/integration-tests/main-xml-io/src/main/resources/application.properties b/integration-tests/main-xml-io/src/main/resources/application.properties
index d02938b70c..dc6c310269 100644
--- a/integration-tests/main-xml-io/src/main/resources/application.properties
+++ b/integration-tests/main-xml-io/src/main/resources/application.properties
@@ -18,6 +18,7 @@
#
# Quarkus
#
+quarkus.native.add-all-charsets = true
#
# Camel
@@ -28,4 +29,4 @@ camel.rest.component = platform-http
#
# Main
#
-camel.main.routes-include-pattern = routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml
+camel.main.routes-include-pattern = routes/my-routes.xml,routes/my-routes-iso_8859_15.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml
diff --git a/integration-tests/main-xml-io/src/main/resources/routes/my-routes-iso_8859_15.xml b/integration-tests/main-xml-io/src/main/resources/routes/my-routes-iso_8859_15.xml
new file mode 100644
index 0000000000..cf4e0adc9a
--- /dev/null
+++ b/integration-tests/main-xml-io/src/main/resources/routes/my-routes-iso_8859_15.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<!--
+
+ 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.
+
+-->
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://camel.apache.org/schema/spring"
+ xmlns:foo="http://camel.apache.org/foo"
+ xsi:schemaLocation="
+ http://camel.apache.org/schema/spring
+ http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+ <route id="iso_8859_15-encoded-route">
+ <from uri="direct:iso_8859_15-encoded"/>
+ <setBody>
+ <constant>Hello World from ISO-8859-15 encoded route containing � symbol !</constant>
+ </setBody>
+ </route>
+
+</routes>
diff --git a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
index d5817b722c..b858a248fe 100644
--- a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
+++ b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
@@ -98,4 +98,15 @@ public class CoreMainXmlIoTest {
}
+ @Test
+ public void routeEncodedInIso8859_15_ShouldSucceed() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT)
+ .body("in")
+ .post("/xml-io/route/iso_8859_15-encoded")
+ .then()
+ .statusCode(200)
+ .body(Matchers.is("Hello World from ISO-8859-15 encoded route containing € symbol !"));
+ }
+
}
[camel-quarkus] 02/08: xml-io: Remove the use of XMLRoutesDefinitionLoader deprecated class #4564
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 2fa67951c6663f38b229f041b2355cffc705956b
Author: aldettinger <al...@gmail.com>
AuthorDate: Mon Feb 13 17:21:32 2023 +0100
xml-io: Remove the use of XMLRoutesDefinitionLoader deprecated class #4564
---
.../core/DisabledXMLRoutesDefinitionLoader.java | 39 ----------------------
.../camel/quarkus/core/FastCamelContext.java | 6 ----
.../camel/quarkus/main/CoreMainXmlIoResource.java | 2 +-
.../camel/quarkus/main/CoreMainXmlIoTest.java | 3 --
.../quarkus/main/CoreMainXmlJaxbResource.java | 1 -
.../camel/quarkus/main/CoreMainXmlJaxbTest.java | 3 --
.../camel/quarkus/main/CoreMainResource.java | 2 --
.../apache/camel/quarkus/main/CoreMainTest.java | 3 --
8 files changed, 1 insertion(+), 58 deletions(-)
diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java
deleted file mode 100644
index 155549cc8b..0000000000
--- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.camel.quarkus.core;
-
-import java.io.InputStream;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.XMLRoutesDefinitionLoader;
-
-public class DisabledXMLRoutesDefinitionLoader implements XMLRoutesDefinitionLoader {
- @Override
- public Object loadRoutesDefinition(CamelContext context, InputStream inputStream) throws Exception {
- throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io-dsl");
- }
-
- @Override
- public Object loadRouteTemplatesDefinition(CamelContext context, InputStream inputStream) throws Exception {
- throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io-dsl");
- }
-
- @Override
- public Object loadRestsDefinition(CamelContext context, InputStream inputStream) throws Exception {
- throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io-dsl");
- }
-}
diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java
index 91302bf64d..53a0547167 100644
--- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java
+++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java
@@ -46,7 +46,6 @@ import org.apache.camel.spi.PropertiesComponent;
import org.apache.camel.spi.Registry;
import org.apache.camel.spi.ShutdownStrategy;
import org.apache.camel.spi.TypeConverterRegistry;
-import org.apache.camel.spi.XMLRoutesDefinitionLoader;
import org.apache.camel.util.IOHelper;
public class FastCamelContext extends DefaultCamelContext implements CatalogCamelContext, ModelCamelContext {
@@ -154,11 +153,6 @@ public class FastCamelContext extends DefaultCamelContext implements CatalogCame
return pc;
}
- @Override
- protected XMLRoutesDefinitionLoader createXMLRoutesDefinitionLoader() {
- return new DisabledXMLRoutesDefinitionLoader();
- }
-
@Override
protected ModelToXMLDumper createModelToXMLDumper() {
return modelDumper;
diff --git a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
index 5446e0648e..51cb960d23 100644
--- a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
+++ b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
@@ -73,7 +73,7 @@ public class CoreMainXmlIoResource {
main.getCamelContext().getRoutes().forEach(route -> routes.add(route.getId()));
return Json.createObjectBuilder()
- .add("xml-routes-definitions-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName())
+ .add("xml-routes-definitions-loader", camelContext.getRoutesLoader().getClass().getName())
.add("xml-routes-builder-loader",
camelContext.getBootstrapFactoryFinder(RoutesBuilderLoader.FACTORY_PATH)
.findClass(XmlRoutesBuilderLoader.EXTENSION).get().getName())
diff --git a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
index e3fa0cb339..d5817b722c 100644
--- a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
+++ b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
@@ -27,7 +27,6 @@ import io.restassured.path.json.JsonPath;
import org.apache.camel.dsl.xml.io.XmlRoutesBuilderLoader;
import org.apache.camel.quarkus.core.DisabledModelJAXBContextFactory;
import org.apache.camel.quarkus.core.DisabledModelToXMLDumper;
-import org.apache.camel.quarkus.core.DisabledXMLRoutesDefinitionLoader;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
@@ -50,8 +49,6 @@ public class CoreMainXmlIoTest {
assertThat(p.getString("xml-model-dumper")).isEqualTo(DisabledModelToXMLDumper.class.getName());
assertThat(p.getString("xml-model-factory")).isEqualTo(DisabledModelJAXBContextFactory.class.getName());
- assertThat(p.getString("xml-routes-definitions-loader"))
- .isEqualTo(DisabledXMLRoutesDefinitionLoader.class.getName());
assertThat(p.getString("xml-routes-builder-loader"))
.isEqualTo(XmlRoutesBuilderLoader.class.getName());
diff --git a/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java b/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java
index a710b46cfe..1aace8265a 100644
--- a/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java
+++ b/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbResource.java
@@ -59,7 +59,6 @@ public class CoreMainXmlJaxbResource {
main.getCamelContext().getRoutes().forEach(route -> routes.add(route.getId()));
return Json.createObjectBuilder()
- .add("xml-routes-definitions-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName())
.add("xml-routes-builder-loader",
camelContext.getBootstrapFactoryFinder(RoutesBuilderLoader.FACTORY_PATH)
.findClass(XmlRoutesBuilderLoader.EXTENSION).get().getName())
diff --git a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java
index 89170e52b0..ebf67c77f5 100644
--- a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java
+++ b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java
@@ -28,7 +28,6 @@ import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import io.restassured.path.json.JsonPath;
import org.apache.camel.dsl.xml.io.XmlRoutesBuilderLoader;
-import org.apache.camel.quarkus.core.DisabledXMLRoutesDefinitionLoader;
import org.apache.camel.xml.jaxb.DefaultModelJAXBContextFactory;
import org.apache.camel.xml.jaxb.JaxbModelToXMLDumper;
import org.junit.jupiter.api.Test;
@@ -53,8 +52,6 @@ public class CoreMainXmlJaxbTest {
assertThat(p.getString("xml-model-dumper")).isEqualTo(JaxbModelToXMLDumper.class.getName());
assertThat(p.getString("xml-model-factory")).isEqualTo(DefaultModelJAXBContextFactory.class.getName());
- assertThat(p.getString("xml-routes-definitions-loader"))
- .isEqualTo(DisabledXMLRoutesDefinitionLoader.class.getName());
assertThat(p.getString("xml-routes-builder-loader"))
.isEqualTo(XmlRoutesBuilderLoader.class.getName());
diff --git a/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java b/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java
index 3c7c97b9d3..d10e717c06 100644
--- a/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java
+++ b/integration-tests/main/src/main/java/org/apache/camel/quarkus/main/CoreMainResource.java
@@ -114,7 +114,6 @@ public class CoreMainResource {
if (main.getRoutesCollector() instanceof CamelMainRoutesCollector) {
CamelMainRoutesCollector crc = (CamelMainRoutesCollector) main.getRoutesCollector();
collector.add("type-registry", crc.getRegistryRoutesLoader().getClass().getName());
- collector.add("type-xml", camelContext.getXMLRoutesDefinitionLoader().getClass().getName());
}
JsonObjectBuilder dataformatsInRegistry = Json.createObjectBuilder();
@@ -138,7 +137,6 @@ public class CoreMainResource {
}
return Json.createObjectBuilder()
- .add("xml-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName())
.add("xml-model-dumper", camelContext.getModelToXMLDumper().getClass().getName())
.add("routes-collector", collector)
.add("listeners", listeners)
diff --git a/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java b/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java
index c27441a553..2000319f6e 100644
--- a/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java
+++ b/integration-tests/main/src/test/java/org/apache/camel/quarkus/main/CoreMainTest.java
@@ -27,7 +27,6 @@ import io.restassured.http.ContentType;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
import org.apache.camel.quarkus.core.DisabledModelToXMLDumper;
-import org.apache.camel.quarkus.core.DisabledXMLRoutesDefinitionLoader;
import org.apache.camel.quarkus.core.RegistryRoutesLoaders;
import org.apache.camel.quarkus.it.support.mainlistener.CustomMainListener;
import org.apache.camel.reactive.vertx.VertXReactiveExecutor;
@@ -78,12 +77,10 @@ public class CoreMainTest {
.body()
.jsonPath();
- assertThat(p.getString("xml-loader")).isEqualTo(DisabledXMLRoutesDefinitionLoader.class.getName());
assertThat(p.getString("xml-model-dumper")).isEqualTo(DisabledModelToXMLDumper.class.getName());
assertThat(p.getString("routes-collector.type")).isEqualTo(CamelMainRoutesCollector.class.getName());
assertThat(p.getString("routes-collector.type-registry")).isEqualTo(RegistryRoutesLoaders.Default.class.getName());
- assertThat(p.getString("routes-collector.type-xml")).isEqualTo(DisabledXMLRoutesDefinitionLoader.class.getName());
assertThat(p.getList("listeners", String.class))
.containsAnyOf(CamelMainEventBridge.class.getName(), CustomMainListener.class.getName());
[camel-quarkus] 06/08: create itest project for xml-io + bean #4579
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 3b396e43733b2b750288710e2d6914e89409a171
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Feb 15 18:07:02 2023 +0100
create itest project for xml-io + bean #4579
---
.../pages/user-guide/defining-camel-routes.adoc | 7 +
integration-tests/main-xml-io-with-beans/pom.xml | 152 +++++++++++++++++++++
.../main/CoreMainXmlIoWithBeansResource.java | 53 +++++++
.../java/org/apache/camel/quarkus/main/MyBean.java | 30 ++++
.../src/main/resources/application.properties | 29 ++++
.../resources/routes/my-route-with-beanType.xml | 32 +++++
.../quarkus/main/CoreMainXmlIoWithBeansIT.java | 23 ++++
.../quarkus/main/CoreMainXmlIoWithBeansTest.java | 39 ++++++
integration-tests/pom.xml | 1 +
tooling/scripts/test-categories.yaml | 1 +
10 files changed, 367 insertions(+)
diff --git a/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc b/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc
index 4d82d6e409..3fdad3ad95 100644
--- a/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc
+++ b/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc
@@ -84,6 +84,13 @@ Path globbing like `camel.main.routes-include-pattern = *./routes.xml` currently
</routes>
----
+[WARNING]
+====
+When using XML routes with beans, it is sometime needed to refer to class name, for instance `beanType=org.apache.SomeClass`.
+In such cases, it might be needed to register the class for reflection in native mode.
+Refer to the xref:user-guide/native-mode.adoc#reflection[Native mode] user guide for more information.
+====
+
[WARNING]
====
Spring XML with `<beans>` or Blueprint XML with `<blueprint>` elements are not supported.
diff --git a/integration-tests/main-xml-io-with-beans/pom.xml b/integration-tests/main-xml-io-with-beans/pom.xml
new file mode 100644
index 0000000000..dd53a61176
--- /dev/null
+++ b/integration-tests/main-xml-io-with-beans/pom.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>2.13.3-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-test-main-xml-io-with-beans</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: Main XML Io With Beans :: Tests</name>
+ <description>The camel integration tests</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-xml-io-dsl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-resteasy</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <activation>
+ <property>
+ <name>native</name>
+ </property>
+ </activation>
+ <properties>
+ <quarkus.package.type>native</quarkus.package.type>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-xml-io-dsl-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-bean-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-direct-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+
+</project>
diff --git a/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansResource.java b/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansResource.java
new file mode 100644
index 0000000000..b4700a259c
--- /dev/null
+++ b/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansResource.java
@@ -0,0 +1,53 @@
+/*
+ * 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.camel.quarkus.main;
+
+import java.util.AbstractMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.stream.Collectors;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.camel.ProducerTemplate;
+
+@Path("/xml-io-with-beans")
+@ApplicationScoped
+public class CoreMainXmlIoWithBeansResource {
+ @Inject
+ ProducerTemplate producerTemplate;
+
+ @Path("/route/{route}")
+ @POST
+ @Consumes(MediaType.TEXT_PLAIN)
+ @Produces(MediaType.TEXT_PLAIN)
+ public String route(String body, @PathParam("route") String route, @Context UriInfo uriInfo) {
+ final Map<String, Object> headers = uriInfo.getQueryParameters().entrySet().stream()
+ .map(e -> new AbstractMap.SimpleImmutableEntry<String, Object>(e.getKey(), e.getValue().get(0)))
+ .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
+ return producerTemplate.requestBodyAndHeaders("direct:" + route, body, headers, String.class);
+ }
+}
diff --git a/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/MyBean.java b/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/MyBean.java
new file mode 100644
index 0000000000..4a92a6d086
--- /dev/null
+++ b/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/MyBean.java
@@ -0,0 +1,30 @@
+/*
+ * 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.camel.quarkus.main;
+
+import io.quarkus.runtime.annotations.RegisterForReflection;
+import org.apache.camel.Handler;
+
+@RegisterForReflection
+public class MyBean {
+
+ @Handler
+ public String handler(String in) {
+ return in + "-handled-by-MyBean";
+ }
+
+}
diff --git a/integration-tests/main-xml-io-with-beans/src/main/resources/application.properties b/integration-tests/main-xml-io-with-beans/src/main/resources/application.properties
new file mode 100644
index 0000000000..ba1ed3554e
--- /dev/null
+++ b/integration-tests/main-xml-io-with-beans/src/main/resources/application.properties
@@ -0,0 +1,29 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+#
+# Quarkus
+#
+
+#
+# Camel
+#
+
+#
+# Main
+#
+camel.main.routes-include-pattern = routes/my-route-with-beanType.xml
diff --git a/integration-tests/main-xml-io-with-beans/src/main/resources/routes/my-route-with-beanType.xml b/integration-tests/main-xml-io-with-beans/src/main/resources/routes/my-route-with-beanType.xml
new file mode 100644
index 0000000000..3582a5b3fa
--- /dev/null
+++ b/integration-tests/main-xml-io-with-beans/src/main/resources/routes/my-route-with-beanType.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://camel.apache.org/schema/spring"
+ xmlns:foo="http://camel.apache.org/foo"
+ xsi:schemaLocation="
+ http://camel.apache.org/schema/spring
+ http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+ <route id="my-route-with-beanType">
+ <from uri="direct:withBeanType"/>
+ <bean beanType="org.apache.camel.quarkus.main.MyBean"/>
+ </route>
+
+</routes>
\ No newline at end of file
diff --git a/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansIT.java b/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansIT.java
new file mode 100644
index 0000000000..cb6c749be6
--- /dev/null
+++ b/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansIT.java
@@ -0,0 +1,23 @@
+/*
+ * 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.camel.quarkus.main;
+
+import io.quarkus.test.junit.QuarkusIntegrationTest;
+
+@QuarkusIntegrationTest
+public class CoreMainXmlIoWithBeansIT extends CoreMainXmlIoWithBeansTest {
+}
diff --git a/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansTest.java b/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansTest.java
new file mode 100644
index 0000000000..3f195efb88
--- /dev/null
+++ b/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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.camel.quarkus.main;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.http.ContentType;
+import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Test;
+
+@QuarkusTest
+public class CoreMainXmlIoWithBeansTest {
+
+ @Test
+ public void beanTypeShouldSucceed() {
+ RestAssured.given()
+ .contentType(ContentType.TEXT)
+ .body("beanTypeShouldSucceed")
+ .post("/xml-io-with-beans/route/withBeanType")
+ .then()
+ .statusCode(200)
+ .body(Matchers.is("beanTypeShouldSucceed-handled-by-MyBean"));
+ }
+
+}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 604a12239f..e43bfda67b 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -45,6 +45,7 @@
<module>main-discovery-disabled</module>
<module>main-xml-jaxb</module>
<module>main-xml-io</module>
+ <module>main-xml-io-with-beans</module>
<module>main-collector</module>
<module>main-caffeine-lrucache</module>
<module>main-command-mode</module>
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index 26e16bee0f..ed85568c6c 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -59,6 +59,7 @@ group-03:
- main-devmode
- main-discovery-disabled
- main-xml-io
+ - main-xml-io-with-beans
- main-xml-jaxb
- main-yaml
- shiro
[camel-quarkus] 07/08: Multiple test methods do not work when extending CamelQuarkusTestSupport #4560
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 58b998bc6d37a9b39c2270566ea1d1a9309865d0
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Tue Feb 14 09:13:33 2023 +0100
Multiple test methods do not work when extending CamelQuarkusTestSupport #4560
---
.../DoubleRoutesTest.java} | 16 ++++----
.../extensions/doubeRouteBuilder/FirstET.java} | 43 +++++++++++----------
.../RouteBuilder.java} | 28 +++-----------
.../extensions/doubeRouteBuilder/SecondET.java} | 43 +++++++++++----------
.../ProducedRouteBuilderTest.java | 4 +-
.../routeBuilder/RouteBuilderFailureTest.java | 18 ++++++++-
.../extensions/routeBuilder/RouteBuilderUtil.java | 45 ----------------------
.../routeBuilder/RouteBuilderWarningET.java | 17 +-------
...RouteBuilderWarningWithProducedBuilderTest.java | 19 +++++++--
...teBuilderWarningWithoutProducedBuilderTest.java | 18 +++++++--
.../{RouteBuilderHello.java => RouteProducer.java} | 17 ++++----
.../apache/camel/quarkus/test/CallbackUtil.java | 12 +++---
.../quarkus/test/CamelQuarkusTestSupport.java | 22 +++++++++++
.../test/common/CallbacksPerTestFalse01Test.java | 2 -
.../test/common/CallbacksPerTestFalse02Test.java | 5 +--
.../test/common/CallbacksPerTestTrue01Test.java | 2 -
.../test/common/CallbacksPerTestTrue02Test.java | 2 -
.../test/junit5/patterns/AdviceWithLambdaTest.java | 2 +
.../AdviceInDoBeforeEachMethodsTest.java | 2 -
19 files changed, 153 insertions(+), 164 deletions(-)
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/producedRouteBuilder/ProducedRouteBuilderTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/DoubleRoutesTest.java
similarity index 82%
copy from test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/producedRouteBuilder/ProducedRouteBuilderTest.java
copy to test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/DoubleRoutesTest.java
index 17fa9029a2..9fc59a5622 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/producedRouteBuilder/ProducedRouteBuilderTest.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/DoubleRoutesTest.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.test.extensions.producedRouteBuilder;
+package org.apache.camel.quarkus.test.extensions.doubeRouteBuilder;
import java.util.function.Supplier;
@@ -28,25 +28,25 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
/**
- * Test for https://github.com/apache/camel-quarkus/issues/4362
+ * Test for https://github.com/apache/camel-quarkus/issues/4560
*/
-public class ProducedRouteBuilderTest {
+public class DoubleRoutesTest {
@RegisterExtension
static final QuarkusDevModeTest TEST = new QuarkusDevModeTest()
.setArchiveProducer(new Supplier<>() {
@Override
public JavaArchive get() {
- return ShrinkWrap.create(JavaArchive.class)
+ return ShrinkWrap.create(JavaArchive.class).addClass(RouteBuilder.class)
.add(new StringAsset(
- ContinuousTestingTestUtils.appProperties("camel-quarkus.junit5.message=Sheldon")),
+ ContinuousTestingTestUtils.appProperties("#")),
"application.properties");
}
})
.setTestArchiveProducer(new Supplier<>() {
@Override
public JavaArchive get() {
- return ShrinkWrap.create(JavaArchive.class).addClasses(ProducedRouteBuilderET.class);
+ return ShrinkWrap.create(JavaArchive.class).addClasses(FirstET.class, SecondET.class);
}
});
@@ -55,7 +55,7 @@ public class ProducedRouteBuilderTest {
ContinuousTestingTestUtils utils = new ContinuousTestingTestUtils();
ContinuousTestingTestUtils.TestStatus ts = utils.waitForNextCompletion();
- Assertions.assertEquals(1L, ts.getTestsFailed());
- Assertions.assertEquals(1L, ts.getTestsPassed());
+ Assertions.assertEquals(0L, ts.getTestsFailed());
+ Assertions.assertEquals(4L, ts.getTestsPassed());
}
}
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/FirstET.java
similarity index 55%
copy from test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java
copy to test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/FirstET.java
index ef19a48b33..47c2b056e3 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/FirstET.java
@@ -14,42 +14,45 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.test.junit5.patterns;
+package org.apache.camel.quarkus.test.extensions.doubeRouteBuilder;
import io.quarkus.test.junit.QuarkusTest;
import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.AdviceWith;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
import org.junit.jupiter.api.Test;
@QuarkusTest
-public class AdviceWithLambdaTest extends CamelQuarkusTestSupport {
+public class FirstET extends CamelQuarkusTestSupport {
@Override
- public boolean isUseAdviceWith() {
- return true;
+ protected RoutesBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:startTest").to("direct:start").to("mock:result");
+ }
+ };
}
@Test
- public void testAdviceWith() throws Exception {
- getMockEndpoint("mock:result").expectedMessageCount(1);
+ public void someTestA() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
- // advice the route in one line
- AdviceWith.adviceWith(context, "foo", a -> a.weaveAddLast().to("mock:result"));
+ template.sendBody("direct:startTest", null);
- template.sendBody("direct:start", "Bye World");
-
- assertMockEndpointsSatisfied();
+ mockEndpoint.assertIsSatisfied();
}
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").routeId("foo").to("log:foo");
- }
- };
+ @Test
+ public void someTestB() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
+
+ template.sendBody("direct:startTest", null);
+
+ mockEndpoint.assertIsSatisfied();
}
}
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningResource.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/RouteBuilder.java
similarity index 57%
rename from test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningResource.java
rename to test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/RouteBuilder.java
index 758fdaa5b3..7ce968d360 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningResource.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/RouteBuilder.java
@@ -14,29 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.test.extensions.routeBuilder;
+package org.apache.camel.quarkus.test.extensions.doubeRouteBuilder;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
+public class RouteBuilder extends org.apache.camel.builder.RouteBuilder {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").setBody(constant("Some Value")).log("The body is: ${body}");
-import org.apache.camel.ProducerTemplate;
-
-@Path("/routeBuilder")
-@ApplicationScoped
-public class RouteBuilderWarningResource {
-
- @Inject
- ProducerTemplate producerTemplate;
-
- @Path("/in")
- @POST
- @Produces(MediaType.TEXT_PLAIN)
- public void in(String body) {
- producerTemplate.sendBody("direct:in", body);
+ from("timer:timeToAct?period=5000").routeId("TimerRoute").log("Calling direct:start").to("direct:start");
}
-
}
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/SecondET.java
similarity index 55%
copy from test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java
copy to test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/SecondET.java
index ef19a48b33..f76a446ccb 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/doubeRouteBuilder/SecondET.java
@@ -14,42 +14,45 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.test.junit5.patterns;
+package org.apache.camel.quarkus.test.extensions.doubeRouteBuilder;
import io.quarkus.test.junit.QuarkusTest;
import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.AdviceWith;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
import org.junit.jupiter.api.Test;
@QuarkusTest
-public class AdviceWithLambdaTest extends CamelQuarkusTestSupport {
+public class SecondET extends CamelQuarkusTestSupport {
@Override
- public boolean isUseAdviceWith() {
- return true;
+ protected RoutesBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:startTest").to("direct:start").to("mock:result");
+ }
+ };
}
@Test
- public void testAdviceWith() throws Exception {
- getMockEndpoint("mock:result").expectedMessageCount(1);
+ public void someTestA() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
- // advice the route in one line
- AdviceWith.adviceWith(context, "foo", a -> a.weaveAddLast().to("mock:result"));
+ template.sendBody("direct:startTest", null);
- template.sendBody("direct:start", "Bye World");
-
- assertMockEndpointsSatisfied();
+ mockEndpoint.assertIsSatisfied();
}
- @Override
- protected RoutesBuilder createRouteBuilder() {
- return new RouteBuilder() {
- @Override
- public void configure() {
- from("direct:start").routeId("foo").to("log:foo");
- }
- };
+ @Test
+ public void someTestB() throws InterruptedException {
+ MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
+ mockEndpoint.expectedBodiesReceived("Some Value");
+
+ template.sendBody("direct:startTest", null);
+
+ mockEndpoint.assertIsSatisfied();
}
}
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/producedRouteBuilder/ProducedRouteBuilderTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/producedRouteBuilder/ProducedRouteBuilderTest.java
index 17fa9029a2..dfe0a81e59 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/producedRouteBuilder/ProducedRouteBuilderTest.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/producedRouteBuilder/ProducedRouteBuilderTest.java
@@ -55,7 +55,7 @@ public class ProducedRouteBuilderTest {
ContinuousTestingTestUtils utils = new ContinuousTestingTestUtils();
ContinuousTestingTestUtils.TestStatus ts = utils.waitForNextCompletion();
- Assertions.assertEquals(1L, ts.getTestsFailed());
- Assertions.assertEquals(1L, ts.getTestsPassed());
+ Assertions.assertEquals(0L, ts.getTestsFailed());
+ Assertions.assertEquals(2L, ts.getTestsPassed());
}
}
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderFailureTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderFailureTest.java
index 8ff06ffbe6..ef8b01e586 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderFailureTest.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderFailureTest.java
@@ -16,9 +16,14 @@
*/
package org.apache.camel.quarkus.test.extensions.routeBuilder;
+import java.util.logging.Level;
+
import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.QuarkusDevModeTest;
import org.apache.camel.quarkus.test.extensions.continousDev.HelloResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -29,8 +34,17 @@ import org.junit.jupiter.api.extension.RegisterExtension;
public class RouteBuilderFailureTest {
@RegisterExtension
- static final QuarkusDevModeTest TEST = RouteBuilderUtil.createTestModule(RouteBuilderFailureET.class,
- RouteBuilderWarningResource.class, HelloResource.class);
+ static final QuarkusDevModeTest TEST = new QuarkusDevModeTest()
+ .setArchiveProducer(() -> {
+ JavaArchive ja = ShrinkWrap.create(JavaArchive.class)
+ .addClasses(RouteBuilderFailureET.class, HelloResource.class)
+ .add(new StringAsset(
+ ContinuousTestingTestUtils.appProperties("camel-quarkus.junit5.message=Sheldon")),
+ "application.properties");
+ return ja;
+ })
+ .setTestArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class).addClasses(RouteBuilderFailureET.class))
+ .setLogRecordPredicate(record -> record.getLevel().equals(Level.WARNING));
@Test
public void checkTests() {
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderUtil.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderUtil.java
deleted file mode 100644
index 0ba81a2f30..0000000000
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderUtil.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.camel.quarkus.test.extensions.routeBuilder;
-
-import java.util.logging.Level;
-
-import io.quarkus.test.ContinuousTestingTestUtils;
-import io.quarkus.test.QuarkusDevModeTest;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-import org.jboss.shrinkwrap.api.spec.JavaArchive;
-
-public class RouteBuilderUtil {
-
- static QuarkusDevModeTest createTestModule(Class testClass, Class<?>... archiveClasses) {
- QuarkusDevModeTest retVal = new QuarkusDevModeTest()
- .setArchiveProducer(() -> {
- JavaArchive ja = ShrinkWrap.create(JavaArchive.class)
- .addClasses(archiveClasses)
- .add(new StringAsset(
- ContinuousTestingTestUtils.appProperties("camel-quarkus.junit5.message=Sheldon")),
- "application.properties");
- return ja;
- })
- .setTestArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class).addClasses(testClass))
- .setLogRecordPredicate(record -> record.getLevel().equals(Level.WARNING));
-
- return retVal;
- }
-
-}
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningET.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningET.java
index 3a6c04baeb..f3ba2cb8ee 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningET.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningET.java
@@ -17,13 +17,11 @@
package org.apache.camel.quarkus.test.extensions.routeBuilder;
import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
+import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-import static org.hamcrest.CoreMatchers.is;
-
@QuarkusTest
public class RouteBuilderWarningET extends CamelQuarkusTestSupport {
@@ -34,18 +32,7 @@ public class RouteBuilderWarningET extends CamelQuarkusTestSupport {
@Test
public void helloTest() throws Exception {
- RestAssured.given()
- .body("Hello (from routeBuilder) ")
- .post("/routeBuilder/in")
- .then()
- .statusCode(204);
-
- RestAssured.given()
- .body("file:target/data/RouteBuilderET?fileName=hello_true.txt")
- .post("/hello/message")
- .then()
- .statusCode(200)
- .body(is("Hello (from routeBuilder) Sheldon"));
+ Assertions.assertTrue(true);
}
@Override
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithProducedBuilderTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithProducedBuilderTest.java
index b35276adcc..c06ce134b7 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithProducedBuilderTest.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithProducedBuilderTest.java
@@ -16,9 +16,13 @@
*/
package org.apache.camel.quarkus.test.extensions.routeBuilder;
+import java.util.logging.Level;
+
import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.QuarkusDevModeTest;
-import org.apache.camel.quarkus.test.extensions.continousDev.HelloResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -30,8 +34,17 @@ import org.junit.jupiter.api.extension.RegisterExtension;
public class RouteBuilderWarningWithProducedBuilderTest {
@RegisterExtension
- static final QuarkusDevModeTest TEST = RouteBuilderUtil.createTestModule(RouteBuilderWarningET.class,
- RouteBuilderWarningResource.class, HelloResource.class, RouteBuilderHello.class);
+ static final QuarkusDevModeTest TEST = new QuarkusDevModeTest()
+ .setArchiveProducer(() -> {
+ JavaArchive ja = ShrinkWrap.create(JavaArchive.class)
+ .addClasses(RouteProducer.class)
+ .add(new StringAsset(
+ ContinuousTestingTestUtils.appProperties("#")),
+ "application.properties");
+ return ja;
+ })
+ .setTestArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class).addClasses(RouteBuilderWarningET.class))
+ .setLogRecordPredicate(record -> record.getLevel().equals(Level.WARNING));
@Test
public void checkTests() {
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithoutProducedBuilderTest.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithoutProducedBuilderTest.java
index ba578bbe19..9436d05368 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithoutProducedBuilderTest.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderWarningWithoutProducedBuilderTest.java
@@ -16,9 +16,13 @@
*/
package org.apache.camel.quarkus.test.extensions.routeBuilder;
+import java.util.logging.Level;
+
import io.quarkus.test.ContinuousTestingTestUtils;
import io.quarkus.test.QuarkusDevModeTest;
-import org.apache.camel.quarkus.test.extensions.continousDev.HelloResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -30,8 +34,16 @@ import org.junit.jupiter.api.extension.RegisterExtension;
public class RouteBuilderWarningWithoutProducedBuilderTest {
@RegisterExtension
- static final QuarkusDevModeTest TEST = RouteBuilderUtil.createTestModule(RouteBuilderWarningET.class,
- RouteBuilderWarningResource.class, HelloResource.class);
+ static final QuarkusDevModeTest TEST = new QuarkusDevModeTest()
+ .setArchiveProducer(() -> {
+ JavaArchive ja = ShrinkWrap.create(JavaArchive.class)
+ .add(new StringAsset(
+ ContinuousTestingTestUtils.appProperties("#")),
+ "application.properties");
+ return ja;
+ })
+ .setTestArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class).addClasses(RouteBuilderWarningET.class))
+ .setLogRecordPredicate(record -> record.getLevel().equals(Level.WARNING));
@Test
public void checkTests() {
diff --git a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderHello.java b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteProducer.java
similarity index 76%
rename from test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderHello.java
rename to test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteProducer.java
index b20908bb52..618500fafe 100644
--- a/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteBuilderHello.java
+++ b/test-framework/junit5-extension-tests/src/test/java/org/apache/camel/quarkus/test/extensions/routeBuilder/RouteProducer.java
@@ -16,16 +16,17 @@
*/
package org.apache.camel.quarkus.test.extensions.routeBuilder;
-import javax.enterprise.context.ApplicationScoped;
-
import org.apache.camel.builder.RouteBuilder;
-@ApplicationScoped
-public class RouteBuilderHello extends RouteBuilder {
+public class RouteProducer {
- @Override
- public void configure() {
- from("direct:in").routeId("directRoute").to("file:target/data/RouteBuilderET?filename=hello_false.txt");
+ @javax.enterprise.inject.Produces
+ public RouteBuilder routes() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:in1").to("direct:in2");
+ }
+ };
}
-
}
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java
index b4f8d3fa56..f01d15d7ed 100644
--- a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CallbackUtil.java
@@ -48,13 +48,15 @@ public class CallbackUtil {
static void resetContext(CamelQuarkusTestSupport testInstance) {
- //if routeBuilder (from the test) was used, all routes has to be stopped and removed
+ //if routeBuilder (from the test) was used, all routes from that builder has to be stopped and removed
//because routes will be created again (in case of TestInstance.Lifecycle.PER_CLASS, this method is not executed)
- if (testInstance.isUseRouteBuilder()) {
- try {
- testInstance.context().getRouteController().stopAllRoutes();
- testInstance.context().getRouteController().removeAllRoutes();
+ if (testInstance.isUseRouteBuilder() && testInstance.createdRoutes != null) {
+ try {
+ for (String r : testInstance.createdRoutes) {
+ testInstance.context().getRouteController().stopRoute(r);
+ testInstance.context().removeRoute(r);
+ }
} catch (Exception e) {
throw new RuntimeException(e);
}
diff --git a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java
index 3baaaebe2c..50f6bd9c6e 100644
--- a/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java
+++ b/test-framework/junit5/src/main/java/org/apache/camel/quarkus/test/CamelQuarkusTestSupport.java
@@ -18,6 +18,8 @@ package org.apache.camel.quarkus.test;
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
import javax.inject.Inject;
@@ -80,6 +82,11 @@ public class CamelQuarkusTestSupport extends CamelTestSupport
@Inject
protected CamelContext context;
+ /*
+ * Set of routes, which were created by routeBuilder. This set is used by some callbacks.
+ */
+ Set<String> createdRoutes;
+
//------------------------ quarkus callbacks ---------------
/**
@@ -304,6 +311,12 @@ public class CamelQuarkusTestSupport extends CamelTestSupport
if (isUseAdviceWith() || isUseDebugger()) {
((FastCamelContext) context).suspend();
}
+
+ if (isUseRouteBuilder()) {
+ //save the routeIds of routes existing before setup
+ createdRoutes = context.getRoutes().stream().map(r -> r.getRouteId()).collect(Collectors.toSet());
+ }
+
super.doPreSetup();
}
@@ -326,6 +339,15 @@ public class CamelQuarkusTestSupport extends CamelTestSupport
mcc.addRouteDefinitions(rdfs);
}
}
+
+ if (isUseRouteBuilder()) {
+ //remove from the routes all routes which existed before setup
+ var allRoutes = context.getRoutes().stream().map(r -> r.getRouteId()).collect(Collectors.toSet());
+ if (createdRoutes != null) {
+ allRoutes.removeAll(createdRoutes);
+ }
+ createdRoutes = allRoutes;
+ }
super.doPostSetup();
}
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse01Test.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse01Test.java
index 54e0ff051b..e10d0ce525 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse01Test.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse01Test.java
@@ -19,14 +19,12 @@ package org.apache.camel.quarkus.test.common;
import java.util.function.BiConsumer;
import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.TestProfile;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.TestInstance;
// replaces CreateCamelContextPerTestTrueTest
@QuarkusTest
@TestInstance(TestInstance.Lifecycle.PER_METHOD)
-@TestProfile(CallbacksPerTestFalse01Test.class)
public class CallbacksPerTestFalse01Test extends AbstractCallbacksTest {
public CallbacksPerTestFalse01Test() {
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java
index f9fbb14544..9bb7834a79 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestFalse02Test.java
@@ -19,17 +19,16 @@ package org.apache.camel.quarkus.test.common;
import java.util.concurrent.TimeUnit;
import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.TestProfile;
import org.hamcrest.Matchers;
+import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
// replaces CreateCamelContextPerTestTrueTest
@QuarkusTest
-@TestProfile(CallbacksPerTestFalse01Test.class)
public class CallbacksPerTestFalse02Test {
- // @Test
+ @Test
public void testAfter01Class() {
await().atMost(5, TimeUnit.SECONDS).until(() -> AbstractCallbacksTest.testFromAnotherClass(
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue01Test.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue01Test.java
index 54bcbfdcc3..b765ef6b0d 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue01Test.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue01Test.java
@@ -19,14 +19,12 @@ package org.apache.camel.quarkus.test.common;
import java.util.function.BiConsumer;
import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.TestProfile;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.TestInstance;
// replaces CreateCamelContextPerTestTrueTest
@QuarkusTest
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
-@TestProfile(CallbacksPerTestTrue01Test.class)
public class CallbacksPerTestTrue01Test extends AbstractCallbacksTest {
public CallbacksPerTestTrue01Test() {
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
index 777c3b97e4..472d5d319f 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/common/CallbacksPerTestTrue02Test.java
@@ -19,7 +19,6 @@ package org.apache.camel.quarkus.test.common;
import java.util.concurrent.TimeUnit;
import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.TestProfile;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
@@ -27,7 +26,6 @@ import static org.awaitility.Awaitility.await;
// replaces CreateCamelContextPerTestTrueTest
@QuarkusTest
-@TestProfile(CallbacksPerTestTrue01Test.class)
public class CallbacksPerTestTrue02Test {
@Test
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java
index ef19a48b33..b773c49b37 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/junit5/patterns/AdviceWithLambdaTest.java
@@ -17,6 +17,7 @@
package org.apache.camel.quarkus.test.junit5.patterns;
import io.quarkus.test.junit.QuarkusTest;
+import io.quarkus.test.junit.TestProfile;
import org.apache.camel.RoutesBuilder;
import org.apache.camel.builder.AdviceWith;
import org.apache.camel.builder.RouteBuilder;
@@ -24,6 +25,7 @@ import org.apache.camel.quarkus.test.CamelQuarkusTestSupport;
import org.junit.jupiter.api.Test;
@QuarkusTest
+@TestProfile(AdviceWithLambdaTest.class)
public class AdviceWithLambdaTest extends CamelQuarkusTestSupport {
@Override
diff --git a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java
index 159d352c49..d3df9b6662 100644
--- a/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java
+++ b/test-framework/junit5/src/test/java/org/apache/camel/quarkus/test/userTestCases/AdviceInDoBeforeEachMethodsTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.quarkus.test.userTestCases;
import javax.inject.Inject;
import io.quarkus.test.junit.QuarkusTest;
-import io.quarkus.test.junit.TestProfile;
import io.quarkus.test.junit.callback.QuarkusTestMethodContext;
import org.apache.camel.CamelContext;
import org.apache.camel.EndpointInject;
@@ -36,7 +35,6 @@ import org.junit.jupiter.api.Test;
* Test for https://github.com/apache/camel-quarkus/issues/4362
*/
@QuarkusTest
-@TestProfile(AdviceInDoBeforeEachMethodsTest.class)
public class AdviceInDoBeforeEachMethodsTest extends CamelQuarkusTestSupport {
@Produce("direct:ftp")
[camel-quarkus] 01/08: Exclude org.testcontainers:postgresql from camel-pgevent
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 0e61013e126744cf1253a363cecb9584a558cc39
Author: James Netherton <ja...@gmail.com>
AuthorDate: Mon Feb 13 12:39:16 2023 +0000
Exclude org.testcontainers:postgresql from camel-pgevent
Fixes #4469
---
poms/bom/pom.xml | 4 ++++
poms/bom/src/main/generated/flattened-full-pom.xml | 4 ++++
poms/bom/src/main/generated/flattened-reduced-pom.xml | 4 ++++
poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml | 4 ++++
4 files changed, 16 insertions(+)
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 63bfdcc855..d3e5649e57 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -4612,6 +4612,10 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>postgresql</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml
index f8fe4f57c7..170a905cbe 100644
--- a/poms/bom/src/main/generated/flattened-full-pom.xml
+++ b/poms/bom/src/main/generated/flattened-full-pom.xml
@@ -4551,6 +4551,10 @@
<groupId>junit</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>junit</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
+ <exclusion>
+ <groupId>org.testcontainers</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>postgresql</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </exclusion>
</exclusions>
</dependency>
<dependency>
diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml b/poms/bom/src/main/generated/flattened-reduced-pom.xml
index cf3b3ace1b..0998f6a20b 100644
--- a/poms/bom/src/main/generated/flattened-reduced-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml
@@ -4551,6 +4551,10 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>postgresql</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
index e7898ffed0..16a98e1c24 100644
--- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
@@ -4551,6 +4551,10 @@
<groupId>junit</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>junit</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</exclusion>
+ <exclusion>
+ <groupId>org.testcontainers</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>postgresql</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </exclusion>
</exclusions>
</dependency>
<dependency>