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 testReplyToConversionWhenBindingURLFormatIsUsed3.
public void testReplyToConversionWhenBindingURLFormatIsUsed3() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String replyTo = "direct:////queue_name";
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", "queue_name", properties.getReplyTo());
}
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 testHeaderJMSXGroupSeqConversion.
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", testGroupSequenceNumber, 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.transport.BasicContentHeaderProperties in project qpid-broker-j by apache.
the class PropertyConverter_1_0_to_0_8Test method testApplicationPropertiesConversion.
public void testApplicationPropertiesConversion() {
Map<String, Object> properties = new HashMap<>();
properties.put("testProperty1", "testProperty1Value");
properties.put("intProperty", 1);
ApplicationProperties applicationProperties = new ApplicationProperties(properties);
Message_1_0 message = createTestMessage(applicationProperties);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
final Map<String, Object> headers = FieldTable.convertToMap(convertedProperties.getHeaders());
assertEquals("Unexpected headers", properties, new HashMap<>(headers));
}
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 testTTLConversion.
public void testTTLConversion() {
long ttl = 10000;
long arrivalTime = System.currentTimeMillis();
long expectedExpiration = arrivalTime + ttl;
Header header = new Header();
header.setTtl(UnsignedInteger.valueOf(ttl));
Message_1_0 message = createTestMessage(header, arrivalTime);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected expiration", expectedExpiration, convertedProperties.getExpiration());
}
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 testNonDurableConversion.
public void testNonDurableConversion() {
final Header header = new Header();
header.setDurable(false);
Message_1_0 message = createTestMessage(header);
final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
assertEquals("Unexpected deliveryMode", BasicContentHeaderProperties.NON_PERSISTENT, convertedProperties.getDeliveryMode());
}
Aggregations