use of org.springframework.integration.ftp.session.DefaultFtpSessionFactory in project spring-integration-samples by spring-projects.
the class Application method ftp2.
@Bean
public SessionFactory<FTPFile> ftp2() {
DefaultFtpSessionFactory ftp = new DefaultFtpSessionFactory();
ftp.setHost("host3");
ftp.setUsername("user");
ftp.setPassword("ftp");
return ftp;
}
use of org.springframework.integration.ftp.session.DefaultFtpSessionFactory in project spring-integration by spring-projects.
the class FtpOutboundChannelAdapterParserTests method testFtpOutboundChannelAdapterComplete.
@Test
public void testFtpOutboundChannelAdapterComplete() throws Exception {
assertEquals(ftpChannel, TestUtils.getPropertyValue(ftpOutbound, "inputChannel"));
assertEquals("ftpOutbound", ftpOutbound.getComponentName());
FileTransferringMessageHandler<?> handler = TestUtils.getPropertyValue(ftpOutbound, "handler", FileTransferringMessageHandler.class);
String remoteFileSeparator = (String) TestUtils.getPropertyValue(handler, "remoteFileTemplate.remoteFileSeparator");
assertNotNull(remoteFileSeparator);
assertEquals(".foo", TestUtils.getPropertyValue(handler, "remoteFileTemplate.temporaryFileSuffix", String.class));
assertEquals("", remoteFileSeparator);
assertEquals(this.fileNameGenerator, TestUtils.getPropertyValue(handler, "remoteFileTemplate.fileNameGenerator"));
assertEquals("UTF-8", TestUtils.getPropertyValue(handler, "remoteFileTemplate.charset"));
assertNotNull(TestUtils.getPropertyValue(handler, "remoteFileTemplate.directoryExpressionProcessor"));
assertNotNull(TestUtils.getPropertyValue(handler, "remoteFileTemplate.temporaryDirectoryExpressionProcessor"));
assertEquals(FtpRemoteFileTemplate.ExistsMode.NLST, TestUtils.getPropertyValue(handler, "remoteFileTemplate.existsMode"));
Object sfProperty = TestUtils.getPropertyValue(handler, "remoteFileTemplate.sessionFactory");
assertEquals(DefaultFtpSessionFactory.class, sfProperty.getClass());
DefaultFtpSessionFactory sessionFactory = (DefaultFtpSessionFactory) sfProperty;
assertEquals("localhost", TestUtils.getPropertyValue(sessionFactory, "host"));
assertEquals(22, TestUtils.getPropertyValue(sessionFactory, "port"));
assertEquals(23, TestUtils.getPropertyValue(handler, "order"));
// verify subscription order
Object dispatcher = TestUtils.getPropertyValue(ftpChannel, "dispatcher");
@SuppressWarnings("unchecked") Set<MessageHandler> handlers = (Set<MessageHandler>) TestUtils.getPropertyValue(dispatcher, "handlers");
Iterator<MessageHandler> iterator = handlers.iterator();
assertSame(TestUtils.getPropertyValue(this.ftpOutbound2, "handler"), iterator.next());
assertSame(handler, iterator.next());
assertEquals(FileExistsMode.APPEND, TestUtils.getPropertyValue(ftpOutbound, "handler.mode"));
}
use of org.springframework.integration.ftp.session.DefaultFtpSessionFactory in project spring-integration-samples by spring-projects.
the class Application method ftp1.
@Bean
public SessionFactory<FTPFile> ftp1() {
DefaultFtpSessionFactory ftp = new DefaultFtpSessionFactory();
ftp.setHost("host3");
ftp.setUsername("user");
ftp.setPassword("ftp");
return ftp;
}
use of org.springframework.integration.ftp.session.DefaultFtpSessionFactory in project spring-integration-samples by spring-projects.
the class Application method ftp3.
@Bean
public SessionFactory<FTPFile> ftp3() {
DefaultFtpSessionFactory ftp = new DefaultFtpSessionFactory();
ftp.setHost("host3");
ftp.setUsername("user");
ftp.setPassword("ftp");
return ftp;
}
use of org.springframework.integration.ftp.session.DefaultFtpSessionFactory in project spring-integration by spring-projects.
the class FtpTestSupport method sessionFactory.
public static SessionFactory<FTPFile> sessionFactory() {
DefaultFtpSessionFactory sf = new DefaultFtpSessionFactory();
sf.setHost("localhost");
sf.setPort(port);
sf.setUsername("foo");
sf.setPassword("foo");
sf.setClientMode(FTPClient.PASSIVE_LOCAL_DATA_CONNECTION_MODE);
return new CachingSessionFactory<FTPFile>(sf);
}
Aggregations