List of usage examples for org.springframework.integration.file.remote.session CachingSessionFactory setSessionWaitTimeout
public void setSessionWaitTimeout(long sessionWaitTimeout)
From source file:org.springframework.integration.ftp.session.SessionFactoryTests.java
@Test(expected = MessagingException.class) // timeout expire public void testSessionWaitExpire() throws Exception { SessionFactory sessionFactory = Mockito.mock(SessionFactory.class); Session session = Mockito.mock(Session.class); Mockito.when(sessionFactory.getSession()).thenReturn(session); CachingSessionFactory cachingFactory = new CachingSessionFactory(sessionFactory, 2); cachingFactory.setSessionWaitTimeout(3000); cachingFactory.getSession();//w w w . j ava 2s . c o m cachingFactory.getSession(); cachingFactory.getSession(); }