ARTEMIS-1009 Fixing Management test

This commit is contained in:
Clebert Suconic 2017-03-09 19:14:59 -05:00
parent 0b1e48a7f4
commit ed1d4c0948
2 changed files with 2 additions and 32 deletions

View File

@ -145,11 +145,6 @@ public final class OpenTypeSupport {
rc.put(CompositeDataConstants.PRIORITY, m.getPriority());
rc.put(CompositeDataConstants.REDELIVERED, ref.getDeliveryCount() > 1);
ActiveMQBuffer bodyCopy = m.getReadOnlyBodyBuffer();
byte[] bytes = new byte[bodyCopy.readableBytes()];
bodyCopy.readBytes(bytes);
rc.put(CompositeDataConstants.BODY, bytes);
Map<String, Object> propertyMap = m.toPropertyMap();
rc.put(CompositeDataConstants.PROPERTIES, "" + propertyMap);

View File

@ -2109,7 +2109,7 @@ public class QueueControlTest extends ManagementTestBase {
QueueControl queueControl = createManagementControl(address, queue);
queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, Base64.encodeBytes("theBody".getBytes()), true, "myUser", "myPassword");
queueControl.sendMessage(new HashMap<String, String>(), Message.BYTES_TYPE, Base64.encodeBytes("theBody".getBytes()), true, "myUser", "myPassword");
Assert.assertEquals(1, getMessageCount(queueControl));
@ -2118,38 +2118,13 @@ public class QueueControlTest extends ManagementTestBase {
Assert.assertEquals(1, browse.length);
byte[] body = (byte[]) browse[0].get("body");
byte[] body = (byte[]) browse[0].get("BodyPreview");
Assert.assertNotNull(body);
Assert.assertEquals(new String(body), "theBody");
}
@Test
public void testSendNullMessage() throws Exception {
SimpleString address = RandomUtil.randomSimpleString();
SimpleString queue = RandomUtil.randomSimpleString();
session.createQueue(address, queue, null, false);
QueueControl queueControl = createManagementControl(address, queue);
queueControl.sendMessage(new HashMap<String, String>(), Message.TEXT_TYPE, null, true, "myUser", "myPassword");
Assert.assertEquals(1, getMessageCount(queueControl));
// the message IDs are set on the server
CompositeData[] browse = queueControl.browse(null);
Assert.assertEquals(1, browse.length);
byte[] body = (byte[]) browse[0].get("body");
Assert.assertNotNull(body);
Assert.assertEquals(new String(body), "");
}
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------