use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_v1_0_to_InternalTest method testUserIdConversion.
public void testUserIdConversion() {
final byte[] data = new byte[] { (byte) 0xc3, 0x28 };
final Binary userId = new Binary(data);
Properties properties = new Properties();
properties.setUserId(userId);
Message_1_0 originalMessage = createTestMessage(properties);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected userId", new String(data, UTF_8), convertedMessage.getMessageHeader().getUserId());
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_v1_0_to_InternalTest method testReplyToConversion.
public void testReplyToConversion() {
final String replyTo = "amq.direct/test";
Properties properties = new Properties();
properties.setReplyTo(replyTo);
Message_1_0 originalMessage = createTestMessage(properties);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected replyTo", replyTo, convertedMessage.getMessageHeader().getReplyTo());
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_v1_0_to_InternalTest method testCorrelationIdUnsignedLongConversion.
public void testCorrelationIdUnsignedLongConversion() {
final UnsignedLong correlationId = UnsignedLong.valueOf(-1L);
Properties properties = new Properties();
properties.setCorrelationId(correlationId);
Message_1_0 originalMessage = createTestMessage(properties);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected correlationId", correlationId.toString(), convertedMessage.getMessageHeader().getCorrelationId());
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_v1_0_to_InternalTest method testMessageIdUuidConversion.
public void testMessageIdUuidConversion() {
final UUID messageId = UUID.randomUUID();
Properties properties = new Properties();
properties.setMessageId(messageId);
Message_1_0 originalMessage = createTestMessage(properties);
InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
assertEquals("Unexpected messageId", messageId.toString(), convertedMessage.getMessageHeader().getMessageId());
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class MessageConverter_1_0_to_v0_10Test method testDataWithStreamMessageAnnotationAndContentTypeJmsStreamMessage.
public void testDataWithStreamMessageAnnotationAndContentTypeJmsStreamMessage() throws Exception {
List<Object> originalList = Collections.singletonList("testValue");
byte[] data = new ListToJmsStreamMessage().toMimeContent(originalList);
String expectedMimeType = "jms/stream-message";
final Data value = new Data(new Binary(data));
Properties properties = new Properties();
properties.setContentType(Symbol.valueOf(expectedMimeType));
Message_1_0 sourceMessage = createTestMessage(properties, STREAM_MESSAGE_MESSAGE_ANNOTATION, value.createEncodingRetainingSection());
final MessageTransferMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class));
assertEquals("Unexpected mime type", expectedMimeType, convertedMessage.getMessageHeader().getMimeType());
final QpidByteBuffer content = convertedMessage.getContent(0, (int) convertedMessage.getSize());
assertArrayEquals("Unexpected content", data, getBytes(content));
}
Aggregations