@@ -206,7 +206,6 @@ protected void testClientNamedQueueRecoveryWith(String q, boolean noWait) throws
206206 ch .queueDelete (q );
207207 }
208208
209- // bug 26364
210209 public void testDeclarationOfManyAutoDeleteQueuesWithTransientConsumer () throws IOException {
211210 Channel ch = connection .createChannel ();
212211 assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedQueues ().size ());
@@ -221,8 +220,7 @@ public void testDeclarationOfManyAutoDeleteQueuesWithTransientConsumer() throws
221220 ch .close ();
222221 }
223222
224- // bug 26364
225- public void testDeclarationofManyAutoDeleteExchangesWithTransientQueues () throws IOException {
223+ public void testDeclarationofManyAutoDeleteExchangesWithTransientQueuesThatAreUnbound () throws IOException {
226224 Channel ch = connection .createChannel ();
227225 assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedExchanges ().size ());
228226 for (int i = 0 ; i < 5000 ; i ++) {
@@ -238,6 +236,52 @@ public void testDeclarationofManyAutoDeleteExchangesWithTransientQueues() throws
238236 ch .close ();
239237 }
240238
239+ public void testDeclarationofManyAutoDeleteExchangesWithTransientQueuesThatAreDeleted () throws IOException {
240+ Channel ch = connection .createChannel ();
241+ assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedExchanges ().size ());
242+ for (int i = 0 ; i < 5000 ; i ++) {
243+ String x = UUID .randomUUID ().toString ();
244+ ch .exchangeDeclare (x , "fanout" , false , true , null );
245+ String q = ch .queueDeclare ().getQueue ();
246+ ch .queueBind (q , x , "doesn't matter" );
247+ ch .queueDelete (q );
248+ }
249+ assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedExchanges ().size ());
250+ ch .close ();
251+ }
252+
253+ public void testDeclarationofManyAutoDeleteExchangesWithTransientExchangesThatAreUnbound () throws IOException {
254+ Channel ch = connection .createChannel ();
255+ assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedExchanges ().size ());
256+ for (int i = 0 ; i < 5000 ; i ++) {
257+ String src = UUID .randomUUID ().toString ();
258+ String dest = UUID .randomUUID ().toString ();
259+ ch .exchangeDeclare (src , "fanout" , false , true , null );
260+ ch .exchangeDeclare (dest , "fanout" , false , true , null );
261+ final String rk = "doesn't matter" ;
262+ ch .exchangeBind (dest , src , rk );
263+ ch .exchangeUnbind (dest , src , rk );
264+ ch .exchangeDelete (dest );
265+ }
266+ assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedExchanges ().size ());
267+ ch .close ();
268+ }
269+
270+ public void testDeclarationofManyAutoDeleteExchangesWithTransientExchangesThatAreDeleted () throws IOException {
271+ Channel ch = connection .createChannel ();
272+ assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedExchanges ().size ());
273+ for (int i = 0 ; i < 100 ; i ++) {
274+ String src = "src-" + UUID .randomUUID ().toString ();
275+ String dest = "dest-" + UUID .randomUUID ().toString ();
276+ ch .exchangeDeclare (src , "fanout" , false , true , null );
277+ ch .exchangeDeclare (dest , "fanout" , false , true , null );
278+ ch .exchangeBind (dest , src , "doesn't matter" );
279+ ch .exchangeDelete (dest );
280+ }
281+ assertEquals (0 , ((AutorecoveringConnection )connection ).getRecordedExchanges ().size ());
282+ ch .close ();
283+ }
284+
241285 public void testServerNamedQueueRecovery () throws IOException , InterruptedException {
242286 String q = channel .queueDeclare ("" , false , false , false , null ).getQueue ();
243287 String x = "amq.fanout" ;
0 commit comments