Skip to content

Commit 54dec16

Browse files
author
Simon MacMullen
committed
Move test into QosTests and make it resemble the others more.
1 parent 481cb90 commit 54dec16

File tree

3 files changed

+16
-30
lines changed

3 files changed

+16
-30
lines changed

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

Lines changed: 0 additions & 28 deletions
This file was deleted.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ public static TestSuite suite() {
6767
suite.addTestSuite(UnbindAutoDeleteExchange.class);
6868
suite.addTestSuite(RecoverAfterCancel.class);
6969
suite.addTestSuite(UnexpectedFrames.class);
70-
suite.addTestSuite(ChannelFlowNoConsumersTest.class);
7170
return suite;
7271
}
7372
}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
package com.rabbitmq.client.test.functional;
3333

34+
import com.rabbitmq.client.DefaultConsumer;
3435
import com.rabbitmq.client.test.BrokerTestCase;
3536
import java.io.IOException;
3637
import java.util.ArrayList;
@@ -372,6 +373,15 @@ public void testFlow() throws IOException
372373
drain(c, 1);
373374
}
374375

376+
public void testNoConsumers() throws Exception {
377+
String q = declareBind(channel);
378+
fill(1);
379+
channel.flow(false);
380+
QueueingConsumer c = new QueueingConsumer(channel);
381+
channel.basicConsume(q, c);
382+
drain(c, 0);
383+
}
384+
375385
protected void runLimitTests(int limit,
376386
boolean multiAck,
377387
boolean txMode,
@@ -480,10 +490,15 @@ protected String declareBindConsume(Channel ch,
480490
boolean noAck)
481491
throws IOException
482492
{
493+
String queue = declareBind(ch);
494+
ch.basicConsume(queue, noAck, c);
495+
return queue;
496+
}
497+
498+
protected String declareBind(Channel ch) throws IOException {
483499
AMQP.Queue.DeclareOk ok = ch.queueDeclare();
484500
String queue = ok.getQueue();
485501
ch.queueBind(queue, "amq.fanout", "");
486-
ch.basicConsume(queue, noAck, c);
487502
return queue;
488503
}
489504

0 commit comments

Comments
 (0)