You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2018/09/18 20:17:58 UTC
[camel] branch master updated (e94b664 -> fe4747c)
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from e94b664 CAMEL-12816: Fixed CS in some components
new 7e7cf44 Fix MQTT URI param typo.
new fe4747c Extended camel-mqtt configuration test coverage with respect to Quality Of Service
The 2 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/mqtt/MQTTConfiguration.java | 4 +--
.../component/mqtt/MQTTConfigurationTest.java | 41 ++++++++++++++++++----
2 files changed, 36 insertions(+), 9 deletions(-)
[camel] 01/02: Fix MQTT URI param typo.
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 7e7cf449e4078b99bec4e8ee3cdade3aa4861f63
Author: Philippe Schaller <ph...@gmail.ch>
AuthorDate: Tue Sep 18 17:40:39 2018 +0200
Fix MQTT URI param typo.
---
.../main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java
index eb341df..b83b4dd 100644
--- a/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java
+++ b/components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java
@@ -75,7 +75,7 @@ public class MQTTConfiguration extends MQTT {
String willTopic;
@UriParam
String willMessage;
- @UriParam(enums = "AtMostOnce,AtLeastOne,ExactlyOnce", defaultValue = "AtMostOnce")
+ @UriParam(enums = "AtMostOnce,AtLeastOnce,ExactlyOnce", defaultValue = "AtMostOnce")
QoS willQos = QoS.AT_MOST_ONCE;
@UriParam
QoS willRetain;
@@ -112,7 +112,7 @@ public class MQTTConfiguration extends MQTT {
private int sendWaitInSeconds = 5;
@UriParam
private boolean byDefaultRetain;
- @UriParam(enums = "AtMostOnce,AtLeastOne,ExactlyOnce", defaultValue = "AtLeastOnce")
+ @UriParam(enums = "AtMostOnce,AtLeastOnce,ExactlyOnce", defaultValue = "AtLeastOnce")
private String qualityOfService = QoS.AT_LEAST_ONCE.name();
private QoS qos = QoS.AT_LEAST_ONCE;
[camel] 02/02: Extended camel-mqtt configuration test coverage with
respect to Quality Of Service
Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit fe4747cc971e8fb9659356ffa8881fd96bafde3c
Author: aldettinger <al...@gmail.com>
AuthorDate: Tue Sep 18 22:15:45 2018 +0200
Extended camel-mqtt configuration test coverage with respect to Quality Of Service
---
.../component/mqtt/MQTTConfigurationTest.java | 41 ++++++++++++++++++----
1 file changed, 34 insertions(+), 7 deletions(-)
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java
index b79638e..24e0ad4 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java
@@ -25,9 +25,9 @@ public class MQTTConfigurationTest extends MQTTBaseTest {
@Test
public void testBasicConfiguration() throws Exception {
Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true&qualityOfService=exactlyOnce&publishTopicName=" + TEST_TOPIC + "&subscribeTopicName=" + TEST_TOPIC
- + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
+ + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
- MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint;
+ MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint;
assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE);
assertEquals(mqttEndpoint.getConfiguration().getPublishTopicName(), TEST_TOPIC);
@@ -38,9 +38,9 @@ public class MQTTConfigurationTest extends MQTTBaseTest {
@Test
public void testMultipleSubscribeTopicsConfiguration() throws Exception {
Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true&qualityOfService=exactlyOnce&publishTopicName=" + TEST_TOPIC + "&subscribeTopicNames=" + TEST_TOPICS
- + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
+ + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
- MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint;
+ MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint;
assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE);
assertEquals(mqttEndpoint.getConfiguration().getPublishTopicName(), TEST_TOPIC);
@@ -50,14 +50,41 @@ public class MQTTConfigurationTest extends MQTTBaseTest {
@Test
public void testWildcardSubscribeTopicsConfiguration() throws Exception {
- Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true&qualityOfService=exactlyOnce&publishTopicName=" + TEST_TOPIC + "&subscribeTopicNames=" + TEST_TOPICS_WITH_WILDCARDS
- + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
+ Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true&qualityOfService=exactlyOnce&publishTopicName=" + TEST_TOPIC + "&subscribeTopicNames="
+ + TEST_TOPICS_WITH_WILDCARDS + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
- MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint;
+ MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint;
assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE);
assertEquals(mqttEndpoint.getConfiguration().getPublishTopicName(), TEST_TOPIC);
assertEquals(mqttEndpoint.getConfiguration().getSubscribeTopicNames(), TEST_TOPICS_WITH_WILDCARDS);
assertTrue(mqttEndpoint.getConfiguration().isByDefaultRetain());
}
+
+ @Test
+ public void testExactlyOnceQualityOfServiceConfiguration() throws Exception {
+ Endpoint endpoint = context.getEndpoint("mqtt:todo?qualityOfService=exactlyOnce");
+ assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
+ MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint;
+
+ assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.EXACTLY_ONCE);
+ }
+
+ @Test
+ public void testAtLeastOnceQualityOfServiceConfiguration() throws Exception {
+ Endpoint endpoint = context.getEndpoint("mqtt:todo?qualityOfService=AtLeastOnce");
+ assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
+ MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint;
+
+ assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.AT_LEAST_ONCE);
+ }
+
+ @Test
+ public void testAtMostOnceQualityOfServiceConfiguration() throws Exception {
+ Endpoint endpoint = context.getEndpoint("mqtt:todo?qualityOfService=AtMostOnce");
+ assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
+ MQTTEndpoint mqttEndpoint = (MQTTEndpoint)endpoint;
+
+ assertEquals(mqttEndpoint.getConfiguration().getQoS(), QoS.AT_MOST_ONCE);
+ }
}