You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/08/13 13:42:41 UTC
[camel-quarkus] branch master updated: Fix #129 Properies
evaluation broken after the introduction of PropertyBindingSupport
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/master by this push:
new be79b58 Fix #129 Properies evaluation broken after the introduction of PropertyBindingSupport
be79b58 is described below
commit be79b585357be3f2a71b55eabdcf3af43d9a2c2e
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Mon Aug 12 17:46:39 2019 +0200
Fix #129 Properies evaluation broken after the introduction of PropertyBindingSupport
---
.../camel/quarkus/core/deployment/CamelProcessor.java | 5 ++++-
.../quarkus/core/runtime/support/FastCamelContext.java | 2 +-
.../org/apache/camel/quarkus/core/CamelServlet.java | 8 ++++++++
.../core/src/main/resources/application.properties | 2 ++
.../java/org/apache/camel/quarkus/core/CamelTest.java | 17 +++++++++++++----
5 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java
index 8200a1d..9bb6468 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelProcessor.java
@@ -41,6 +41,8 @@ import io.quarkus.deployment.builditem.substrate.SubstrateResourceBuildItem;
import io.quarkus.deployment.builditem.substrate.SubstrateResourceBundleBuildItem;
import io.quarkus.jaxb.deployment.JaxbEnabledBuildItem;
import io.quarkus.jaxb.deployment.JaxbFileRootBuildItem;
+
+import org.apache.camel.Component;
import org.apache.camel.Consumer;
import org.apache.camel.Converter;
import org.apache.camel.Endpoint;
@@ -67,7 +69,8 @@ class CamelProcessor {
Producer.class,
TypeConverter.class,
ExchangeFormatter.class,
- ScheduledPollConsumerScheduler.class);
+ ScheduledPollConsumerScheduler.class,
+ Component.class);
private static final List<Class<? extends Annotation>> CAMEL_REFLECTIVE_ANNOTATIONS = Arrays.asList();
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
index 2ed5feb..7624de1 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
@@ -374,7 +374,7 @@ public class FastCamelContext extends AbstractCamelContext {
this,
result,
new HashMap<>((Map) props),
- CamelRuntime.PFX_CAMEL + type + "." + name);
+ CamelRuntime.PFX_CAMEL + type + "." + name + ".");
}
return result;
diff --git a/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java b/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
index 8bc3a79..1a2e43a 100644
--- a/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
+++ b/integration-tests/core/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
@@ -27,6 +27,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.apache.camel.Route;
+import org.apache.camel.component.timer.TimerComponent;
import org.apache.camel.quarkus.core.runtime.CamelRuntime;
@Path("/")
@@ -51,4 +52,11 @@ public class CamelServlet {
return runtime.getContext().resolvePropertyPlaceholders(prefix + name + suffix);
}
+
+ @Path("/timer/resolve-property-placeholders")
+ @GET
+ @Produces(MediaType.TEXT_PLAIN)
+ public boolean timerResolvePropertyPlaceholders() throws Exception {
+ return runtime.getContext().getComponent("timer", TimerComponent.class).isResolvePropertyPlaceholders();
+ }
}
diff --git a/integration-tests/core/src/main/resources/application.properties b/integration-tests/core/src/main/resources/application.properties
index df1e64a..5f09557 100644
--- a/integration-tests/core/src/main/resources/application.properties
+++ b/integration-tests/core/src/main/resources/application.properties
@@ -32,6 +32,8 @@ quarkus.camel.defer-init-phase=true
#
camel.context.name=quarkus-camel-example
+# Timer
+camel.component.timer.resolve-property-placeholders = false
#
# Integration
#
diff --git a/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CamelTest.java b/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
index 6764f25..b259d2a 100644
--- a/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
+++ b/integration-tests/core/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
@@ -16,15 +16,17 @@
*/
package org.apache.camel.quarkus.core;
-import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
-import org.junit.jupiter.api.Test;
-
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
+import org.junit.jupiter.api.Test;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+
@QuarkusTest
public class CamelTest {
+
@Test
public void testRoutes() {
RestAssured.when().get("/test/routes").then().body(containsString("timer"));
@@ -34,4 +36,11 @@ public class CamelTest {
public void testProperties() {
RestAssured.when().get("/test/property/camel.context.name").then().body(is("quarkus-camel-example"));
}
+
+ @Test
+ public void timerPropertyPropagated() {
+ RestAssured.when().get("/test/property/camel.component.timer.resolve-property-placeholders").then().body(is("false"));
+ RestAssured.when().get("/test/timer/resolve-property-placeholders").then().body(is("false"));
+ }
+
}