INT-1263, added more changes and tests related valdating MessageHistory in every module

This commit is contained in:
Oleg Zhurakousky
2010-09-22 18:44:51 -04:00
parent dee91f6871
commit b6e058c59b
46 changed files with 367 additions and 114 deletions

View File

@@ -9,6 +9,8 @@
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-event="http://www.springframework.org/schema/integration/event">
<int:message-history/>
<int-event:inbound-channel-adapter id="eventAdapterSimple" channel="input"/>
<int:channel id="input">

View File

@@ -35,6 +35,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.integration.Message;
import org.springframework.integration.core.PollableChannel;
import org.springframework.integration.event.ApplicationEventInboundChannelAdapter;
import org.springframework.integration.history.MessageHistory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -91,11 +92,13 @@ public class EventInboundChannelAdapterParserTests {
}
@Test
public void validateUsage() {
public void validateUsageWithHistory() {
PollableChannel channel = context.getBean("input", PollableChannel.class);
assertEquals(ContextRefreshedEvent.class, channel.receive(0).getPayload().getClass());
context.publishEvent(new SampleEvent("hello"));
Message<?> message = channel.receive(0);
MessageHistory history = MessageHistory.read(message);
assertTrue(history.containsComponent("eventAdapterSimple"));
assertNotNull(message);
assertEquals(SampleEvent.class, message.getPayload().getClass());
}