Skip to content

Commit a3ee0f4

Browse files
More test cases for queue.declare
1 parent ec68e4a commit a3ee0f4

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

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

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717

1818
package com.rabbitmq.client.test.functional;
1919

20+
import com.rabbitmq.client.AMQP;
21+
import com.rabbitmq.client.QueueingConsumer;
22+
import com.rabbitmq.client.test.BrokerTestCase;
23+
2024
import java.io.IOException;
21-
import java.util.Arrays;
2225
import java.util.HashMap;
2326
import java.util.Map;
2427
import java.util.concurrent.TimeoutException;
2528

26-
import com.rabbitmq.client.AMQP;
27-
import com.rabbitmq.client.QueueingConsumer;
28-
import com.rabbitmq.client.test.BrokerTestCase;
29-
3029
/**
3130
* Test queue auto-delete and exclusive semantics.
3231
*/
@@ -177,4 +176,26 @@ public void testQueueNamesLongerThan255Characters() throws IOException {
177176
// expected
178177
}
179178
}
179+
180+
public void testSingleLineFeedStrippedFromQueueName() throws IOException {
181+
channel.queueDeclare("que\nue_test", false, false, true, null);
182+
verifyQueue(NAME_STRIPPED, false, false, true, null);
183+
}
184+
185+
public void testMultipleLineFeedsStrippedFromQueueName() throws IOException {
186+
channel.queueDeclare("que\nue_\ntest\n", false, false, true, null);
187+
verifyQueue(NAME_STRIPPED, false, false, true, null);
188+
}
189+
190+
public void testMultipleLineFeedAndCarriageReturnsStrippedFromQueueName() throws IOException {
191+
channel.queueDeclare("q\ru\ne\r\nue_\ntest\n\r", false, false, true, null);
192+
verifyQueue(NAME_STRIPPED, false, false, true, null);
193+
}
194+
195+
static final String NAME_STRIPPED = "queue_test";
196+
197+
@Override
198+
protected void releaseResources() throws IOException {
199+
channel.queueDelete(NAME_STRIPPED);
200+
}
180201
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy