Skip to content

Commit a291913

Browse files
author
Emile Joubert
committed
Merged stable into default
2 parents bf446db + 82339f9 commit a291913

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

test/src/com/rabbitmq/client/test/BrokerTestCase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ protected void declareDurableTopicExchange(String x) throws IOException {
237237
channel.exchangeDeclare(x, "topic", true);
238238
}
239239

240+
protected void declareTransientTopicExchange(String x) throws IOException {
241+
channel.exchangeDeclare(x, "topic", false);
242+
}
243+
240244
protected void deleteExchange(String x) throws IOException {
241245
channel.exchangeDelete(x);
242246
}

test/src/com/rabbitmq/client/test/functional/DurableOnTransient.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818
package com.rabbitmq.client.test.functional;
1919

20-
import com.rabbitmq.client.test.BrokerTestCase;
2120
import java.io.IOException;
2221

2322
import com.rabbitmq.client.GetResponse;
2423
import com.rabbitmq.client.MessageProperties;
24+
import com.rabbitmq.tools.Host;
2525

26-
public class DurableOnTransient extends BrokerTestCase
26+
public class DurableOnTransient extends ClusteredTestBase
2727
{
2828
protected static final String Q = "DurableQueue";
2929
protected static final String X = "TransientExchange";
@@ -61,4 +61,34 @@ public void testBindDurableToTransient()
6161
basicPublish();
6262
assertNotNull(basicGet());
6363
}
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+
}
6494
}

0 commit comments

Comments
 (0)