Skip to content

Commit 91db59e

Browse files
author
Alexandru Scvortov
committed
add test for confirms when queue.delete and queue.purge are used
1 parent 00c6636 commit 91db59e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,39 @@ public void testConfirmMultipleQueues()
127127
Thread.sleep(10);
128128
}
129129

130+
/* For testConfirmQueueDelete and testConfirmQueuePurge to be
131+
* relevant, the msg_store must not write the messages to disk
132+
* (thus causing a confirm). I'd manually comment out the line in
133+
* internal_sync that notifies the clients. */
134+
135+
public void testConfirmQueueDelete()
136+
throws IOException, InterruptedException
137+
{
138+
for (long i = 0; i < NUM_MESSAGES; i++) {
139+
publish("confirm-test-noconsumer", true, false, false);
140+
ackSet.add(i);
141+
}
142+
143+
channel.queueDelete("confirm-test-noconsumer");
144+
145+
while (ackSet.size() > 0)
146+
Thread.sleep(10);
147+
}
148+
149+
public void testConfirmQueuePurge()
150+
throws IOException, InterruptedException
151+
{
152+
for (long i = 0; i < NUM_MESSAGES; i++) {
153+
publish("confirm-test-noconsumer", true, false, false);
154+
ackSet.add(i);
155+
}
156+
157+
channel.queuePurge("confirm-test-noconsumer");
158+
159+
while (ackSet.size() > 0)
160+
Thread.sleep(10);
161+
}
162+
130163
/* Publish NUM_MESSAGES persistent messages and wait for
131164
* confirmations. */
132165
public void confirmTest(String queueName, boolean persistent,

0 commit comments

Comments
 (0)