|
17 | 17 |
|
18 | 18 | package com.rabbitmq.client.test.functional;
|
19 | 19 |
|
| 20 | +import com.rabbitmq.client.AMQP; |
| 21 | +import com.rabbitmq.client.QueueingConsumer; |
| 22 | +import com.rabbitmq.client.test.BrokerTestCase; |
| 23 | + |
20 | 24 | import java.io.IOException;
|
21 |
| -import java.util.Arrays; |
22 | 25 | import java.util.HashMap;
|
23 | 26 | import java.util.Map;
|
24 | 27 | import java.util.concurrent.TimeoutException;
|
25 | 28 |
|
26 |
| -import com.rabbitmq.client.AMQP; |
27 |
| -import com.rabbitmq.client.QueueingConsumer; |
28 |
| -import com.rabbitmq.client.test.BrokerTestCase; |
29 |
| - |
30 | 29 | /**
|
31 | 30 | * Test queue auto-delete and exclusive semantics.
|
32 | 31 | */
|
@@ -177,4 +176,26 @@ public void testQueueNamesLongerThan255Characters() throws IOException {
|
177 | 176 | // expected
|
178 | 177 | }
|
179 | 178 | }
|
| 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 | + } |
180 | 201 | }
|
0 commit comments