Write correct arraySize for real arrays.
1.1 --- a/src/com/rabbitmq/client/impl/ValueWriter.java Wed Feb 01 17:33:38 2012 +0000
1.2 +++ b/src/com/rabbitmq/client/impl/ValueWriter.java Thu Feb 02 11:39:32 2012 +0000
1.3 @@ -231,7 +231,7 @@
1.4 out.write(0);
1.5 }
1.6 else {
1.7 - out.writeInt(value.length);
1.8 + out.writeInt((int)Frame.arraySize(value));
1.9 for (Object item : value) {
1.10 writeFieldValue(item);
1.11 }
2.1 --- a/test/src/com/rabbitmq/client/test/functional/QueueLifecycle.java Wed Feb 01 17:33:38 2012 +0000
2.2 +++ b/test/src/com/rabbitmq/client/test/functional/QueueLifecycle.java Thu Feb 02 11:39:32 2012 +0000
2.3 @@ -158,13 +158,13 @@
2.4 verifyQueueMissing(name);
2.5 }
2.6
2.7 - public void testArgumentArrays() throws Exception {
2.8 + public void testArgumentArrays() throws IOException {
2.9 Map<String, Object> args = new HashMap<String, Object>();
2.10 - args.put("my-key", new String[]{"foo", "bar", "baz"});
2.11 + String[] arr = new String[]{"foo", "bar", "baz"};
2.12 + args.put("my-key", arr);
2.13 +// args.put("my-key", Arrays.asList(arr));
2.14 String queueName = "argumentArraysQueue";
2.15 channel.queueDeclare(queueName, true, true, false, args).getQueue();
2.16 - args = new HashMap<String, Object>();
2.17 - args.put("my-key", Arrays.asList(new String[]{"foo", "bar", "baz"}));
2.18 verifyQueueExists(queueName);
2.19 }
2.20 }