|
17 | 17 |
|
18 | 18 | package com.rabbitmq.client.test.functional; |
19 | 19 |
|
20 | | -import com.rabbitmq.client.test.BrokerTestCase; |
21 | 20 | import java.io.IOException; |
22 | 21 |
|
23 | 22 | import com.rabbitmq.client.GetResponse; |
24 | 23 | import com.rabbitmq.client.MessageProperties; |
| 24 | +import com.rabbitmq.tools.Host; |
25 | 25 |
|
26 | | -public class DurableOnTransient extends BrokerTestCase |
| 26 | +public class DurableOnTransient extends ClusteredTestBase |
27 | 27 | { |
28 | 28 | protected static final String Q = "DurableQueue"; |
29 | 29 | protected static final String X = "TransientExchange"; |
@@ -61,4 +61,34 @@ public void testBindDurableToTransient() |
61 | 61 | basicPublish(); |
62 | 62 | assertNotNull(basicGet()); |
63 | 63 | } |
| 64 | + |
| 65 | + private void stopSecondary() throws IOException { |
| 66 | + Host.executeCommand("cd ../rabbitmq-test; make stop-secondary-app"); |
| 67 | + } |
| 68 | + |
| 69 | + private void startSecondary() throws IOException { |
| 70 | + Host.executeCommand("cd ../rabbitmq-test; make start-secondary-app"); |
| 71 | + } |
| 72 | + |
| 73 | + public void testSemiDurableBindingRemoval() throws IOException { |
| 74 | + if (clusteredConnection != null) { |
| 75 | + declareTransientTopicExchange("x"); |
| 76 | + clusteredChannel.queueDeclare("q", true, false, false, null); |
| 77 | + channel.queueBind("q", "x", "k"); |
| 78 | + |
| 79 | + stopSecondary(); |
| 80 | + |
| 81 | + deleteExchange("x"); |
| 82 | + |
| 83 | + startSecondary(); |
| 84 | + |
| 85 | + declareTransientTopicExchange("x"); |
| 86 | + |
| 87 | + basicPublishVolatile("x", "k"); |
| 88 | + assertDelivered("q", 0); |
| 89 | + |
| 90 | + deleteQueue("q"); |
| 91 | + deleteExchange("x"); |
| 92 | + } |
| 93 | + } |
64 | 94 | } |
0 commit comments