public void runDemo() throws Exception{
ConfigurableApplicationContext ctx =
new ClassPathXmlApplicationContext("META-INF/spring/integration/FtpOutboundChannelAdapterSample-context.xml");
MessageChannel ftpChannel = ctx.getBean("ftpChannel", MessageChannel.class);
baseFolder.mkdirs();
final File fileToSendA = new File(baseFolder, "a.txt");
final File fileToSendB = new File(baseFolder, "b.txt");
final InputStream inputStreamA = FtpOutboundChannelAdapterSample.class.getResourceAsStream("/test-files/a.txt");
final InputStream inputStreamB = FtpOutboundChannelAdapterSample.class.getResourceAsStream("/test-files/b.txt");
FileUtils.copyInputStreamToFile(inputStreamA, fileToSendA);
FileUtils.copyInputStreamToFile(inputStreamB, fileToSendB);
assertTrue(fileToSendA.exists());
assertTrue(fileToSendB.exists());
final Message<File> messageA = MessageBuilder.withPayload(fileToSendA).build();
final Message<File> messageB = MessageBuilder.withPayload(fileToSendB).build();
ftpChannel.send(messageA);
ftpChannel.send(messageB);
Thread.sleep(2000);
assertTrue(new File(TestSuite.FTP_ROOT_DIR + File.separator + "a.txt").exists());
assertTrue(new File(TestSuite.FTP_ROOT_DIR + File.separator + "b.txt").exists());