Skip to content

Commit 59ed27f

Browse files
author
Matthew Sackman
committed
Merging bug 22918 into default
2 parents b42f848 + 1105ad5 commit 59ed27f

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public static TestSuite suite() {
6161
suite.addTestSuite(InvalidAcks.class);
6262
suite.addTestSuite(InvalidAcksTx.class);
6363
suite.addTestSuite(BindToDefaultExchange.class);
64+
suite.addTestSuite(UnbindAutoDeleteExchange.class);
6465
return suite;
6566
}
6667
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.rabbitmq.client.test.functional;
2+
3+
import com.rabbitmq.client.AMQP;
4+
import com.rabbitmq.client.test.BrokerTestCase;
5+
6+
import java.io.IOException;
7+
8+
/**
9+
* Test that unbinding from an auto-delete exchange causes the exchange to go
10+
* away
11+
*/
12+
public class UnbindAutoDeleteExchange extends BrokerTestCase {
13+
public void testUnbind() throws IOException, InterruptedException {
14+
String exchange = "myexchange";
15+
channel.exchangeDeclare(exchange, "fanout", false, true, null);
16+
String queue = channel.queueDeclare().getQueue();
17+
channel.queueBind(queue, exchange, "");
18+
channel.queueUnbind(queue, exchange, "");
19+
20+
try {
21+
channel.exchangeDeclarePassive(exchange);
22+
fail("exchange should no longer be there");
23+
}
24+
catch (IOException e) {
25+
checkShutdownSignal(AMQP.NOT_FOUND, e);
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)