mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-2665 - refactoring the test a bit
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1360088 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e66967bff1
commit
ac64a722c1
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue