You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2012/09/20 16:55:37 UTC
svn commit: r1388056 - in /activemq/trunk/activemq-optional/src/test:
java/org/apache/activemq/transport/ws/WSTransportTest.java
webapp/websocket.html
Author: dejanb
Date: Thu Sep 20 14:55:37 2012
New Revision: 1388056
URL: http://svn.apache.org/viewvc?rev=1388056&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-4028 - ws transport test - disconnect client when finished
Modified:
activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java
activemq/trunk/activemq-optional/src/test/webapp/websocket.html
Modified: activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java?rev=1388056&r1=1388055&r2=1388056&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java (original)
+++ activemq/trunk/activemq-optional/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java Thu Sep 20 14:55:37 2012
@@ -245,6 +245,15 @@ public class WSTransportTest {
return webReceived.getText().equals("messages #" + MESSAGE_COUNT);
}
}));
+
+ Thread.sleep(1000);
+
+ assertTrue("Should have disconnected", Wait.waitFor(new Wait.Condition() {
+
+ public boolean isSatisified() throws Exception {
+ return webStatus.getText().equals("Disconnected");
+ }
+ }));
}
}
}
Modified: activemq/trunk/activemq-optional/src/test/webapp/websocket.html
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/test/webapp/websocket.html?rev=1388056&r1=1388055&r2=1388056&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/test/webapp/websocket.html (original)
+++ activemq/trunk/activemq-optional/src/test/webapp/websocket.html Thu Sep 20 14:55:37 2012
@@ -48,6 +48,11 @@
$("#status").html("Connected");
client.subscribe(destination, function(message) {
$("#received").html(message.body);
+ if (message.body == "messages #1000") {
+ client.disconnect(function() {
+ $("#status").html("Disconnected");
+ });
+ }
});
});
} else {