INT-1263, more MessageHistory changes FTP, SFTP etc.

This commit is contained in:
Oleg Zhurakousky
2010-09-23 09:45:01 -04:00
parent 47befb16f3
commit 32efbae90d
25 changed files with 213 additions and 112 deletions

View File

@@ -20,6 +20,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.Properties;
import java.util.Set;
import junit.framework.Assert;
@@ -36,6 +37,7 @@ 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.integration.test.util.TestUtils;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -98,7 +100,10 @@ public class EventInboundChannelAdapterParserTests {
context.publishEvent(new SampleEvent("hello"));
Message<?> message = channel.receive(0);
MessageHistory history = MessageHistory.read(message);
assertTrue(history.containsComponent("eventAdapterSimple"));
assertNotNull(history);
Properties componentHistoryRecord = TestUtils.locateComponentInHistory(history, "eventAdapterSimple", 0);
assertNotNull(componentHistoryRecord);
assertEquals("event:inbound-channel-adapter", componentHistoryRecord.get("type"));
assertNotNull(message);
assertEquals(SampleEvent.class, message.getPayload().getClass());
}