ARTEMIS-1009 Fixing Management test
This commit is contained in:
parent
0b1e48a7f4
commit
ed1d4c0948
|
@ -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);
|
||||
|
|
|
@ -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 -----------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue