use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testUserIdConversion.
public void testUserIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String userId = "test-userId";
basicContentHeaderProperties.setUserId(userId);
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected user-id", userId, new String(properties.getUserId().getArray(), UTF_8));
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testCorrelationIdConversion.
public void testCorrelationIdConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String correlationId = "testCorrelationId";
basicContentHeaderProperties.setCorrelationId(AMQShortString.valueOf(correlationId));
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected correlationId", correlationId, properties.getCorrelationId());
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testHeaderConversionWhenQpidSubjectIsPresent.
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"));
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testReplyToConversionWhenNonBindingURLFormatIsUsed.
public void testReplyToConversionWhenNonBindingURLFormatIsUsed() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String replyTo = "test";
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", properties.getReplyTo());
}
use of org.apache.qpid.server.protocol.v1_0.type.messaging.Properties in project qpid-broker-j by apache.
the class PropertyConverter_0_8_to_1_0Test method testTypeConversion.
public void testTypeConversion() {
BasicContentHeaderProperties basicContentHeaderProperties = new BasicContentHeaderProperties();
final String type = "test-type";
basicContentHeaderProperties.setType(String.valueOf(type));
AMQMessage message = createTestMessage(basicContentHeaderProperties);
final Message_1_0 convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
Properties properties = convertedMessage.getPropertiesSection().getValue();
assertEquals("Unexpected subject", type, properties.getSubject());
}
Aggregations