camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-10047: camel-mqtt: dynamic port during testing
Date Sun, 12 Jun 2016 15:30:17 GMT
Repository: camel
Updated Branches:
  refs/heads/master 3c11ff553 -> 3ba4859c4


CAMEL-10047: camel-mqtt: dynamic port during testing


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3ba4859c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3ba4859c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3ba4859c

Branch: refs/heads/master
Commit: 3ba4859c4c51e54b5a5e16d47c3117bad2dce6aa
Parents: 3c11ff5
Author: Arno Noordover <anoordover@users.noreply.github.com>
Authored: Sun Jun 12 17:13:20 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Jun 12 17:28:09 2016 +0200

----------------------------------------------------------------------
 .../camel/component/mqtt/MQTTBaseTest.java      |  2 +-
 .../camel/component/mqtt/MQTTBrigeTest.java     | 14 ++---
 .../component/mqtt/MQTTConfigurationTest.java   |  9 ++-
 .../mqtt/MQTTConsumerMultipleTopicsTest.java    |  3 +-
 .../camel/component/mqtt/MQTTConsumerTest.java  |  3 +-
 .../mqtt/MQTTConsumerWildcardTopicsTest.java    |  3 +-
 .../component/mqtt/MQTTDuplicatesTest.java      | 12 ++--
 .../mqtt/MQTTProducerReconnectTest.java         |  3 +-
 .../camel/component/mqtt/MQTTProducerTest.java  |  3 +-
 .../camel/component/mqtt/MQTTTestSupport.java   | 61 ++++++++++++++++++++
 10 files changed, 91 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBaseTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBaseTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBaseTest.java
index f535de2..7d6280f 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBaseTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBaseTest.java
@@ -39,7 +39,7 @@ public abstract class MQTTBaseTest extends CamelTestSupport {
         brokerService = new BrokerService();
         brokerService.setPersistent(false);
         brokerService.setAdvisorySupport(false);
-        brokerService.addConnector("mqtt://127.0.0.1:1883");
+        brokerService.addConnector(MQTTTestSupport.getConnection());
         brokerService.start();
         super.setUp();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBrigeTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBrigeTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBrigeTest.java
index 6b621b4..193e888 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBrigeTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTBrigeTest.java
@@ -69,20 +69,20 @@ public class MQTTBrigeTest extends MQTTBaseTest {
         return new RouteBuilder() {
             public void configure() {
                 // Bridge message over two MQTT topics
-                from("direct:start").to("mqtt:foo?publishTopicName=test/topic1");
+                from("direct:start").to("mqtt:foo?publishTopicName=test/topic1&host="
+ MQTTTestSupport.getHostForMQTTEndpoint());
 
-                from("mqtt:foo?subscribeTopicName=test/topic1").to("log:testlogger?showAll=true")
-                    .to("mqtt:foo?publishTopicName=test/resulttopic")
+                from("mqtt:foo?subscribeTopicName=test/topic1&host=" + MQTTTestSupport.getHostForMQTTEndpoint()).to("log:testlogger?showAll=true")
+                    .to("mqtt:foo?publishTopicName=test/resulttopic&host=" + MQTTTestSupport.getHostForMQTTEndpoint())
                     .log(LoggingLevel.ERROR, "Message processed");
 
                 // Bridge message over two MQTT topics with a seda in between
-                from("direct:startWorkaround").to("mqtt:foo?publishTopicName=test/topic2");
-                from("mqtt:foo?subscribeTopicName=test/topic2").to("log:testlogger?showAll=true")
+                from("direct:startWorkaround").to("mqtt:foo?publishTopicName=test/topic2&host="
+ MQTTTestSupport.getHostForMQTTEndpoint());
+                from("mqtt:foo?subscribeTopicName=test/topic2&host=" + MQTTTestSupport.getHostForMQTTEndpoint()).to("log:testlogger?showAll=true")
                     .to("seda:a");
-                from("seda:a").to("mqtt:foo?publishTopicName=test/resulttopic")
+                from("seda:a").to("mqtt:foo?publishTopicName=test/resulttopic&host="
+ MQTTTestSupport.getHostForMQTTEndpoint())
                     .log(LoggingLevel.ERROR, "Message processed");
                 // Forward the result to a mock endpoint to test
-                from("mqtt:foo?subscribeTopicName=test/resulttopic").to("mock:result");
+                from("mqtt:foo?subscribeTopicName=test/resulttopic&host=" + MQTTTestSupport.getHostForMQTTEndpoint()).to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConfigurationTest.java
----------------------------------------------------------------------
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 bba2fa3..b79638e 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
@@ -24,7 +24,8 @@ 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);
+        Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true&qualityOfService=exactlyOnce&publishTopicName="
+ TEST_TOPIC + "&subscribeTopicName=" + TEST_TOPIC
+                + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
         assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
         MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint;
 
@@ -36,7 +37,8 @@ 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);
+        Endpoint endpoint = context.getEndpoint("mqtt:todo?byDefaultRetain=true&qualityOfService=exactlyOnce&publishTopicName="
+ TEST_TOPIC + "&subscribeTopicNames=" + TEST_TOPICS
+                + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
         assertTrue("Endpoint not a MQTTEndpoint: " + endpoint, endpoint instanceof MQTTEndpoint);
         MQTTEndpoint mqttEndpoint = (MQTTEndpoint) endpoint;
 
@@ -48,7 +50,8 @@ 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);
+        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;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerMultipleTopicsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerMultipleTopicsTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerMultipleTopicsTest.java
index eb765eb..cb7ecb1 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerMultipleTopicsTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerMultipleTopicsTest.java
@@ -31,6 +31,7 @@ public class MQTTConsumerMultipleTopicsTest extends MQTTBaseTest {
     @Test
     public void testConsumeMultipleTopics() throws Exception {
         MQTT mqtt = new MQTT();
+        mqtt.setHost(MQTTTestSupport.getHostForMQTTEndpoint());
         BlockingConnection publisherConnection = mqtt.blockingConnection();
         Topic topic1 = new Topic(TEST_TOPIC, QoS.AT_MOST_ONCE);
         Topic topic2 = new Topic(TEST_TOPIC_2, QoS.AT_MOST_ONCE);
@@ -54,7 +55,7 @@ public class MQTTConsumerMultipleTopicsTest extends MQTTBaseTest {
 
         return new RouteBuilder() {
             public void configure() {
-                from("mqtt:bar?subscribeTopicNames=" + TEST_TOPICS)
+                from("mqtt:bar?subscribeTopicNames=" + TEST_TOPICS + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint())
                     .transform(body().convertToString())
                     .to("mock:result");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerTest.java
index 6870079..2f1f1be 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerTest.java
@@ -31,6 +31,7 @@ public class MQTTConsumerTest extends MQTTBaseTest {
     @Test
     public void testConsume() throws Exception {
         MQTT mqtt = new MQTT();
+        mqtt.setHost(MQTTTestSupport.getHostForMQTTEndpoint());
         BlockingConnection publisherConnection = mqtt.blockingConnection();
         Topic topic = new Topic(TEST_TOPIC, QoS.AT_MOST_ONCE);
         MockEndpoint mock = getMockEndpoint("mock:result");
@@ -50,7 +51,7 @@ public class MQTTConsumerTest extends MQTTBaseTest {
 
         return new RouteBuilder() {
             public void configure() {
-                from("mqtt:bar?subscribeTopicName=" + TEST_TOPIC)
+                from("mqtt:bar?subscribeTopicName=" + TEST_TOPIC + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint())
                         .transform(body().convertToString())
                         .to("mock:result");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerWildcardTopicsTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerWildcardTopicsTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerWildcardTopicsTest.java
index 8337320..ccc885e 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerWildcardTopicsTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTConsumerWildcardTopicsTest.java
@@ -39,6 +39,7 @@ public class MQTTConsumerWildcardTopicsTest extends MQTTBaseTest {
     @Test
     public void testConsumeMultipleTopicsWithWildcards() throws Exception {
         MQTT mqtt = new MQTT();
+        mqtt.setHost(MQTTTestSupport.getHostForMQTTEndpoint());
         BlockingConnection publisherConnection = mqtt.blockingConnection();
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMinimumMessageCount(numberOfMessages * (PUBLISH_TOPICS.length - 1));
@@ -60,7 +61,7 @@ public class MQTTConsumerWildcardTopicsTest extends MQTTBaseTest {
 
         return new RouteBuilder() {
             public void configure() {
-                from("mqtt:bar?subscribeTopicNames=" + TEST_TOPICS_WITH_WILDCARDS)
+                from("mqtt:bar?subscribeTopicNames=" + TEST_TOPICS_WITH_WILDCARDS + "&host="
+ MQTTTestSupport.getHostForMQTTEndpoint())
                     .transform(body().convertToString())
                     .to("mock:result");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTDuplicatesTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTDuplicatesTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTDuplicatesTest.java
index c397a1f..800c65e 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTDuplicatesTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTDuplicatesTest.java
@@ -70,7 +70,7 @@ public class MQTTDuplicatesTest extends MQTTBaseTest {
         brokerService = new BrokerService();
         brokerService.setPersistent(false);
         brokerService.setAdvisorySupport(false);
-        brokerService.addConnector("mqtt://127.0.0.1:1883?trace=true");
+        brokerService.addConnector(MQTTTestSupport.getConnection() + "?trace=true");
         brokerService.start();
         brokerService.waitUntilStarted();
         LOG.info(">>>>>>>>>> Broker restarted");
@@ -93,7 +93,7 @@ public class MQTTDuplicatesTest extends MQTTBaseTest {
         brokerService = new BrokerService();
         brokerService.setPersistent(false);
         brokerService.setAdvisorySupport(false);
-        brokerService.addConnector("mqtt://127.0.0.1:1883?trace=true");
+        brokerService.addConnector(MQTTTestSupport.getConnection() + "?trace=true");
         brokerService.start();
         brokerService.waitUntilStarted();
         LOG.info(">>>>>>>>>> Broker restarted");
@@ -133,9 +133,9 @@ public class MQTTDuplicatesTest extends MQTTBaseTest {
                 from("direct:withoutClientID")
                     .routeId("SenderWithoutClientID")
                     .log("$$$$$ Sending message: ${body}")
-                    .to("mqtt:sender?publishTopicName=test/topic1&qualityOfService=ExactlyOnce");
+                    .to("mqtt:sender?publishTopicName=test/topic1&qualityOfService=ExactlyOnce&host="
+ MQTTTestSupport.getHostForMQTTEndpoint());
             
-                from("mqtt:reader?subscribeTopicName=test/topic1&qualityOfService=ExactlyOnce")
+                from("mqtt:reader?subscribeTopicName=test/topic1&qualityOfService=ExactlyOnce&host="
+ MQTTTestSupport.getHostForMQTTEndpoint())
                     .routeId("ReceiverWithoutClientID")
                     .log("$$$$$ Received message: ${body}")
                     .to("mock:result");
@@ -146,9 +146,9 @@ public class MQTTDuplicatesTest extends MQTTBaseTest {
                 from("direct:withClientID")
                     .routeId("SenderWithClientID")
                     .log("$$$$$ Sending message: ${body}")
-                    .to("mqtt:sender?publishTopicName=test/topic2&clientId=sender&qualityOfService=ExactlyOnce");
+                    .to("mqtt:sender?publishTopicName=test/topic2&clientId=sender&qualityOfService=ExactlyOnce&host="
+ MQTTTestSupport.getHostForMQTTEndpoint());
                 
-                from("mqtt:reader?subscribeTopicName=test/topic2&clientId=receiver&qualityOfService=ExactlyOnce")
+                from("mqtt:reader?subscribeTopicName=test/topic2&clientId=receiver&qualityOfService=ExactlyOnce&host="
+ MQTTTestSupport.getHostForMQTTEndpoint())
                     .routeId("ReceiverWithClientID")
                     .log("$$$$$ Received message: ${body}")
                     .to("mock:result");

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerReconnectTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerReconnectTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerReconnectTest.java
index 15281a8..0a8d901 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerReconnectTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerReconnectTest.java
@@ -32,6 +32,7 @@ public class MQTTProducerReconnectTest extends MQTTBaseTest {
     @Test
     public void testProduce() throws Exception {
         MQTT mqtt = new MQTT();
+        mqtt.setHost(MQTTTestSupport.getHostForMQTTEndpoint());
         final BlockingConnection subscribeConnection = mqtt.blockingConnection();
         subscribeConnection.connect();
         Topic topic = new Topic(TEST_TOPIC, QoS.AT_MOST_ONCE);
@@ -89,7 +90,7 @@ public class MQTTProducerReconnectTest extends MQTTBaseTest {
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("direct:foo").to("mqtt:boo?reconnectDelay=1000&publishTopicName="
+ TEST_TOPIC);
+                from("direct:foo").to("mqtt:boo?reconnectDelay=1000&publishTopicName="
+ TEST_TOPIC + "&host=" + MQTTTestSupport.getHostForMQTTEndpoint());
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerTest.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerTest.java
index 82ce669..7ffe225 100644
--- a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerTest.java
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTProducerTest.java
@@ -34,6 +34,7 @@ public class MQTTProducerTest extends MQTTBaseTest {
     @Test
     public void testProduce() throws Exception {
         MQTT mqtt = new MQTT();
+        mqtt.setHost(MQTTTestSupport.getHostForMQTTEndpoint());
         final BlockingConnection subscribeConnection = mqtt.blockingConnection();
         subscribeConnection.connect();
         Topic topic = new Topic(TEST_TOPIC, QoS.AT_MOST_ONCE);
@@ -70,7 +71,7 @@ public class MQTTProducerTest extends MQTTBaseTest {
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("direct:foo").to("mqtt:boo?publishTopicName=" + TEST_TOPIC);
+                from("direct:foo").to("mqtt:boo?publishTopicName=" + TEST_TOPIC + "&host="
+ MQTTTestSupport.getHostForMQTTEndpoint());
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/3ba4859c/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTTestSupport.java
b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTTestSupport.java
new file mode 100644
index 0000000..d521b10
--- /dev/null
+++ b/components/camel-mqtt/src/test/java/org/apache/camel/component/mqtt/MQTTTestSupport.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.component.mqtt;
+
+import org.apache.camel.test.AvailablePortFinder;
+
+/**
+ * For test cases that use unique contexts, they can share the 
+ * ports which will make things a bit faster as ports aren't opened
+ * and closed all the time. 
+ */
+public final class MQTTTestSupport {
+
+    static final int PORT1 = AvailablePortFinder.getNextAvailable();  
+    static final String CONNECTION;
+    private static final String HOST;
+
+    static {
+        //set them as system properties so Spring can use the property placeholder
+        //things to set them into the URL's in the spring contexts
+        System.setProperty("MQTTTestSupport.port1", Integer.toString(PORT1));
+        CONNECTION = "mqtt://127.0.0.1:" + PORT1;
+        HOST = "tcp://127.0.0.1:" + PORT1;
+    }
+    
+    private MQTTTestSupport() {
+    }
+    
+    public static int getPort(String name) {
+        int port = AvailablePortFinder.getNextAvailable();
+        System.setProperty(name, Integer.toString(port));
+        return port;
+    }
+    
+    public static int getPort1() {
+        return PORT1;
+    }
+
+    public static String getConnection() {
+        return CONNECTION;
+    }
+
+    public static String getHostForMQTTEndpoint() {
+        return HOST;
+    }
+}


Mime
View raw message