diff options
| author | Robert Gemmell <robbie@apache.org> | 2010-02-25 17:19:14 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2010-02-25 17:19:14 +0000 |
| commit | a9e5b38bd87e2be022914662f5bb47430ce69d18 (patch) | |
| tree | bd5c6e0b569420c8b7a75f957c563a7f304a7bf3 /qpid/java | |
| parent | dec6fd80f87b4204e193fdda108939d43a348092 (diff) | |
| download | qpid-python-a9e5b38bd87e2be022914662f5bb47430ce69d18.tar.gz | |
QPID-2417: add a test that restarts the broker at the end to validate the store if it is persistent
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@916359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java index 59c37f6b71..91bb5d2529 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java @@ -118,12 +118,23 @@ public class DurableSubscriptionTest extends QpidTestCase public void testDurabilityNOACK() throws Exception { - durabilityImpl(AMQSession.NO_ACKNOWLEDGE); + durabilityImpl(AMQSession.NO_ACKNOWLEDGE, false); } public void testDurabilityAUTOACK() throws Exception { - durabilityImpl(Session.AUTO_ACKNOWLEDGE); + durabilityImpl(Session.AUTO_ACKNOWLEDGE, false); + } + + public void testDurabilityAUTOACKwithRestartIfPersistent() throws Exception + { + if(!isBrokerStorePersistent()) + { + System.out.println("The broker store is not persistent, skipping this test."); + return; + } + + durabilityImpl(Session.AUTO_ACKNOWLEDGE, true); } public void testDurabilityNOACKSessionPerConnection() throws Exception @@ -136,8 +147,8 @@ public class DurableSubscriptionTest extends QpidTestCase durabilityImplSessionPerConnection(Session.AUTO_ACKNOWLEDGE); } - private void durabilityImpl(int ackMode) throws Exception - { + private void durabilityImpl(int ackMode, boolean restartBroker) throws Exception + { AMQConnection con = (AMQConnection) getConnection("guest", "guest"); AMQTopic topic = new AMQTopic(con, "MyTopic"); Session session1 = con.createSession(false, ackMode); @@ -225,6 +236,18 @@ public class DurableSubscriptionTest extends QpidTestCase session3.unsubscribe("MySubscription"); con.close(); + + if(restartBroker) + { + try + { + restartBroker(); + } + catch (Exception e) + { + fail("Error restarting the broker"); + } + } } private void durabilityImplSessionPerConnection(int ackMode) throws Exception |
