Skip to content

Commit f599879

Browse files
author
Matthew Sackman
committed
Added one further test: The bindings are arranged in a different order. As a result, we get to A first directly from C, thus the lookup for A will work, and A isn't deleted. Then we later come back to A from C via B, thus the lookup for A still works, and then A is deleted. Hence we hit the bottom case of rabbit_binding:anything_but/3
1 parent c1d230d commit f599879

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,18 @@ public void testRepeatedTargetAutoDelete() throws IOException {
113113
assertExchangesNotExist(exchanges);
114114
assertExchangeNotExists("Source");
115115
}
116+
117+
/*
118+
* build (A -> B) (B -> C) (A -> C). Delete C and they should all vanish
119+
*/
120+
public void testAutoDeleteBindingToVanishedExchange() throws IOException {
121+
String[] exchanges = new String[] {"A", "B", "C"};
122+
declareExchanges(exchanges);
123+
channel.exchangeBind("C", "B", "");
124+
channel.exchangeBind("B", "A", "");
125+
channel.exchangeBind("C", "A", "");
126+
channel.exchangeDelete("C");
127+
assertExchangesNotExist(exchanges);
128+
}
116129

117130
}

0 commit comments

Comments
 (0)