From 51f33d2724703854cd27ff1840a61fcb9ad6f8f9 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Mon, 19 Dec 2011 23:13:00 -0500 Subject: [PATCH] removing test warnings --- .../ftp/config/FtpsOutboundChannelAdapterParserTests.java | 7 ++++--- .../sftp/config/OutboundChannelAdapterParserTests.java | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpsOutboundChannelAdapterParserTests.java b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpsOutboundChannelAdapterParserTests.java index 96f9d184b3..1cb550f5aa 100644 --- a/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpsOutboundChannelAdapterParserTests.java +++ b/spring-integration-ftp/src/test/java/org/springframework/integration/ftp/config/FtpsOutboundChannelAdapterParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 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. @@ -47,9 +47,10 @@ public class FtpsOutboundChannelAdapterParserTests { assertEquals(ac.getBean("fileNameGenerator"), TestUtils.getPropertyValue(handler, "fileNameGenerator")); assertEquals("UTF-8", TestUtils.getPropertyValue(handler, "charset")); assertNotNull(TestUtils.getPropertyValue(handler, "temporaryDirectory")); - CachingSessionFactory cacheSf = (CachingSessionFactory) TestUtils.getPropertyValue(handler, "sessionFactory"); - DefaultFtpsSessionFactory sf = (DefaultFtpsSessionFactory) TestUtils.getPropertyValue(cacheSf, "sessionFactory"); + CachingSessionFactory cacheSf = TestUtils.getPropertyValue(handler, "sessionFactory", CachingSessionFactory.class); + DefaultFtpsSessionFactory sf = TestUtils.getPropertyValue(cacheSf, "sessionFactory", DefaultFtpsSessionFactory.class); assertEquals("localhost", TestUtils.getPropertyValue(sf, "host")); assertEquals(22, TestUtils.getPropertyValue(sf, "port")); } + } diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests.java index ed3609a062..eeb6af082a 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests.java @@ -46,14 +46,13 @@ import org.springframework.integration.test.util.TestUtils; /** * @author Oleg Zhurakousky * @author Gary Russell - * */ public class OutboundChannelAdapterParserTests { @Test public void testOutboundChannelAdapterWithId(){ ApplicationContext context = - new ClassPathXmlApplicationContext("OutboundChannelAdapterParserTests-context.xml", this.getClass()); + new ClassPathXmlApplicationContext("OutboundChannelAdapterParserTests-context.xml", this.getClass()); Object consumer = context.getBean("sftpOutboundAdapter"); assertTrue(consumer instanceof EventDrivenConsumer); PublishSubscribeChannel channel = context.getBean("inputChannel", PublishSubscribeChannel.class); @@ -71,8 +70,8 @@ public class OutboundChannelAdapterParserTests { assertEquals(context.getBean("fileNameGenerator"), TestUtils.getPropertyValue(handler, "fileNameGenerator")); assertEquals("UTF-8", TestUtils.getPropertyValue(handler, "charset")); assertNotNull(TestUtils.getPropertyValue(handler, "temporaryDirectory")); - CachingSessionFactory sessionFactory = (CachingSessionFactory) TestUtils.getPropertyValue(handler, "sessionFactory"); - DefaultSftpSessionFactory clientFactory = (DefaultSftpSessionFactory) TestUtils.getPropertyValue(sessionFactory, "sessionFactory"); + CachingSessionFactory sessionFactory = TestUtils.getPropertyValue(handler, "sessionFactory", CachingSessionFactory.class); + DefaultSftpSessionFactory clientFactory = TestUtils.getPropertyValue(sessionFactory, "sessionFactory", DefaultSftpSessionFactory.class); assertEquals("localhost", TestUtils.getPropertyValue(clientFactory, "host")); assertEquals(2222, TestUtils.getPropertyValue(clientFactory, "port")); assertEquals(23, TestUtils.getPropertyValue(handler, "order"));