Skip to content

Commit 8727dc5

Browse files
committed
nuke 'immediate' from tests
since we are dropping it from the broker we will keep it in the API though
1 parent 3ee465b commit 8727dc5

File tree

3 files changed

+31
-65
lines changed

3 files changed

+31
-65
lines changed

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,36 +139,35 @@ protected void checkGet(boolean[] expected) throws IOException {
139139
*
140140
* @param key the routing key of the message to be sent
141141
* @param mandatory whether the message should be marked as 'mandatory'
142-
* @param immediate whether the message should be marked as 'immediate'
143142
* @param expected indicates which queues we expect the message to
144143
* get routed to
145144
* @param ret whether a 'basic.return' is expected
146145
*
147146
* @see #checkGet(boolean[])
148147
*/
149-
protected void check(String key, boolean mandatory, boolean immediate,
150-
boolean[] expected, boolean ret)
148+
protected void check(String key, boolean mandatory, boolean[] expected,
149+
boolean ret)
151150
throws IOException {
152151

153152
gotReturn.set(false);
154-
channel.basicPublish("x", key, mandatory, immediate, null,
153+
channel.basicPublish("x", key, mandatory, false, null,
155154
"ae-test".getBytes());
156155
checkGet(expected);
157156
assertEquals(ret, gotReturn.get());
158157
}
159158

160159
protected void check(String key, boolean[] expected, boolean ret)
161160
throws IOException {
162-
check(key, false, false, expected, ret);
161+
check(key, false, expected, ret);
163162
}
164163

165-
protected void check(String key, boolean mandatory, boolean immediate,
166-
boolean ret) throws IOException {
167-
check(key, mandatory, immediate, expected(key), ret);
164+
protected void check(String key, boolean mandatory, boolean ret)
165+
throws IOException {
166+
check(key, mandatory, expected(key), ret);
168167
}
169168

170169
protected void check(String key, boolean ret) throws IOException {
171-
check(key, false, false, ret);
170+
check(key, false, ret);
172171
}
173172

174173
/**
@@ -198,9 +197,7 @@ public void testAe() throws IOException {
198197
//ordinary
199198
check(k, false);
200199
//mandatory
201-
check(k, true, false, k.equals("z"));
202-
//immediate
203-
check(k, false, true, unrouted, true);
200+
check(k, true, k.equals("z"));
204201
}
205202

206203
cleanup();

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

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -60,45 +60,34 @@ protected void setUp() throws IOException {
6060
"confirm-multiple-queues");
6161
}
6262

63-
public void testPersistentMandatoryImmediateCombinations()
63+
public void testPersistentMandatoryCombinations()
6464
throws IOException, InterruptedException
6565
{
6666
boolean b[] = { false, true };
6767
for (boolean persistent : b) {
6868
for (boolean mandatory : b) {
69-
for (boolean immediate : b) {
70-
confirmTest("", "confirm-test",
71-
persistent, mandatory, immediate);
72-
}
69+
confirmTest("", "confirm-test", persistent, mandatory);
7370
}
7471
}
7572
}
7673

7774
public void testNonDurable()
7875
throws IOException, InterruptedException
7976
{
80-
confirmTest("", "confirm-test-nondurable", true, false, false);
81-
}
82-
83-
public void testImmediateNoConsumer()
84-
throws IOException, InterruptedException
85-
{
86-
confirmTest("", "confirm-test-noconsumer", false, false, true);
87-
confirmTest("", "confirm-test-noconsumer", true, false, true);
77+
confirmTest("", "confirm-test-nondurable", true, false);
8878
}
8979

9080
public void testMandatoryNoRoute()
9181
throws IOException, InterruptedException
9282
{
93-
confirmTest("", "confirm-test-doesnotexist", false, true, false);
94-
confirmTest("", "confirm-test-doesnotexist", true, true, false);
83+
confirmTest("", "confirm-test-doesnotexist", false, true);
84+
confirmTest("", "confirm-test-doesnotexist", true, true);
9585
}
9686

9787
public void testMultipleQueues()
9888
throws IOException, InterruptedException
9989
{
100-
confirmTest("amq.direct", "confirm-multiple-queues",
101-
true, false, false);
90+
confirmTest("amq.direct", "confirm-multiple-queues", true, false);
10291
}
10392

10493
/* For testQueueDelete and testQueuePurge to be
@@ -109,7 +98,7 @@ public void testMultipleQueues()
10998
public void testQueueDelete()
11099
throws IOException, InterruptedException
111100
{
112-
publishN("","confirm-test-noconsumer", true, false, false);
101+
publishN("","confirm-test-noconsumer", true, false);
113102

114103
channel.queueDelete("confirm-test-noconsumer");
115104

@@ -119,7 +108,7 @@ public void testQueueDelete()
119108
public void testQueuePurge()
120109
throws IOException, InterruptedException
121110
{
122-
publishN("", "confirm-test-noconsumer", true, false, false);
111+
publishN("", "confirm-test-noconsumer", true, false);
123112

124113
channel.queuePurge("confirm-test-noconsumer");
125114

@@ -142,7 +131,7 @@ public void testQueueTTL()
142131
Collections.singletonMap(TTL_ARG, (Object)ttl);
143132
channel.queueDeclare("confirm-ttl", true, true, false, argMap);
144133

145-
publishN("", "confirm-ttl", true, false, false);
134+
publishN("", "confirm-ttl", true, false);
146135
channel.waitForConfirmsOrDie();
147136

148137
channel.queueDelete("confirm-ttl");
@@ -166,7 +155,7 @@ public void testBasicRejectRequeue()
166155
public void testBasicRecover()
167156
throws IOException, InterruptedException
168157
{
169-
publishN("", "confirm-test-noconsumer", true, false, false);
158+
publishN("", "confirm-test-noconsumer", true, false);
170159

171160
for (long i = 0; i < NUM_MESSAGES; i++) {
172161
GetResponse resp =
@@ -231,7 +220,7 @@ public void handleNack(long seqNo, boolean multiple) {
231220

232221
for (long i = 0; i < NUM_MESSAGES; i++) {
233222
unconfirmedSet.add(channel.getNextPublishSeqNo());
234-
publish("", "confirm-test", true, false, false);
223+
publish("", "confirm-test", true, false);
235224
}
236225

237226
channel.waitForConfirmsOrDie();
@@ -245,14 +234,14 @@ public void testWaitForConfirmsNoOp()
245234
{
246235
channel = connection.createChannel();
247236
// Don't enable Confirm mode
248-
publish("", "confirm-test", true, false, false);
237+
publish("", "confirm-test", true, false);
249238
channel.waitForConfirmsOrDie(); // Nop
250239
}
251240

252241
public void testWaitForConfirmsException()
253242
throws IOException, InterruptedException
254243
{
255-
publishN("", "confirm-test", true, false, false);
244+
publishN("", "confirm-test", true, false);
256245
channel.close();
257246
try {
258247
channel.waitForConfirmsOrDie();
@@ -268,29 +257,27 @@ public void testWaitForConfirmsException()
268257

269258
/* Publish NUM_MESSAGES messages and wait for confirmations. */
270259
public void confirmTest(String exchange, String queueName,
271-
boolean persistent, boolean mandatory,
272-
boolean immediate)
260+
boolean persistent, boolean mandatory)
273261
throws IOException, InterruptedException
274262
{
275-
publishN(exchange, queueName, persistent, mandatory, immediate);
263+
publishN(exchange, queueName, persistent, mandatory);
276264

277265
channel.waitForConfirmsOrDie();
278266
}
279267

280268
private void publishN(String exchangeName, String queueName,
281-
boolean persistent, boolean mandatory,
282-
boolean immediate)
269+
boolean persistent, boolean mandatory)
283270
throws IOException
284271
{
285272
for (long i = 0; i < NUM_MESSAGES; i++) {
286-
publish(exchangeName, queueName, persistent, mandatory, immediate);
273+
publish(exchangeName, queueName, persistent, mandatory);
287274
}
288275
}
289276

290277
private void basicRejectCommon(boolean requeue)
291278
throws IOException
292279
{
293-
publishN("", "confirm-test-noconsumer", true, false, false);
280+
publishN("", "confirm-test-noconsumer", true, false);
294281

295282
for (long i = 0; i < NUM_MESSAGES; i++) {
296283
GetResponse resp =
@@ -301,10 +288,9 @@ private void basicRejectCommon(boolean requeue)
301288
}
302289

303290
protected void publish(String exchangeName, String queueName,
304-
boolean persistent, boolean mandatory,
305-
boolean immediate)
291+
boolean persistent, boolean mandatory)
306292
throws IOException {
307-
channel.basicPublish(exchangeName, queueName, mandatory, immediate,
293+
channel.basicPublish(exchangeName, queueName, mandatory, false,
308294
persistent ? MessageProperties.PERSISTENT_BASIC
309295
: MessageProperties.BASIC,
310296
"nop".getBytes());

test/src/com/rabbitmq/examples/TestMain.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public void doBasicReturn(BlockingCell<Object> cell, int expectedCode) {
450450
}
451451

452452
public void tryBasicReturn() throws IOException {
453-
log("About to try mandatory/immediate publications");
453+
log("About to try mandatory publications");
454454

455455
String mx = "mandatoryTestExchange";
456456
_ch1.exchangeDeclare(mx, "fanout", false, true, null);
@@ -461,24 +461,12 @@ public void tryBasicReturn() throws IOException {
461461
_ch1.basicPublish(mx, "", true, false, null, "one".getBytes());
462462
doBasicReturn(returnCell, AMQP.NO_ROUTE);
463463

464-
returnCell = new BlockingCell<Object>();
465-
_ch1.basicPublish(mx, "", true, true, null, "two".getBytes());
466-
doBasicReturn(returnCell, AMQP.NO_ROUTE);
467-
468-
returnCell = new BlockingCell<Object>();
469-
_ch1.basicPublish(mx, "", false, true, null, "three".getBytes());
470-
doBasicReturn(returnCell, AMQP.NO_CONSUMERS);
471-
472464
String mq = "mandatoryTestQueue";
473465
_ch1.queueDeclare(mq, false, false, true, null);
474466
_ch1.queueBind(mq, mx, "");
475467

476468
returnCell = new BlockingCell<Object>();
477-
_ch1.basicPublish(mx, "", true, true, null, "four".getBytes());
478-
doBasicReturn(returnCell, AMQP.NO_CONSUMERS);
479-
480-
returnCell = new BlockingCell<Object>();
481-
_ch1.basicPublish(mx, "", true, false, null, "five".getBytes());
469+
_ch1.basicPublish(mx, "", true, false, null, "two".getBytes());
482470
drain(1, mq, true);
483471
_ch1.queueDelete(mq, true, true);
484472

@@ -519,11 +507,6 @@ public void tryTransaction(String queueName) throws IOException {
519507
_ch1.txCommit();
520508
doBasicReturn(returnCell, AMQP.NO_ROUTE);
521509
returnCell = new BlockingCell<Object>();
522-
_ch1.basicPublish("", "bogus", false, true, null, "immediate".getBytes());
523-
_ch1.txCommit();
524-
doBasicReturn(returnCell, AMQP.NO_CONSUMERS);
525-
returnCell = new BlockingCell<Object>();
526-
_ch1.txCommit();
527510
expect(2, drain(10, queueName, false));
528511

529512
unsetChannelReturnListener();

0 commit comments

Comments
 (0)