Search in sources :

Example 1 with InternalMessageMetaData

use of org.apache.qpid.server.message.internal.InternalMessageMetaData in project qpid-broker-j by apache.

the class PropertyConverter_Internal_to_v1_0Test method createInternalStoredMessage.

private StoredMessage<InternalMessageMetaData> createInternalStoredMessage(final byte[] content, final boolean persistent, final InternalMessageHeader internalMessageHeader) {
    final int contentSize = content == null ? 0 : content.length;
    final InternalMessageMetaData metaData = new InternalMessageMetaData(persistent, internalMessageHeader, contentSize);
    final StoredMessage<InternalMessageMetaData> storedMessage = mock(StoredMessage.class);
    when(storedMessage.getMetaData()).thenReturn(metaData);
    when(storedMessage.getContentSize()).thenReturn(contentSize);
    return storedMessage;
}
Also used : InternalMessageMetaData(org.apache.qpid.server.message.internal.InternalMessageMetaData)

Example 2 with InternalMessageMetaData

use of org.apache.qpid.server.message.internal.InternalMessageMetaData in project qpid-broker-j by apache.

the class MessageConverter_Internal_to_0_10Test method getAmqMessage.

protected InternalMessage getAmqMessage(final Serializable content, final String mimeType) throws Exception {
    final byte[] serializedContent = getObjectStreamMessageBytes(content);
    configureMessageContent(serializedContent);
    configureMessageHeader(mimeType);
    final InternalMessageHeader internalMessageHeader = new InternalMessageHeader(_amqpHeader);
    final int contentSize = serializedContent == null ? 0 : serializedContent.length;
    final InternalMessageMetaData metaData = new InternalMessageMetaData(false, internalMessageHeader, contentSize);
    when(_handle.getMetaData()).thenReturn(metaData);
    return ((InternalMessage) InternalMessageMetaDataType.INSTANCE.createMessage(_handle));
}
Also used : InternalMessageMetaData(org.apache.qpid.server.message.internal.InternalMessageMetaData) InternalMessageHeader(org.apache.qpid.server.message.internal.InternalMessageHeader)

Example 3 with InternalMessageMetaData

use of org.apache.qpid.server.message.internal.InternalMessageMetaData in project qpid-broker-j by apache.

the class PropertyConverter_Internal_to_v0_10Test method createTestMessage.

private InternalMessage createTestMessage(String to) throws IOException {
    final InternalMessageHeader internalMessageHeader = new InternalMessageHeader(mock(AMQMessageHeader.class));
    final StoredMessage<InternalMessageMetaData> handle = createInternalStoredMessage(null, false, internalMessageHeader);
    return new InternalMessage(handle, internalMessageHeader, null, to);
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) InternalMessageMetaData(org.apache.qpid.server.message.internal.InternalMessageMetaData) InternalMessageHeader(org.apache.qpid.server.message.internal.InternalMessageHeader) AMQMessageHeader(org.apache.qpid.server.message.AMQMessageHeader)

Example 4 with InternalMessageMetaData

use of org.apache.qpid.server.message.internal.InternalMessageMetaData in project qpid-broker-j by apache.

the class PropertyConverter_Internal_to_v0_8Test method createInternalStoredMessage.

private StoredMessage<InternalMessageMetaData> createInternalStoredMessage(final boolean persistent, final InternalMessageHeader internalMessageHeader, final int contentSize) {
    final InternalMessageMetaData metaData = new InternalMessageMetaData(persistent, internalMessageHeader, contentSize);
    final StoredMessage<InternalMessageMetaData> storedMessage = mock(StoredMessage.class);
    when(storedMessage.getMetaData()).thenReturn(metaData);
    when(storedMessage.getContentSize()).thenReturn(contentSize);
    return storedMessage;
}
Also used : InternalMessageMetaData(org.apache.qpid.server.message.internal.InternalMessageMetaData)

Example 5 with InternalMessageMetaData

use of org.apache.qpid.server.message.internal.InternalMessageMetaData in project qpid-broker-j by apache.

the class PropertyConverter_Internal_to_v1_0Test method createTestMessage.

private InternalMessage createTestMessage(String to) {
    final InternalMessageHeader internalMessageHeader = new InternalMessageHeader(mock(AMQMessageHeader.class));
    final StoredMessage<InternalMessageMetaData> handle = createInternalStoredMessage(null, false, internalMessageHeader);
    return new InternalMessage(handle, internalMessageHeader, null, to);
}
Also used : InternalMessage(org.apache.qpid.server.message.internal.InternalMessage) InternalMessageMetaData(org.apache.qpid.server.message.internal.InternalMessageMetaData) InternalMessageHeader(org.apache.qpid.server.message.internal.InternalMessageHeader) AMQMessageHeader(org.apache.qpid.server.message.AMQMessageHeader)

Aggregations

InternalMessageMetaData (org.apache.qpid.server.message.internal.InternalMessageMetaData)12 InternalMessageHeader (org.apache.qpid.server.message.internal.InternalMessageHeader)9 AMQMessageHeader (org.apache.qpid.server.message.AMQMessageHeader)3 InternalMessage (org.apache.qpid.server.message.internal.InternalMessage)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ObjectOutputStream (java.io.ObjectOutputStream)1