|
18 | 18 | package com.rabbitmq.client.test.functional; |
19 | 19 |
|
20 | 20 | import java.io.IOException; |
| 21 | +import java.util.Arrays; |
21 | 22 | import java.util.HashMap; |
22 | 23 | import java.util.Map; |
23 | 24 |
|
24 | 25 | import com.rabbitmq.client.AMQP; |
25 | 26 | import com.rabbitmq.client.QueueingConsumer; |
26 | 27 | import com.rabbitmq.client.test.BrokerTestCase; |
27 | 28 |
|
28 | | -// Test queue auto-delete and exclusive semantics. |
| 29 | +/** |
| 30 | + * Test queue auto-delete and exclusive semantics. |
| 31 | + */ |
29 | 32 | public class QueueLifecycle extends BrokerTestCase { |
30 | 33 |
|
31 | 34 | void verifyQueueExists(String name) throws IOException { |
@@ -77,12 +80,13 @@ void verifyNotEquivalent(boolean durable, boolean exclusive, |
77 | 80 | fail("Queue.declare should have been rejected as not equivalent"); |
78 | 81 | } |
79 | 82 |
|
80 | | - // From amqp-0-9-1.xml, for "passive" property, "equivalent" rule: |
81 | | - // "If not set and the queue exists, the server MUST check that the |
82 | | - // existing queue has the same values for durable, exclusive, |
83 | | - // auto-delete, and arguments fields. The server MUST respond with |
84 | | - // Declare-Ok if the requested queue matches these fields, and MUST |
85 | | - // raise a channel exception if not." |
| 83 | + /** From amqp-0-9-1.xml, for "passive" property, "equivalent" rule: |
| 84 | + * "If not set and the queue exists, the server MUST check that the |
| 85 | + * existing queue has the same values for durable, exclusive, |
| 86 | + * auto-delete, and arguments fields. The server MUST respond with |
| 87 | + * Declare-Ok if the requested queue matches these fields, and MUST |
| 88 | + * raise a channel exception if not." |
| 89 | + */ |
86 | 90 | public void testQueueEquivalence() throws IOException { |
87 | 91 | String q = "queue"; |
88 | 92 | channel.queueDeclare(q, false, false, false, null); |
@@ -154,4 +158,13 @@ public void testExclusiveGoesWithConnection() throws IOException { |
154 | 158 | verifyQueueMissing(name); |
155 | 159 | } |
156 | 160 |
|
| 161 | + public void testArgumentArrays() throws Exception { |
| 162 | + Map<String, Object> args = new HashMap<String, Object>(); |
| 163 | + args.put("my-key", new String[]{"foo", "bar", "baz"}); |
| 164 | + String queueName = "argumentArraysQueue"; |
| 165 | + channel.queueDeclare(queueName, true, true, false, args).getQueue(); |
| 166 | + args = new HashMap<String, Object>(); |
| 167 | + args.put("my-key", Arrays.asList(new String[]{"foo", "bar", "baz"})); |
| 168 | + verifyQueueExists(queueName); |
| 169 | + } |
157 | 170 | } |
0 commit comments