You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by dl...@apache.org on 2017/03/02 13:57:03 UTC

[1/2] incubator-edgent git commit: [Edgent-227] skip testSsl if can't connect to test.mosquitto.org

Repository: incubator-edgent
Updated Branches:
  refs/heads/master 2907150c5 -> 4c293470c


[Edgent-227] skip testSsl if can't connect to test.mosquitto.org

Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/c1823274
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/c1823274
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/c1823274

Branch: refs/heads/master
Commit: c1823274171c983341eab28d5b3df83c48dbd6db
Parents: ec6ccb2
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Tue Feb 28 14:41:17 2017 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Tue Feb 28 14:43:48 2017 -0500

----------------------------------------------------------------------
 .../test/connectors/mqtt/MqttOpenTest.java      | 23 ++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/c1823274/connectors/mqtt/src/test/java/org/apache/edgent/test/connectors/mqtt/MqttOpenTest.java
----------------------------------------------------------------------
diff --git a/connectors/mqtt/src/test/java/org/apache/edgent/test/connectors/mqtt/MqttOpenTest.java b/connectors/mqtt/src/test/java/org/apache/edgent/test/connectors/mqtt/MqttOpenTest.java
index 63e8274..fd1d894 100644
--- a/connectors/mqtt/src/test/java/org/apache/edgent/test/connectors/mqtt/MqttOpenTest.java
+++ b/connectors/mqtt/src/test/java/org/apache/edgent/test/connectors/mqtt/MqttOpenTest.java
@@ -53,6 +53,19 @@ public class MqttOpenTest extends MqttStreamsTestManual {
         }
     }
     
+    boolean isSslConnectionOK() {
+      try {
+          URI uri = new URI(getSslServerURI());
+          Socket s = new Socket(uri.getHost(), uri.getPort());
+          s.close();
+          return true;
+      } catch (Exception e) {
+          System.err.println("Unable to connect to MQTT broker "+getSslServerURI()+" : "+e.getMessage());
+          // e.printStackTrace();
+          return false;
+      }
+    }
+    
     protected String[] getMqttTopics() {
         String[] topics = super.getMqttTopics();
         for (int i =0 ; i < topics.length; i++) {
@@ -84,9 +97,11 @@ public class MqttOpenTest extends MqttStreamsTestManual {
     @Ignore
     public void testSslClientAuth() {} // we don't have a mosquitto.org generated client cert
     
-    // [EDGENT-227] ssl://test.mosquitto.org:8883 is yielding "Connection refused"
-    // skip this until we can figure things out
-    @Ignore
-    public void testSsl() {}
+    public void testSsl() {
+      if (!isSslConnectionOK()) {
+        System.err.println("Skipping testSsl()");
+        assumeTrue(false);
+      }
+    }
 
 }


[2/2] incubator-edgent git commit: Merge pull request #295

Posted by dl...@apache.org.
Merge pull request #295

This closes #295


Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/4c293470
Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/4c293470
Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/4c293470

Branch: refs/heads/master
Commit: 4c293470cbb45bdcd15cc7ab520779cdae08a36f
Parents: 2907150 c182327
Author: Dale LaBossiere <dl...@us.ibm.com>
Authored: Thu Mar 2 08:57:00 2017 -0500
Committer: Dale LaBossiere <dl...@us.ibm.com>
Committed: Thu Mar 2 08:57:00 2017 -0500

----------------------------------------------------------------------
 .../test/connectors/mqtt/MqttOpenTest.java      | 23 ++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------