improve output of public mqtt test skipping output due to can't connect. not sure why the check in setupAuthInfo isn't failing for all the tests at this time, but after a few tests fail after timing out without receiving any published content, the rest then fail the pre-check with Connection refused.
fwiw, things only sort of seem to be working with manual mosquitto_{pub,sub}. running with -d shows ~25-45sec CONNECT / CONNACK delay. but once connected the pub/sub seems to working fine. the tests give up after ~15sec and they don't get past the connect delay... as can be seen in a failing test's traceback (interrupted after 15 sec under Connector.connectInternal() -> Connector.awaitDone()) Project: http://git-wip-us.apache.org/repos/asf/incubator-edgent/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-edgent/commit/6fc7b66f Tree: http://git-wip-us.apache.org/repos/asf/incubator-edgent/tree/6fc7b66f Diff: http://git-wip-us.apache.org/repos/asf/incubator-edgent/diff/6fc7b66f Branch: refs/heads/master Commit: 6fc7b66f684e4ec2ea57af08900caad5acbc5209 Parents: 3812c98 Author: Dale LaBossiere <dlab...@us.ibm.com> Authored: Mon Apr 17 12:12:20 2017 -0400 Committer: Dale LaBossiere <dlab...@us.ibm.com> Committed: Mon Apr 17 12:12:20 2017 -0400 ---------------------------------------------------------------------- .../org/apache/edgent/test/connectors/mqtt/MqttOpenTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-edgent/blob/6fc7b66f/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 fd1d894..a40e333 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 @@ -26,6 +26,8 @@ import java.util.UUID; import org.junit.Before; import org.junit.Ignore; +import org.junit.Rule; +import org.junit.rules.TestName; /** * Uses the MQTT test broker at: tcp://test.mosquitto.org:1883 @@ -38,6 +40,8 @@ import org.junit.Ignore; public class MqttOpenTest extends MqttStreamsTestManual { private String uniqueid = UUID.randomUUID().toString().replace('-','_'); + @Rule public TestName name = new TestName(); + @Before public void setupAuthInfo() { this.authInfo.clear(); // mosquitto.org server isn't happy w/username&pw @@ -47,7 +51,7 @@ public class MqttOpenTest extends MqttStreamsTestManual { Socket s = new Socket(uri.getHost(), uri.getPort()); s.close(); } catch (Exception e) { - System.err.println("Unable to connect to MQTT broker "+getServerURI()+" : "+e.getMessage()); + System.err.println("Skipping "+name.getMethodName()+": Unable to connect to MQTT broker "+getServerURI()+" : "+e.getMessage()); // e.printStackTrace(); assumeTrue(false); } @@ -60,7 +64,7 @@ public class MqttOpenTest extends MqttStreamsTestManual { s.close(); return true; } catch (Exception e) { - System.err.println("Unable to connect to MQTT broker "+getSslServerURI()+" : "+e.getMessage()); + System.err.println(name.getMethodName()+": Unable to connect to MQTT broker "+getSslServerURI()+" : "+e.getMessage()); // e.printStackTrace(); return false; }