You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/09/19 08:34:34 UTC

[camel] branch master updated: CAMEL-13991: camel-main - Configuring component options with #class dont work

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new a5aa1b6  CAMEL-13991: camel-main - Configuring component options with #class dont work
a5aa1b6 is described below

commit a5aa1b6f89da0eb7e7c749fadf13b2f900468563
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Sep 19 10:33:53 2019 +0200

    CAMEL-13991: camel-main - Configuring component options with #class dont work
---
 .../src/main/java/org/apache/camel/main/MainSupport.java   | 14 ++++++++++++++
 .../src/test/java/org/apache/camel/main/MainSedaTest.java  |  4 ++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
index e036e98..9c77827 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/MainSupport.java
@@ -525,6 +525,20 @@ public abstract class MainSupport extends ServiceSupport {
     }
 
     /**
+     * Adds a property (initial) for the properties component,
+     * which will be used before any locations are resolved.
+     *
+     * @param key    the property key
+     * @param value  the property value
+     *
+     * @see #addInitialProperty(String, String)
+     * @see #addOverrideProperty(String, String)
+     */
+    public void addProperty(String key, String value) {
+        addInitialProperty(key, value);
+    }
+
+    /**
      * Adds a initial property for the properties component,
      * which will be used before any locations are resolved.
      *
diff --git a/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java b/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java
index fe0669a..c33dd53 100644
--- a/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java
+++ b/core/camel-main/src/test/java/org/apache/camel/main/MainSedaTest.java
@@ -28,8 +28,8 @@ public class MainSedaTest extends Assert {
     public void testSedaMain() throws Exception {
         Main main = new Main();
         main.addRouteBuilder(new MyRouteBuilder());
-        main.addInitialProperty("camel.component.seda.defaultQueueFactory", "#class:org.apache.camel.main.MySedaBlockingQueueFactory");
-        main.addInitialProperty("camel.component.seda.defaultQueueFactory.counter", "123");
+        main.addProperty("camel.component.seda.defaultQueueFactory", "#class:org.apache.camel.main.MySedaBlockingQueueFactory");
+        main.addProperty("camel.component.seda.defaultQueueFactory.counter", "123");
         main.start();
 
         CamelContext camelContext = main.getCamelContext();