use of com.adaptris.core.lms.FileBackedMessageFactory in project interlok by adaptris.
the class MessageHelperTest method testCopyPayload_BothFileBacked.
@Test
public void testCopyPayload_BothFileBacked() throws Exception {
AdaptrisMessage reply = new FileBackedMessageFactory().newMessage("hello world");
AdaptrisMessage original = new FileBackedMessageFactory().newMessage();
MessageHelper.copyPayload(reply, original);
assertEquals("hello world", original.getContent());
assertTrue(original.getObjectHeaders().containsKey(reply.getUniqueId()));
}
use of com.adaptris.core.lms.FileBackedMessageFactory in project interlok by adaptris.
the class MessageHelperTest method testCopyPayload_OneFileBacked.
@Test
public void testCopyPayload_OneFileBacked() throws Exception {
AdaptrisMessage reply = new FileBackedMessageFactory().newMessage("hello world");
AdaptrisMessage original = new DefaultMessageFactory().newMessage();
MessageHelper.copyPayload(reply, original);
assertEquals("hello world", original.getContent());
assertFalse(original.getObjectHeaders().containsKey(reply.getUniqueId()));
}
use of com.adaptris.core.lms.FileBackedMessageFactory in project interlok by adaptris.
the class SerializableMessageTranslatorTest method testSerialize_FileBackedMessage_Small.
@Test
public void testSerialize_FileBackedMessage_Small() throws Exception {
FileBackedMessage adaptrisMessage = (FileBackedMessage) new FileBackedMessageFactory().newMessage("Some Payload");
adaptrisMessage.addMetadata("MetaKey1", "MetaValue1");
adaptrisMessage.addMetadata("MetaKey2", "MetaValue2");
SerializableMessage serialisableAdaptrisMessage = new DefaultSerializableMessageTranslator().translate(adaptrisMessage);
assertEquals("MetaValue1", serialisableAdaptrisMessage.getMessageHeaders().get("MetaKey1"));
assertEquals("MetaValue2", serialisableAdaptrisMessage.getMessageHeaders().get("MetaKey2"));
assertEquals(adaptrisMessage.getUniqueId(), serialisableAdaptrisMessage.getUniqueId());
assertEquals("Some Payload", serialisableAdaptrisMessage.getContent());
}
use of com.adaptris.core.lms.FileBackedMessageFactory in project interlok by adaptris.
the class RequestReplyProducerBaseTest method testCopyReplyContents_BothFileBacked.
@Test
public void testCopyReplyContents_BothFileBacked() throws Exception {
AdaptrisMessage reply = new FileBackedMessageFactory().newMessage("hello world");
AdaptrisMessage original = new FileBackedMessageFactory().newMessage();
copyReplyContents(reply, original);
assertEquals("hello world", original.getContent());
assertTrue(original.getObjectHeaders().containsKey(reply.getUniqueId()));
}
use of com.adaptris.core.lms.FileBackedMessageFactory in project interlok by adaptris.
the class RequestReplyProducerBaseTest method testCopyReplyContents_OneFileBacked.
@Test
public void testCopyReplyContents_OneFileBacked() throws Exception {
AdaptrisMessage reply = new FileBackedMessageFactory().newMessage("hello world");
AdaptrisMessage original = new DefaultMessageFactory().newMessage();
copyReplyContents(reply, original);
assertEquals("hello world", original.getContent());
assertFalse(original.getObjectHeaders().containsKey(reply.getUniqueId()));
}
Aggregations