use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_8Test method testUserIdConversionWhenLengthExceeds255.
public void testUserIdConversionWhenLengthExceeds255() {
final String userId = generateLongString();
Properties properties = new Properties();
properties.setUserId(new Binary(userId.getBytes()));
Message_1_0 message = createTestMessage(properties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
assertNull("Unexpected user-id", convertedProperties.getUserId());
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_8Test method testReplyToConversionWhenQueueIsSpecified.
public void testReplyToConversionWhenQueueIsSpecified() throws IOException {
final String replyTo = "myTestQueue";
final Queue queue = mock(Queue.class);
when(queue.getName()).thenReturn(replyTo);
when(_namedAddressSpace.getAttainedMessageDestination(replyTo)).thenReturn(queue);
Properties properties = new Properties();
properties.setReplyTo(replyTo);
Message_1_0 message = createTestMessage(properties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected reply-to", "direct:////" + replyTo, convertedProperties.getReplyToAsString());
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_8Test method testMessageIdBinaryConversionWhenNonUtf8.
public void testMessageIdBinaryConversionWhenNonUtf8() {
final byte[] messageId = new byte[] { (byte) 0xc3, 0x28 };
Properties properties = new Properties();
properties.setMessageId(new Binary(messageId));
Message_1_0 message = createTestMessage(properties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
assertTrue("Unexpected messageId", Arrays.equals(messageId, convertedProperties.getMessageId().getBytes()));
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_8Test method testGroupSequenceConversion.
public void testGroupSequenceConversion() {
int testGroupSequence = 1;
Properties properties = new Properties();
properties.setGroupSequence(UnsignedInteger.valueOf(testGroupSequence));
Message_1_0 message = createTestMessage(properties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
Map<String, Object> headers = FieldTable.convertToMap(convertedProperties.getHeaders());
assertEquals("Unexpected group-id", testGroupSequence, headers.get("JMSXGroupSeq"));
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_8Test method testDurableConversion.
public void testDurableConversion() {
final Header header = new Header();
header.setDurable(true);
Message_1_0 message = createTestMessage(header);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected deliveryMode", BasicContentHeaderProperties.PERSISTENT, convertedProperties.getDeliveryMode());
}
Aggregations