Skip to content

Commit 8928b2b

Browse files
author
Simon MacMullen
committed
Simpler Java tests without refactoring to remove duplication.
1 parent d872072 commit 8928b2b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/src/com/rabbitmq/client/test/server/DurableBindingLifecycle.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ protected void restart() throws IOException {
4646

4747
Host.executeCommand("cd ../rabbitmq-test; make restart-secondary-node");
4848
}
49+
restartPrimary();
50+
}
51+
52+
private void restartPrimary() throws IOException {
4953
tearDown();
5054
Host.executeCommand("cd ../rabbitmq-test; make restart-app");
5155
setUp();
@@ -129,5 +133,24 @@ public void testDefaultBindingRecovery() throws IOException {
129133
deleteQueue(Q);
130134
}
131135

136+
/**
137+
* Test that when we have a transient exchange bound to a durable queue and the
138+
* durable queue is on a cluster node that restarts, we do not lose the binding.
139+
* See bug 24009.
140+
*/
141+
public void testTransientExchangeDurableQueue() throws IOException {
142+
// This test depends on the second node in the cluster to keep the transient X alive
143+
if (clusteredChannel != null) {
144+
channel.exchangeDeclare("transientX", "fanout", false);
145+
declareAndBindDurableQueue("durableQ", "transientX", "");
146+
147+
restartPrimary();
148+
149+
basicPublishVolatile("transientX", "");
150+
assertDelivered("durableQ", 1);
132151

152+
deleteExchange("transientX");
153+
deleteQueue("durableQ");
154+
}
155+
}
133156
}

0 commit comments

Comments
 (0)