Java Code Examples for org.apache.qpid.proton.amqp.UnsignedLong#toString()

The following examples show how to use org.apache.qpid.proton.amqp.UnsignedLong#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AMQPMessageIdHelperTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
/**
 * Test that {@link AMQPMessageIdHelper#toMessageIdString(Object)} returns a
 * string indicating an AMQP encoded ulong when given a UnsignedLong object.
 */
@Test
public void testToMessageIdStringWithUnsignedLong() {
   UnsignedLong uLongMessageId = UnsignedLong.valueOf(123456789L);
   String expected = AMQPMessageIdHelper.JMS_ID_PREFIX + AMQPMessageIdHelper.AMQP_ULONG_PREFIX + uLongMessageId.toString();

   doToMessageIdTestImpl(uLongMessageId, expected);
}
 
Example 2
Source File: AMQPMessageIdHelperTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
/**
 * Test that {@link AMQPMessageIdHelper#toCorrelationIdString(Object)}
 * returns a string indicating an AMQP encoded ulong when given a
 * UnsignedLong object.
 */
@Test
public void testToCorrelationIdStringWithUnsignedLong() {
   UnsignedLong uLongCorrelationId = UnsignedLong.valueOf(123456789L);
   String expected = AMQPMessageIdHelper.JMS_ID_PREFIX + AMQPMessageIdHelper.AMQP_ULONG_PREFIX + uLongCorrelationId.toString();

   doToCorrelationIDTestImpl(uLongCorrelationId, expected);
}
 
Example 3
Source File: MessageIntegrationTest.java    From qpid-jms with Apache License 2.0 5 votes vote down vote up
/**
 * Tests that receiving a message with a UUID typed correlation-id results in returning the
 * expected value for JMSCorrelationID where the JMS "ID:" prefix has been added to the UUID.tostring()
 *
 * @throws Exception if an error occurs during the test.
 */
@Test(timeout = 20000)
public void testReceivedMessageWithLongCorrelationIdReturnsExpectedJMSCorrelationID() throws Exception {
    UnsignedLong underlyingCorrelationId = UnsignedLong.valueOf(123456789L);
    String expected = "ID:AMQP_ULONG:" + underlyingCorrelationId.toString();
    receivedMessageWithCorrelationIdTestImpl(underlyingCorrelationId, expected);
}
 
Example 4
Source File: AmqpJmsMessageFacadeTest.java    From qpid-jms with Apache License 2.0 5 votes vote down vote up
/**
 * Test that getting the correlationId when using an underlying received message with a
 * ulong correlation id (using BigInteger) returns the expected value.
 */
@Test
public void testGetCorrelationIdOnReceivedMessageWithUnsignedLong() {
    UnsignedLong testCorrelationId = UnsignedLong.valueOf(123456789L);
    String expected = AmqpMessageIdHelper.JMS_ID_PREFIX + AmqpMessageIdHelper.AMQP_ULONG_PREFIX + testCorrelationId.toString();
    correlationIdOnReceivedMessageTestImpl(testCorrelationId, expected, false);
}
 
Example 5
Source File: AmqpMessageIdHelperTest.java    From qpid-jms with Apache License 2.0 5 votes vote down vote up
/**
 * Test that {@link AmqpMessageIdHelper#toMessageIdString(Object)} returns a string
 * indicating an AMQP encoded ulong when given a UnsignedLong object.
 */
@Test
public void testToMessageIdStringWithUnsignedLong() {
    UnsignedLong uLongMessageId = UnsignedLong.valueOf(123456789L);
    String expected = AmqpMessageIdHelper.JMS_ID_PREFIX + AmqpMessageIdHelper.AMQP_ULONG_PREFIX + uLongMessageId.toString();

    doToMessageIdTestImpl(uLongMessageId, expected);
}
 
Example 6
Source File: AmqpMessageIdHelperTest.java    From qpid-jms with Apache License 2.0 5 votes vote down vote up
/**
 * Test that {@link AmqpMessageIdHelper#toCorrelationIdString(Object)} returns a string
 * indicating an AMQP encoded ulong when given a UnsignedLong object.
 */
@Test
public void testToCorrelationIdStringWithUnsignedLong() {
    UnsignedLong uLongCorrelationId = UnsignedLong.valueOf(123456789L);
    String expected = AmqpMessageIdHelper.JMS_ID_PREFIX + AmqpMessageIdHelper.AMQP_ULONG_PREFIX + uLongCorrelationId.toString();

    doToCorrelationIDTestImpl(uLongCorrelationId, expected);
}
 
Example 7
Source File: MessageIntegrationTest.java    From qpid-jms with Apache License 2.0 3 votes vote down vote up
/**
 * Tests that sending a message with a ulong typed correlation-id value which is a
 * message-id results in an AMQP message with the expected encoding of the correlation-id,
 * where the type is ulong, the "ID:" prefix of the JMSCorrelationID value is (obviously) not present.
 *
 * @throws Exception if an error occurs during the test.
 */
@Test(timeout = 20000)
public void testSentMessageWithUlongCorrelationId() throws Exception {
    UnsignedLong ulong = UnsignedLong.valueOf(Long.MAX_VALUE);
    String stringCorrelationId = AmqpMessageIdHelper.JMS_ID_PREFIX + AmqpMessageIdHelper.AMQP_ULONG_PREFIX +  ulong.toString();
    sentMessageWithCorrelationIdTestImpl(stringCorrelationId, ulong);
}