Search in sources :

Example 1 with UnsignedLong

use of org.apache.qpid.server.protocol.v1_0.type.UnsignedLong in project qpid-broker-j by apache.

the class PropertyConverter_v1_0_to_InternalTest method testCorrelationIdUnsignedLongConversion.

public void testCorrelationIdUnsignedLongConversion() {
    final UnsignedLong correlationId = UnsignedLong.valueOf(-1L);
    Properties properties = new Properties();
    properties.setCorrelationId(correlationId);
    Message_1_0 originalMessage = createTestMessage(properties);
    InternalMessage convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
    assertEquals("Unexpected correlationId", correlationId.toString(), convertedMessage.getMessageHeader().getCorrelationId());
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) UnsignedLong(org.apache.qpid.server.protocol.v1_0.type.UnsignedLong) ApplicationProperties(org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties) Properties(org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)

Example 2 with UnsignedLong

use of org.apache.qpid.server.protocol.v1_0.type.UnsignedLong in project qpid-broker-j by apache.

the class PropertyConverter_1_0_to_0_10Test method testCorrelationIdULongConversion.

public void testCorrelationIdULongConversion() {
    final UnsignedLong correlationId = UnsignedLong.valueOf(-1);
    Properties properties = new Properties();
    properties.setCorrelationId(correlationId);
    Message_1_0 message = createTestMessage(properties);
    final MessageTransferMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    final MessageProperties messageProperties = convertedMessage.getStoredMessage().getMetaData().getMessageProperties();
    assertTrue("Unexpected correlationId", Arrays.equals(longToBytes(correlationId.longValue()), messageProperties.getCorrelationId()));
}
Also used : UnsignedLong(org.apache.qpid.server.protocol.v1_0.type.UnsignedLong) MessageTransferMessage(org.apache.qpid.server.protocol.v0_10.MessageTransferMessage) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties) Message_1_0(org.apache.qpid.server.protocol.v1_0.Message_1_0) ApplicationProperties(org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties) Properties(org.apache.qpid.server.protocol.v1_0.type.messaging.Properties) DeliveryProperties(org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties) MessageProperties(org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)

Example 3 with UnsignedLong

use of org.apache.qpid.server.protocol.v1_0.type.UnsignedLong in project qpid-broker-j by apache.

the class PropertyConverter_1_0_to_0_8Test method testCorrelationIdULongConversion.

public void testCorrelationIdULongConversion() {
    final UnsignedLong correlationId = UnsignedLong.valueOf(-1);
    Properties properties = new Properties();
    properties.setCorrelationId(correlationId);
    Message_1_0 message = createTestMessage(properties);
    final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
    assertEquals("Unexpected correlationId", correlationId.toString(), convertedProperties.getCorrelationId().toString());
}
Also used : UnsignedLong(org.apache.qpid.server.protocol.v1_0.type.UnsignedLong) Message_1_0(org.apache.qpid.server.protocol.v1_0.Message_1_0) ApplicationProperties(org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) Properties(org.apache.qpid.server.protocol.v1_0.type.messaging.Properties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 4 with UnsignedLong

use of org.apache.qpid.server.protocol.v1_0.type.UnsignedLong in project qpid-broker-j by apache.

the class PropertyConverter_1_0_to_0_8Test method testMessageIdUnsignedLongConversion.

public void testMessageIdUnsignedLongConversion() {
    final UnsignedLong messageId = UnsignedLong.valueOf(-1);
    Properties properties = new Properties();
    properties.setMessageId(messageId);
    Message_1_0 message = createTestMessage(properties);
    final AMQMessage convertedMessage = _messageConverter.convert(message, _namedAddressSpace);
    BasicContentHeaderProperties convertedProperties = convertedMessage.getContentHeaderBody().getProperties();
    assertEquals("Unexpected messageId", messageId.toString(), convertedProperties.getMessageId().toString());
}
Also used : UnsignedLong(org.apache.qpid.server.protocol.v1_0.type.UnsignedLong) Message_1_0(org.apache.qpid.server.protocol.v1_0.Message_1_0) ApplicationProperties(org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) Properties(org.apache.qpid.server.protocol.v1_0.type.messaging.Properties) BasicContentHeaderProperties(org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties) AMQMessage(org.apache.qpid.server.protocol.v0_8.AMQMessage)

Example 5 with UnsignedLong

use of org.apache.qpid.server.protocol.v1_0.type.UnsignedLong in project qpid-broker-j by apache.

the class PropertyConverter_Internal_to_v1_0Test method testCorrelationIdUnsignedLongConversion.

public void testCorrelationIdUnsignedLongConversion() {
    final UnsignedLong correlationId = UnsignedLong.valueOf(-1L);
    final AMQMessageHeader header = mock(AMQMessageHeader.class);
    when(header.getCorrelationId()).thenReturn(correlationId.toString());
    InternalMessage originalMessage = createTestMessage(header);
    Message_1_0 convertedMessage = _messageConverter.convert(originalMessage, _addressSpace);
    Object convertedCorrelationId = MessageConverter_from_1_0.getCorrelationId(convertedMessage);
    assertEquals("Unexpected correlationId", correlationId, convertedCorrelationId);
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) UnsignedLong(org.apache.qpid.server.protocol.v1_0.type.UnsignedLong) AMQMessageHeader(org.apache.qpid.server.message.AMQMessageHeader)

Aggregations

UnsignedLong (org.apache.qpid.server.protocol.v1_0.type.UnsignedLong)9 ApplicationProperties (org.apache.qpid.server.protocol.v1_0.type.messaging.ApplicationProperties)6 Properties (org.apache.qpid.server.protocol.v1_0.type.messaging.Properties)6 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)4 Message_1_0 (org.apache.qpid.server.protocol.v1_0.Message_1_0)4 AMQMessageHeader (org.apache.qpid.server.message.AMQMessageHeader)2 MessageTransferMessage (org.apache.qpid.server.protocol.v0_10.MessageTransferMessage)2 DeliveryProperties (org.apache.qpid.server.protocol.v0_10.transport.DeliveryProperties)2 MessageProperties (org.apache.qpid.server.protocol.v0_10.transport.MessageProperties)2 AMQMessage (org.apache.qpid.server.protocol.v0_8.AMQMessage)2 BasicContentHeaderProperties (org.apache.qpid.server.protocol.v0_8.transport.BasicContentHeaderProperties)2 Binary (org.apache.qpid.server.protocol.v1_0.type.Binary)1 Rejected (org.apache.qpid.server.protocol.v1_0.type.messaging.Rejected)1 Attach (org.apache.qpid.server.protocol.v1_0.type.transport.Attach)1 Begin (org.apache.qpid.server.protocol.v1_0.type.transport.Begin)1 Detach (org.apache.qpid.server.protocol.v1_0.type.transport.Detach)1 Disposition (org.apache.qpid.server.protocol.v1_0.type.transport.Disposition)1 Flow (org.apache.qpid.server.protocol.v1_0.type.transport.Flow)1 Open (org.apache.qpid.server.protocol.v1_0.type.transport.Open)1 SpecificationTest (org.apache.qpid.tests.protocol.SpecificationTest)1