use of com.adaptris.core.MessageLifecycleEvent in project interlok by adaptris.
the class FileBackedMessageTest method testCloneFileBackedMessageWithoutContents.
@Test
public void testCloneFileBackedMessageWithoutContents() throws Exception {
AdaptrisMessage msg1 = getMessageFactory().newMessage();
msg1.addEvent(new StandaloneProducer(), true);
AdaptrisMessage msg2 = (AdaptrisMessage) msg1.clone();
assertTrue(msg2.getPayload() != msg1.getPayload());
assertTrue(msg2.getMetadata() != msg1.getMetadata());
assertTrue(msg2.getMessageLifecycleEvent() != msg1.getMessageLifecycleEvent());
assertTrue(msg2.getContent().equals(msg1.getContent()));
assertTrue(msg2.getMetadata().equals(msg1.getMetadata()));
MessageLifecycleEvent event1 = msg1.getMessageLifecycleEvent();
MessageLifecycleEvent event2 = msg2.getMessageLifecycleEvent();
assertEquals(event1.getCreationTime(), event2.getCreationTime());
assertEquals(event1.getMessageUniqueId(), event2.getMessageUniqueId());
assertEquals(event1.getMleMarkers().size(), event2.getMleMarkers().size());
}
use of com.adaptris.core.MessageLifecycleEvent in project interlok by adaptris.
the class MessageDigestErrorEntryTest method testSetLifecycleEvent.
@Test
public void testSetLifecycleEvent() throws Exception {
MessageDigestErrorEntry entry = null;
entry = new MessageDigestErrorEntry("123", "234");
MessageLifecycleEvent event = new MessageLifecycleEvent();
entry.setLifecycleEvent(event);
assertNotNull(entry.getLifecycleEvent());
assertEquals(event, entry.getLifecycleEvent());
entry.setLifecycleEvent(null);
assertNull(entry.getLifecycleEvent());
}
use of com.adaptris.core.MessageLifecycleEvent in project interlok by adaptris.
the class MultiPayloadMessageSplitterTest method testNonCloneableMessage.
@Test
@SuppressWarnings("serial")
public void testNonCloneableMessage() {
List<AdaptrisMessage> response = (List<AdaptrisMessage>) splitter.splitMessage(new MultiPayloadAdaptrisMessageImp("bacon", new GuidGenerator(), DefaultMessageFactory.getDefaultInstance(), PAYLOAD_1.getBytes()) {
@Override
public MessageLifecycleEvent getMessageLifecycleEvent() {
return new MessageLifecycleEvent() {
@Override
public List<MleMarker> getMleMarkers() {
List<MleMarker> list = new ArrayList<>();
list.add(new MleMarker() {
@Override
public Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
});
return list;
}
};
}
});
assertEquals(0, response.size());
}
use of com.adaptris.core.MessageLifecycleEvent in project interlok by adaptris.
the class ForEachTest method testNonCloneableMessage.
@Test
@SuppressWarnings("serial")
public void testNonCloneableMessage() throws Exception {
forEach.doService(new MultiPayloadAdaptrisMessageImp("bacon", new GuidGenerator(), DefaultMessageFactory.getDefaultInstance(), PAYLOAD_1) {
@Override
public MessageLifecycleEvent getMessageLifecycleEvent() {
return new MessageLifecycleEvent() {
@Override
public List<MleMarker> getMleMarkers() {
List<MleMarker> list = new ArrayList<>();
list.add(new MleMarker() {
@Override
public Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
});
return list;
}
};
}
});
verify(mock, never()).doService(any(AdaptrisMessage.class));
}
Aggregations