AC.close() in file and ftp tests
This commit is contained in:
@@ -10,7 +10,8 @@ import java.io.FileWriter;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
|
||||
@@ -42,13 +43,14 @@ public class FileProcessingTest {
|
||||
out.close();
|
||||
}
|
||||
logger.info("Populated directory with files");
|
||||
Thread.sleep(5000);
|
||||
Thread.sleep(2000);
|
||||
logger.info("Starting Spring Integration Sequential File processing");
|
||||
ApplicationContext ac = new ClassPathXmlApplicationContext("META-INF/spring/integration/sequentialFileProcessing-config.xml");
|
||||
ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("META-INF/spring/integration/sequentialFileProcessing-config.xml");
|
||||
PollableChannel filesOutChannel = ac.getBean("filesOutChannel", PollableChannel.class);
|
||||
for (int i = 0; i < fileCount; i++) {
|
||||
logger.info("Finished processing " + filesOutChannel.receive(20000).getPayload());
|
||||
logger.info("Finished processing " + filesOutChannel.receive(10000).getPayload());
|
||||
}
|
||||
ac.stop();
|
||||
}
|
||||
@Test
|
||||
public void testConcurrentFileProcessing() throws Exception {
|
||||
@@ -63,10 +65,11 @@ public class FileProcessingTest {
|
||||
logger.info("Populated directory with files");
|
||||
Thread.sleep(2000);
|
||||
logger.info("Starting Spring Integration Sequential File processing");
|
||||
ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/concurrentFileProcessing-config.xml");
|
||||
ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/concurrentFileProcessing-config.xml");
|
||||
PollableChannel filesOutChannel = ac.getBean("filesOutChannel", PollableChannel.class);
|
||||
for (int i = 0; i < fileCount; i++) {
|
||||
logger.info("Finished processing " + filesOutChannel.receive(10000).getPayload());
|
||||
}
|
||||
ac.stop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user