use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testHeaderJMSXGroupIdConversion.
public void testHeaderJMSXGroupIdConversion() {
Map<String, Object> headers = new HashMap<>();
String testGroupId = "testGroupId";
headers.put("JMSXGroupID", testGroupId);
headers.put("intProperty", 1);
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setHeaders(FieldTable.convertToFieldTable(headers));
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected group-id", testGroupId, properties.getGroupId());
Map<String, Object> applicationProperties = convertedMessage.getApplicationPropertiesSection().getValue();
assertFalse("Unexpected JMSXGroupID in application properties", applicationProperties.containsKey("JMSXGroupID"));
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testContentEncodingConversion.
public void testContentEncodingConversion() {
String contentEncoding = "my-test-encoding";
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setEncoding(contentEncoding);
AMQMessage message = createTestMessage(basicContentHeaderProperties, new byte[] { (byte) 1 }, 0);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected content encoding", contentEncoding, properties.getContentEncoding().toString());
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testPriorityConversion.
public void testPriorityConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final byte priority = 5;
basicContentHeaderProperties.setPriority(priority);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Header header = convertedMessage.getHeaderSection().getValue();
assertEquals("Unexpected priority", priority, header.getPriority().byteValue());
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testArrivalTimeConversion.
public void testArrivalTimeConversion() {
final long timestamp = System.currentTimeMillis() - 10000;
AMQMessage message = createTestMessage(new BasicContentHeaderProperties(), null, timestamp);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected creation timestamp", timestamp, properties.getCreationTime().getTime());
}
use of org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testMessageIdConversion.
public void testMessageIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String messageId = "testMessageId";
basicContentHeaderProperties.setMessageId(messageId);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected messageId", messageId, properties.getMessageId());
}
Aggregations