Skip to content

Commit 7886764

Browse files
author
Matthias Radestock
committed
test transition from limited to unlimited
1 parent a5602bf commit 7886764

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

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

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,7 @@ public void testLimitIncrease()
176176
throws IOException
177177
{
178178
QueueingConsumer c = new QueueingConsumer(channel);
179-
channel.basicQos(1);
180-
declareBindConsume(c);
181-
fill(3);
182-
drain(c, 1);
179+
configure(c, 1, 3);
183180
channel.basicQos(2);
184181
drain(c, 1);
185182
}
@@ -188,16 +185,22 @@ public void testLimitDecrease()
188185
throws IOException
189186
{
190187
QueueingConsumer c = new QueueingConsumer(channel);
191-
channel.basicQos(2);
192-
declareBindConsume(c);
193-
fill(4);
194-
Queue<Delivery> d = drain(c, 2);
188+
Queue<Delivery> d = configure(c, 2, 4);
195189
channel.basicQos(1);
196190
drain(c, 0);
197191
ack(d, true);
198192
drain(c, 1);
199193
}
200194

195+
public void testLimitedToUnlimited()
196+
throws IOException
197+
{
198+
QueueingConsumer c = new QueueingConsumer(channel);
199+
configure(c, 1, 3);
200+
channel.basicQos(0);
201+
drain(c, 2);
202+
}
203+
201204
protected void runLimitTests(int limit,
202205
boolean multiAck,
203206
boolean txMode,
@@ -284,6 +287,17 @@ protected List<String> configure(QueueingConsumer c,
284287
return queues;
285288
}
286289

290+
protected Queue<Delivery> configure(QueueingConsumer c,
291+
int limit,
292+
int messages)
293+
throws IOException
294+
{
295+
channel.basicQos(limit);
296+
declareBindConsume(c);
297+
fill(messages);
298+
return drain(c, limit);
299+
}
300+
287301
protected String declareBindConsume(QueueingConsumer c)
288302
throws IOException
289303
{

0 commit comments

Comments
 (0)