use of org.apache.qpid.proton.amqp.messaging.Header in project activemq-artemis by apache.
the class AMQPMessageTest method testGetPriorityFromMessage.
@Test
public void testGetPriorityFromMessage() {
final short PRIORITY = 7;
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
protonMessage.setHeader(new Header());
protonMessage.setPriority(PRIORITY);
AMQPMessage decoded = encodeAndDecodeMessage(protonMessage);
assertEquals(PRIORITY, decoded.getPriority());
}
use of org.apache.qpid.proton.amqp.messaging.Header in project activemq-artemis by apache.
the class AMQPMessageTest method testGetUserIDFromMessage.
@Test
public void testGetUserIDFromMessage() {
final String USER_NAME = "foo";
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
protonMessage.setHeader(new Header());
protonMessage.setUserId(USER_NAME.getBytes(StandardCharsets.UTF_8));
AMQPMessage decoded = encodeAndDecodeMessage(protonMessage);
assertEquals(USER_NAME, decoded.getAMQPUserID());
}
use of org.apache.qpid.proton.amqp.messaging.Header in project activemq-artemis by apache.
the class AMQPMessageTest method testIsDurableFromMessage.
@Test
public void testIsDurableFromMessage() {
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
protonMessage.setHeader(new Header());
protonMessage.setDurable(true);
AMQPMessage decoded = encodeAndDecodeMessage(protonMessage);
assertTrue(decoded.isDurable());
}
use of org.apache.qpid.proton.amqp.messaging.Header in project activemq-artemis by apache.
the class AMQPMessageTest method testGetTimestampFromMessageWithNoCreateTimeSet.
@Test
public void testGetTimestampFromMessageWithNoCreateTimeSet() {
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
protonMessage.setHeader(new Header());
AMQPMessage decoded = encodeAndDecodeMessage(protonMessage);
assertEquals(0L, decoded.getTimestamp());
}
use of org.apache.qpid.proton.amqp.messaging.Header in project activemq-artemis by apache.
the class AMQPMessageTest method testGetGroupIDFromMessage.
@Test
public void testGetGroupIDFromMessage() {
final String GROUP_ID = "group-1";
MessageImpl protonMessage = (MessageImpl) Message.Factory.create();
protonMessage.setHeader(new Header());
protonMessage.setGroupId(GROUP_ID);
AMQPMessage decoded = encodeAndDecodeMessage(protonMessage);
assertEquals(GROUP_ID, decoded.getGroupID().toString());
}
Aggregations