use of org.springframework.integration.file.remote.FileInfo in project spring-integration by spring-projects.
the class FtpOutboundTests method testFtpOutboundGatewayInsideChain.
// INT-2275
@Test
public void testFtpOutboundGatewayInsideChain() throws Exception {
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("FtpOutboundInsideChainTests-context.xml", getClass());
MessageChannel channel = context.getBean("ftpOutboundGatewayInsideChain", MessageChannel.class);
channel.send(MessageBuilder.withPayload("remote-test-dir").build());
PollableChannel output = context.getBean("output", PollableChannel.class);
Message<?> result = output.receive();
Object payload = result.getPayload();
assertTrue(payload instanceof List<?>);
@SuppressWarnings("unchecked") List<? extends FileInfo<?>> remoteFiles = (List<? extends FileInfo<?>>) payload;
assertEquals(3, remoteFiles.size());
List<String> files = Arrays.asList(new File("remote-test-dir").list());
for (FileInfo<?> remoteFile : remoteFiles) {
assertTrue(files.contains(remoteFile.getFilename()));
}
context.close();
}
use of org.springframework.integration.file.remote.FileInfo in project spring-integration by spring-projects.
the class SftpOutboundTests method testFtpOutboundGatewayInsideChain.
// INT-2275
@Test
public void testFtpOutboundGatewayInsideChain() throws Exception {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("SftpOutboundInsideChainTests-context.xml", getClass());
MessageChannel channel = context.getBean("outboundGatewayInsideChain", MessageChannel.class);
channel.send(MessageBuilder.withPayload("remote-test-dir").build());
PollableChannel output = context.getBean("replyChannel", PollableChannel.class);
Message<?> result = output.receive();
Object payload = result.getPayload();
assertTrue(payload instanceof List<?>);
@SuppressWarnings("unchecked") List<? extends FileInfo<?>> remoteFiles = (List<? extends FileInfo<?>>) payload;
assertEquals(3, remoteFiles.size());
List<String> files = Arrays.asList(new File("remote-test-dir").list());
for (FileInfo<?> remoteFile : remoteFiles) {
assertTrue(files.contains(remoteFile.getFilename()));
}
context.close();
}
Aggregations