https://issues.apache.org/jira/browse/AMQ-4028 - ws transport test - disconnect client when finished

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1388056 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-09-20 14:55:37 +00:00
parent c6595066e9
commit 0f9647c1f8
2 changed files with 14 additions and 0 deletions

View File

@ -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");
}
}));
}
}
}

View File

@ -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 {