public void testDisconnect() throws Exception {
producer.send(session.createTextMessage("test"));
HttpClient httpClient = new HttpClient();
httpClient.start();
ContentExchange contentExchange = new ContentExchange();
httpClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
contentExchange.setURL("http://localhost:8080/message/test?readTimeout=1000&type=queue&clientId=test");
httpClient.send(contentExchange);
contentExchange.waitForDone();
LOG.info("Received: [" + contentExchange.getResponseStatus() + "] " + contentExchange.getResponseContent());
contentExchange = new ContentExchange();
contentExchange.setMethod("POST");
contentExchange.setURL("http://localhost:8080/message/test?clientId=test&action=unsubscribe");
httpClient.send(contentExchange);
contentExchange.waitForDone();
httpClient.stop();
ObjectName query = new ObjectName("org.apache.activemq:BrokerName=localhost,Type=Subscription,destinationType=Queue,destinationName=test,*");
Set<ObjectName> subs = broker.getManagementContext().queryNames(query, null);