Skip to content

Commit 488c2ee

Browse files
Bring back a test that was accidentally deleted
1 parent ef393cb commit 488c2ee

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,19 @@ public void testThatDeletedQueueDoesNotReappearOnRecover() throws IOException, I
261261
}
262262
}
263263

264+
public void testThatCancelledConsumerDoesNotReappearOnRecover() throws IOException, InterruptedException {
265+
String q = UUID.randomUUID().toString();
266+
channel.queueDeclare(q, false, false, false, null);
267+
String tag = channel.basicConsume(q, new DefaultConsumer(channel));
268+
AMQP.Queue.DeclareOk ok1 = channel.queueDeclarePassive(q);
269+
assertEquals(1, ok1.getConsumerCount());
270+
channel.basicCancel(tag);
271+
closeAndWaitForRecovery();
272+
expectChannelRecovery(channel);
273+
AMQP.Queue.DeclareOk ok2 = channel.queueDeclarePassive(q);
274+
assertEquals(0, ok2.getConsumerCount());
275+
}
276+
264277
public void testConsumerRecoveryWithManyConsumers() throws IOException, InterruptedException {
265278
String q = channel.queueDeclare(UUID.randomUUID().toString(), false, false, false, null).getQueue();
266279
final int n = 1024;

0 commit comments

Comments
 (0)