You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/07/30 13:38:13 UTC

[camel] branch master updated (7e02699 -> 645fc9e)

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

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


    from 7e02699  Removed unused imports
     new 554dd18  CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Paho
     new 8684317  CAMEL-13801 - Fixed CS for Camel-paho
     new 645fc9e  Removed unused imports

The 3 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:
 .../camel/component/paho/PahoComponentTest.java    | 29 ++++++----------------
 .../component/paho/PahoOverrideTopicTest.java      | 10 ++------
 2 files changed, 10 insertions(+), 29 deletions(-)


[camel] 01/03: CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Paho

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 554dd18d86bf92141e24cd97b173b3c9392ae907
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 30 15:35:55 2019 +0200

    CAMEL-13801 - camel3 - Use @BindToRegistry wherever possible, Camel-Paho
---
 .../java/org/apache/camel/component/paho/PahoComponentTest.java  | 9 ++-------
 .../org/apache/camel/component/paho/PahoOverrideTopicTest.java   | 9 ++-------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
index 5d146df..b54a08c 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.paho;
 import java.io.UnsupportedEncodingException;
 
 import org.apache.activemq.broker.BrokerService;
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
@@ -33,6 +34,7 @@ import org.junit.Test;
 
 public class PahoComponentTest extends CamelTestSupport {
 
+	@BindToRegistry("connectOptions")
     MqttConnectOptions connectOptions = new MqttConnectOptions();
 
     @EndpointInject("mock:test")
@@ -89,13 +91,6 @@ public class PahoComponentTest extends CamelTestSupport {
         };
     }
 
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        registry.bind("connectOptions", connectOptions);
-        return registry;
-    }
-
     // Tests
 
     @Test
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
index f209a7b..7804b46 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.paho;
 
 import org.apache.activemq.broker.BrokerService;
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
@@ -27,6 +28,7 @@ import org.junit.Test;
 
 public class PahoOverrideTopicTest extends CamelTestSupport {
 
+	@BindToRegistry("connectOptions")
     MqttConnectOptions connectOptions = new MqttConnectOptions();
 
     BrokerService broker;
@@ -66,13 +68,6 @@ public class PahoOverrideTopicTest extends CamelTestSupport {
         };
     }
 
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        registry.bind("connectOptions", connectOptions);
-        return registry;
-    }
-
     // Tests
 
     @Test


[camel] 02/03: CAMEL-13801 - Fixed CS for Camel-paho

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 86843171266dad4e3908557bf99658d472ad8d8a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 30 15:36:31 2019 +0200

    CAMEL-13801 - Fixed CS for Camel-paho
---
 .../camel/component/paho/PahoComponentTest.java     | 21 +++++++--------------
 .../camel/component/paho/PahoOverrideTopicTest.java |  2 +-
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
index b54a08c..bcc4d7a 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
@@ -34,7 +34,7 @@ import org.junit.Test;
 
 public class PahoComponentTest extends CamelTestSupport {
 
-	@BindToRegistry("connectOptions")
+    @BindToRegistry("connectOptions")
     MqttConnectOptions connectOptions = new MqttConnectOptions();
 
     @EndpointInject("mock:test")
@@ -95,11 +95,7 @@ public class PahoComponentTest extends CamelTestSupport {
 
     @Test
     public void checkOptions() {
-        String uri = "paho:/test/topic"
-                + "?clientId=sampleClient"
-                + "&brokerUrl=tcp://localhost:" + mqttPort
-                + "&qos=2"
-                + "&persistence=file";
+        String uri = "paho:/test/topic" + "?clientId=sampleClient" + "&brokerUrl=tcp://localhost:" + mqttPort + "&qos=2" + "&persistence=file";
 
         PahoEndpoint endpoint = getMandatoryEndpoint(uri, PahoEndpoint.class);
 
@@ -139,9 +135,8 @@ public class PahoComponentTest extends CamelTestSupport {
     @Test
     public void shouldUseConnectionOptionsFromRegistry() {
         // Given
-        PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint(
-                "paho:registryConnectOptions?connectOptions=#connectOptions&brokerUrl=tcp://localhost:" + mqttPort,
-                PahoEndpoint.class);
+        PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint("paho:registryConnectOptions?connectOptions=#connectOptions&brokerUrl=tcp://localhost:" + mqttPort,
+                                                                               PahoEndpoint.class);
 
         // Then
         assertSame(connectOptions, pahoWithConnectOptionsFromRegistry.resolveMqttConnectOptions());
@@ -150,9 +145,7 @@ public class PahoComponentTest extends CamelTestSupport {
     @Test
     public void shouldAutomaticallyUseConnectionOptionsFromRegistry() {
         // Given
-        PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint(
-                "paho:registryConnectOptions?brokerUrl=tcp://localhost:" + mqttPort,
-                PahoEndpoint.class);
+        PahoEndpoint pahoWithConnectOptionsFromRegistry = getMandatoryEndpoint("paho:registryConnectOptions?brokerUrl=tcp://localhost:" + mqttPort, PahoEndpoint.class);
 
         // Then
         assertSame(connectOptions, pahoWithConnectOptionsFromRegistry.resolveMqttConnectOptions());
@@ -171,7 +164,7 @@ public class PahoComponentTest extends CamelTestSupport {
         mock.assertIsSatisfied();
 
         Exchange exchange = mock.getExchanges().get(0);
-        String payload = new String((byte[]) exchange.getIn().getBody(), "utf-8");
+        String payload = new String((byte[])exchange.getIn().getBody(), "utf-8");
 
         assertEquals("queue", exchange.getIn().getHeader(PahoConstants.MQTT_TOPIC));
         assertEquals(msg, payload);
@@ -219,5 +212,5 @@ public class PahoComponentTest extends CamelTestSupport {
         // Then
         mock.assertIsSatisfied();
     }
-    
+
 }
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
index 7804b46..36ac07d 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
@@ -28,7 +28,7 @@ import org.junit.Test;
 
 public class PahoOverrideTopicTest extends CamelTestSupport {
 
-	@BindToRegistry("connectOptions")
+    @BindToRegistry("connectOptions")
     MqttConnectOptions connectOptions = new MqttConnectOptions();
 
     BrokerService broker;


[camel] 03/03: Removed unused imports

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 645fc9e23cd5577bc9be1f9319c3e7516ae70f77
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jul 30 15:37:52 2019 +0200

    Removed unused imports
---
 .../src/test/java/org/apache/camel/component/paho/PahoComponentTest.java | 1 -
 .../test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java | 1 -
 2 files changed, 2 deletions(-)

diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
index bcc4d7a..33ae40d 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoComponentTest.java
@@ -24,7 +24,6 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
diff --git a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
index 36ac07d..9182566 100644
--- a/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
+++ b/components/camel-paho/src/test/java/org/apache/camel/component/paho/PahoOverrideTopicTest.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.paho;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.AvailablePortFinder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.eclipse.paho.client.mqttv3.MqttConnectOptions;