Upgrade Zip sample to the latest dependencies

This commit is contained in:
Artem Bilan
2022-03-21 14:20:49 -04:00
parent c60ee82b27
commit 1e2000a73b
5 changed files with 34 additions and 35 deletions

View File

@@ -39,7 +39,8 @@ public final class Main {
private static final Log LOGGER = LogFactory.getLog(Main.class);
private Main() { }
private Main() {
}
/**
* Load the Spring Integration Application Context
@@ -50,13 +51,13 @@ public final class Main {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("\n========================================================="
+ "\n "
+ "\n Welcome to the Spring Integration Zip Sample "
+ "\n "
+ "\n For more information please visit: "
+ "\n https://www.springsource.org/spring-integration "
+ "\n "
+ "\n=========================================================" );
+ "\n "
+ "\n Welcome to the Spring Integration Zip Sample "
+ "\n "
+ "\n For more information please visit: "
+ "\n https://www.springsource.org/spring-integration "
+ "\n "
+ "\n=========================================================");
}
final AbstractApplicationContext context =
@@ -70,23 +71,21 @@ public final class Main {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("\n========================================================="
+ "\n "
+ "\n Please press 'q + Enter' to quit the application. "
+ "\n "
+ "\n=========================================================" );
+ "\n "
+ "\n Please press 'q + Enter' to quit the application. "
+ "\n "
+ "\n=========================================================");
}
while (!scanner.hasNext("q")) {
//Do nothing unless user presses 'q' to quit.
while (true) {
if (scanner.hasNext("q")) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Exiting application...bye.");
}
scanner.close();
System.exit(0);
}
}
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Exiting application...bye.");
}
scanner.close();
System.exit(0);
}
}

View File

@@ -50,9 +50,9 @@ public final class SpringIntegrationUtils {
*/
public static void displayDirectories(final ApplicationContext context) {
final Map<String, FileReadingMessageSource> fileReadingMessageSources = context.getBeansOfType(FileReadingMessageSource.class);
Map<String, FileReadingMessageSource> fileReadingMessageSources = context.getBeansOfType(FileReadingMessageSource.class);
final List<String> inputDirectories = new ArrayList<String>();
List<String> inputDirectories = new ArrayList<>();
for (FileReadingMessageSource source : fileReadingMessageSources.values()) {
final File inDir = (File) new DirectFieldAccessor(source).getPropertyValue("directory");
@@ -60,9 +60,9 @@ public final class SpringIntegrationUtils {
}
final Map<String, FileWritingMessageHandler> fileWritingMessageHandlers = context.getBeansOfType(FileWritingMessageHandler.class);
Map<String, FileWritingMessageHandler> fileWritingMessageHandlers = context.getBeansOfType(FileWritingMessageHandler.class);
final List<String> outputDirectories = new ArrayList<String>();
List<String> outputDirectories = new ArrayList<>();
for (final FileWritingMessageHandler messageHandler : fileWritingMessageHandlers.values()) {
final Expression outDir = (Expression) new DirectFieldAccessor(messageHandler).getPropertyValue("destinationDirectoryExpression");

View File

@@ -32,7 +32,7 @@ import org.springframework.integration.samples.zip.SpringIntegrationUtils;
public class SpringIntegrationProjectStartupTest {
@Test
public void testStartupOfSpringInegrationContext() throws Exception{
public void testStartupOfSpringIntegrationContext() throws Exception{
final ApplicationContext context
= new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml",
SpringIntegrationProjectStartupTest.class);