Skip to content

Commit 6a7dd42

Browse files
author
Matthew Sackman
committed
Make the Java test the same as the .Net test
1 parent 05c084c commit 6a7dd42

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

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

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ public class ConsumerCancelNotificiation extends BrokerTestCase {
3030

3131
private boolean notified = false;
3232

33-
private void assertNotified(boolean expected, boolean wait) {
34-
synchronized (lock) {
35-
if (wait && (expected != notified)) {
36-
try {
37-
lock.wait();
38-
} catch (InterruptedException e) {
39-
}
40-
}
41-
assertEquals(notified, expected);
42-
}
43-
}
44-
4533
public void testConsumerCancellationNotification() throws IOException {
4634
channel.queueDeclare(queue, false, true, false, null);
4735
Consumer consumer = new QueueingConsumer(channel) {
@@ -54,8 +42,15 @@ public void handleCancel(String consumerTag) throws IOException {
5442
}
5543
};
5644
channel.basicConsume(queue, consumer);
57-
assertNotified(false, false);
5845
channel.queueDelete(queue);
59-
assertNotified(true, true);
46+
synchronized (lock) {
47+
if (!notified) {
48+
try {
49+
lock.wait();
50+
} catch (InterruptedException e) {
51+
}
52+
}
53+
assertTrue(notified);
54+
}
6055
}
6156
}

0 commit comments

Comments
 (0)