diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpClientPool.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpClientPool.java index fba9db74ec..ebf0c816f8 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpClientPool.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpClientPool.java @@ -24,7 +24,7 @@ import org.apache.commons.net.ftp.FTPClient; * * @author Iwein Fuld */ -public interface FtpClientPool extends FtpClientFactory { +public interface FtpClientPool extends FtpClientFactory { /** * Releases the client back to the pool. When calling this method the caller diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpSendingMessageHandlerFactoryBean.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpSendingMessageHandlerFactoryBean.java index f439089e06..25321e32a0 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpSendingMessageHandlerFactoryBean.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/FtpSendingMessageHandlerFactoryBean.java @@ -16,14 +16,8 @@ package org.springframework.integration.ftp; -import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.AbstractFactoryBean; -import org.springframework.context.ApplicationContext; -import org.springframework.context.ApplicationContextAware; -import org.springframework.context.ResourceLoaderAware; - -import org.springframework.core.io.ResourceLoader; import org.springframework.integration.file.FileNameGenerator; /** @@ -33,8 +27,7 @@ import org.springframework.integration.file.FileNameGenerator; * @author Iwein Fuld * @author Josh Long */ -public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean - implements ResourceLoaderAware, ApplicationContextAware { +public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean { protected int port; @@ -52,12 +45,8 @@ public class FtpSendingMessageHandlerFactoryBean extends AbstractFactoryBean getObjectType() { return FtpSendingMessageHandler.class; diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpMessageHistoryTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpMessageHistoryTests.java index 7c9d4a474c..dff651b82f 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpMessageHistoryTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpMessageHistoryTests.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.integration.ftp; import static junit.framework.Assert.assertEquals; diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpParserOutboundTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpParserOutboundTests.java index 4a59d2e96a..73820956ff 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpParserOutboundTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/FtpParserOutboundTests.java @@ -13,22 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.springframework.integration.ftp; import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertTrue; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import java.io.File; - -import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.springframework.beans.factory.BeanCreationException; -import org.springframework.context.ApplicationContext; + import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.Message; import org.springframework.integration.endpoint.EventDrivenConsumer; @@ -38,29 +33,26 @@ import org.springframework.integration.test.util.TestUtils; /** * @author Oleg Zhurakousky - * */ public class FtpParserOutboundTests { - @Test public void testFtpOutboundWithFileGenerator() throws Exception{ ClassPathXmlApplicationContext context = - new ClassPathXmlApplicationContext("FtpParserOutboundTests-context.xml", this.getClass()); - + new ClassPathXmlApplicationContext("FtpParserOutboundTests-context.xml", this.getClass()); FileNameGenerator fileNameGenerator = context.getBean("fileNameGenerator", FileNameGenerator.class); assertNotNull(fileNameGenerator); when(fileNameGenerator.generateFileName(Mockito.any(Message.class))).thenReturn("oleg-ftp-test.txt"); - EventDrivenConsumer fileOutboundEndpoint = context.getBean("ftpOutboundAdapter", EventDrivenConsumer.class); FtpSendingMessageHandler handler = (FtpSendingMessageHandler) TestUtils.getPropertyValue(fileOutboundEndpoint, "handler"); Message message = new GenericMessage("ftp file generator test"); try { handler.handleMessage(message); - } catch (Exception e) { + } + catch (Exception e) { // ignore } verify(fileNameGenerator, times(1)).generateFileName(message); } - -} \ No newline at end of file + +} diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpExample.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpExample.java index 9a01ff1100..7eaf49f808 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpExample.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpExample.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.integration.ftp; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -10,7 +26,9 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; * @author Josh Long */ public class OutboundFtpExample { + public static void main(String[] args) throws Throwable { - ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("outbound-ftp-context.xml"); + new ClassPathXmlApplicationContext("outbound-ftp-context.xml"); } + } diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpsExample.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpsExample.java index 3fe0060c53..73829b24df 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpsExample.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/OutboundFtpsExample.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.integration.ftp; import org.springframework.context.support.ClassPathXmlApplicationContext; @@ -10,7 +26,9 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; * @author Josh Long */ public class OutboundFtpsExample { + public static void main(String[] args) throws Throwable { - ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("outbound-ftps-context.xml"); + new ClassPathXmlApplicationContext("outbound-ftps-context.xml"); } + }