INT-1864 added inbound SFTP test for default adapter configuration (should have CachingSessionFactory)

This commit is contained in:
Mark Fisher
2011-04-29 11:24:18 -04:00
parent 88fab8d2ca
commit f10fcc2dd5
2 changed files with 18 additions and 0 deletions

View File

@@ -31,8 +31,18 @@
<beans:property name="user" value="oleg"/>
</beans:bean>
<sftp:inbound-channel-adapter id="defaultAdapter"
session-factory="sftpSessionFactory"
channel="requestChannel"
remote-directory="/foo"
local-directory="file:local-test-dir"
auto-startup="false">
<poller fixed-rate="1000"/>
</sftp:inbound-channel-adapter>
<sftp:inbound-channel-adapter id="cachingAdapter"
session-factory="sftpSessionFactory"
cache-sessions="true"
channel="requestChannel"
remote-directory="/foo"
local-directory="file:local-test-dir"

View File

@@ -35,11 +35,19 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
public class InboundChannelAdapterParserCachingTests {
@Autowired private Object defaultAdapter;
@Autowired private Object cachingAdapter;
@Autowired private Object nonCachingAdapter;
@Test
public void defaultAdapter() {
Object sessionFactory = TestUtils.getPropertyValue(defaultAdapter, "source.synchronizer.sessionFactory");
assertEquals(CachingSessionFactory.class, sessionFactory.getClass());
}
@Test
public void cachingAdapter() {
Object sessionFactory = TestUtils.getPropertyValue(cachingAdapter, "source.synchronizer.sessionFactory");