git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1360088 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-07-11 09:45:32 +00:00
parent e66967bff1
commit ac64a722c1
1 changed files with 2 additions and 25 deletions

View File

@ -90,7 +90,7 @@ public class DurableSubscriptionActivationTest extends org.apache.activemq.TestS
} }
} }
public void testActivateWithExistingTopic1() throws Exception { public void testActivateWithExistingTopic() throws Exception {
// create durable subscription // create durable subscription
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
session.createDurableSubscriber(topic, "SubsId"); session.createDurableSubscriber(topic, "SubsId");
@ -101,36 +101,13 @@ public class DurableSubscriptionActivationTest extends org.apache.activemq.TestS
// restart the broker // restart the broker
restartBroker(); restartBroker();
// activate d = broker.getDestination(topic);
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
session.createDurableSubscriber(topic, "SubsId");
assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size() == 1); assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size() == 1);
// re-activate
connection.close();
connection = createConnection();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
session.createDurableSubscriber(topic, "SubsId");
assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size() == 1);
}
public void testActivateWithExistingTopic2() throws Exception {
// create durable subscription
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
session.createDurableSubscriber(topic, "SubsId");
// restart the broker
restartBroker();
Destination d1 = broker.getDestination(topic);
// activate // activate
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
session.createDurableSubscriber(topic, "SubsId"); session.createDurableSubscriber(topic, "SubsId");
Destination d = broker.getDestination(topic);
assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size() == 1); assertTrue("More than one consumer found: " + d.getConsumers().size(), d.getConsumers().size() == 1);
// re-activate // re-activate