use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testReplyToConversionWhenBindingURLFormatIsUsed4.
@Test
public void testReplyToConversionWhenBindingURLFormatIsUsed4() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String replyTo = "direct:////?routingkey='test_routing_key'";
basicContentHeaderProperties.setReplyTo(replyTo);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected reply-to", "test_routing_key", properties.getReplyTo());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testMessageUuidConversion.
@Test
public void testMessageUuidConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final UUID messageId = UUID.randomUUID();
basicContentHeaderProperties.setMessageId("ID:" + messageId.toString());
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected messageId", messageId, properties.getMessageId());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testNonPersistentDeliveryModeConversion.
@Test
public void testNonPersistentDeliveryModeConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
basicContentHeaderProperties.setDeliveryMode(BasicContentHeaderProperties.NON_PERSISTENT);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Header header = convertedMessage.getHeaderSection().getValue();
assertFalse("Unexpected durable header", header.getDurable());
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testHeaderJMSXGroupSeqConversion.
@Test
public void testHeaderJMSXGroupSeqConversion() {
Map<String, Object> headers = new HashMap<>();
int testGroupSequenceNumber = 1;
headers.put("JMSXGroupSeq", testGroupSequenceNumber);
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-sequence", (long) testGroupSequenceNumber, (long) properties.getGroupSequence().intValue());
Map<String, Object> applicationProperties = convertedMessage.getApplicationPropertiesSection().getValue();
assertFalse("Unexpected JMSXGroupSeq in application properties", applicationProperties.containsKey("JMSXGroupSeq"));
}
use of org.apache.qpid.server.protocol.v0_8.AMQMessage in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testHeaderConversionWhenQpidSubjectIsPresent.
@Test
public void testHeaderConversionWhenQpidSubjectIsPresent() {
String testSubject = "testSubject";
Map<String, Object> headers = new HashMap<>();
headers.put("testProperty1", "testProperty1Value");
headers.put("qpid.subject", testSubject);
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 subject", testSubject, properties.getSubject());
Map<String, Object> applicationProperties = convertedMessage.getApplicationPropertiesSection().getValue();
assertFalse("Unexpected subject in application properties", applicationProperties.containsKey("qpid.subject"));
}
Aggregations