diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.groovy b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.groovy index 97a32ce063..06a775dfb2 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.groovy +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223FilterTests.groovy @@ -1 +1 @@ -headers.type == 'good' \ No newline at end of file +headers.type == 'good' diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223HeaderEnricherTests.rb b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223HeaderEnricherTests.rb index 06eec2de64..0e89115cb4 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223HeaderEnricherTests.rb +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223HeaderEnricherTests.rb @@ -1 +1 @@ -"jruby" \ No newline at end of file +"jruby" diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.java b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.java index 801f1ed105..518e8f50d4 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.java +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.java @@ -16,6 +16,8 @@ package org.springframework.integration.scripting.config.jsr223; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; @@ -26,18 +28,17 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -import org.hamcrest.Matchers; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageChannel; import org.springframework.integration.channel.QueueChannel; import org.springframework.integration.scripting.ScriptVariableGenerator; import org.springframework.integration.support.MessageBuilder; +import org.springframework.messaging.Message; +import org.springframework.messaging.MessageChannel; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -132,13 +133,13 @@ public class Jsr223ServiceActivatorTests { } String payload = (String) replyChannel.receive(0).getPayload(); - assertThat(payload, Matchers.startsWith("inline-test-1 - FOO")); + assertThat(payload, startsWith("inline-test-1 - FOO")); payload = (String) replyChannel.receive(0).getPayload(); - assertThat(payload, Matchers.startsWith("inline-test-2 - FOO")); + assertThat(payload, startsWith("inline-test-2 - FOO")); payload = (String) replyChannel.receive(0).getPayload(); - assertThat(payload, Matchers.startsWith("inline-test-3 - FOO")); + assertThat(payload, startsWith("inline-test-3 - FOO")); assertTrue(payload.substring(payload.indexOf(":") + 1).matches(".+\\d{2}:\\d{2}:\\d{2}.+")); assertNull(replyChannel.receive(0)); @@ -148,26 +149,30 @@ public class Jsr223ServiceActivatorTests { @Test public void variablesAndScriptVariableGenerator() throws Exception { try { - new ClassPathXmlApplicationContext("Jsr223ServiceActivatorTests-fail-withgenerator-context.xml", this.getClass()); + new ClassPathXmlApplicationContext("Jsr223ServiceActivatorTests-fail-withgenerator-context.xml", + this.getClass()).close(); fail("BeansException expected."); } catch (BeansException e) { - assertThat(e.getMessage(), Matchers.containsString("'script-variable-generator' and 'variable' sub-elements are mutually exclusive.")); + assertThat(e.getMessage(), + containsString("'script-variable-generator' and 'variable' sub-elements are mutually exclusive.")); } } @Test public void testDuplicateVariable() throws Exception { try { - new ClassPathXmlApplicationContext("Jsr223ServiceActivatorTests-fail-duplicated-variable-context.xml", this.getClass()); + new ClassPathXmlApplicationContext("Jsr223ServiceActivatorTests-fail-duplicated-variable-context.xml", + this.getClass()).close(); fail("BeansException expected."); } catch (BeansException e) { - assertThat(e.getMessage(), Matchers.containsString("Duplicated variable: foo")); + assertThat(e.getMessage(), containsString("Duplicated variable: foo")); } } public static class SampleScriptVariSource implements ScriptVariableGenerator { + @Override public Map generateScriptVariables(Message message) { Map variables = new HashMap(); variables.put("foo", "foo"); diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.rb b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.rb index acfd82fda6..e181372d9f 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.rb +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223ServiceActivatorTests.rb @@ -1 +1 @@ -"ruby-#{payload}-#{foo} - #{bar} - #{date}" \ No newline at end of file +"ruby-#{payload}-#{foo} - #{bar} - #{date}" diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.groovy b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.groovy index aa257f1603..803d916e18 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.groovy +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223SplitterTests.groovy @@ -1 +1 @@ -payload.split(',') \ No newline at end of file +payload.split(',') diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.rb b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.rb index c20fd7795c..07c8943464 100644 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.rb +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/config/jsr223/Jsr223TransformerTests.rb @@ -4,4 +4,4 @@ class Transformer end end -Transformer.new.transform(payload) \ No newline at end of file +Transformer.new.transform(payload) diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/hello.rb b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/hello.rb index ca4e0e0c39..826fe8c68b 100755 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/hello.rb +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/hello.rb @@ -6,4 +6,4 @@ class RubyHello "hello,world" end end -RubyHello.new \ No newline at end of file +RubyHello.new diff --git a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/print_message.rb b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/print_message.rb index 959a3fd606..cffae5fa89 100755 --- a/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/print_message.rb +++ b/spring-integration-scripting/src/test/java/org/springframework/integration/scripting/jsr223/print_message.rb @@ -9,4 +9,4 @@ if headers headers.each {|key, value| puts "#{key} is #{value}" } end puts "#{$one} #{$two} #{$three}" -payload \ No newline at end of file +payload diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/TestInboundSftp.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/TestInboundSftp.java deleted file mode 100644 index b68437b4de..0000000000 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/TestInboundSftp.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2002-2016 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.sftp; - -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * @author Josh Long - * @author Gary Russell - */ -public class TestInboundSftp { - - private TestInboundSftp() { - super(); - } - - static public void main(String[] args) throws Throwable { - ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("TestInboundSftp.xml"); - classPathXmlApplicationContext.start(); - } -} diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserCachingTests-context.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserCachingTests-context.xml index be66345274..d2e1ab943e 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserCachingTests-context.xml +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserCachingTests-context.xml @@ -20,7 +20,7 @@ - + @@ -57,5 +57,5 @@ auto-startup="false"> - + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail-autocreate.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail-autocreate.xml index ba1d6d1c08..c80b5b915d 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail-autocreate.xml +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail-autocreate.xml @@ -18,7 +18,7 @@ http://www.springframework.org/schema/integration/sftp http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd"> - + @@ -28,7 +28,7 @@ - + - + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail.xml index 108003364f..1eaa73e357 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail.xml +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapterParserTests-context-fail.xml @@ -18,7 +18,7 @@ http://www.springframework.org/schema/integration/sftp http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd"> - + @@ -28,7 +28,7 @@ - + - + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/MessageHistory-context.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/MessageHistory-context.xml index d61fc7492f..fd8d5bdf67 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/MessageHistory-context.xml +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/MessageHistory-context.xml @@ -18,7 +18,7 @@ http://www.springframework.org/schema/integration/sftp http://www.springframework.org/schema/integration/sftp/spring-integration-sftp.xsd"> - + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests-context-fail.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests-context-fail.xml index ea04965ae5..4ef550806f 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests-context-fail.xml +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/OutboundChannelAdapterParserTests-context-fail.xml @@ -16,9 +16,9 @@ - + - + - - + + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpInboundAutostartup-context.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpInboundAutostartup-context.xml index 28bd273fe8..776323d175 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpInboundAutostartup-context.xml +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpInboundAutostartup-context.xml @@ -16,11 +16,11 @@ - + - + - + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpMessageHistoryTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpMessageHistoryTests.java index 484ae8f252..01c6bf7083 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpMessageHistoryTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpMessageHistoryTests.java @@ -19,21 +19,25 @@ package org.springframework.integration.sftp.config; import static org.junit.Assert.assertEquals; import org.junit.Test; -import org.springframework.context.ApplicationContext; + import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.integration.endpoint.SourcePollingChannelAdapter; /** * @author Oleg Zhurakousky * @author Gunnar Hillert + * @author Gary Russell */ public class SftpMessageHistoryTests { @Test public void testMessageHistoryCompliance() { - ApplicationContext ac = new ClassPathXmlApplicationContext("MessageHistory-context.xml", SftpMessageHistoryTests.class); + ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("MessageHistory-context.xml", + SftpMessageHistoryTests.class); SourcePollingChannelAdapter spca = ac.getBean("sftpAdapter", SourcePollingChannelAdapter.class); assertEquals("sftpAdapter", spca.getComponentName()); assertEquals("sftp:inbound-channel-adapter", spca.getComponentType()); + ac.close(); } + } diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundTransferSample-ignored.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundTransferSample-ignored.xml index 483df85381..90321cfb70 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundTransferSample-ignored.xml +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/SftpOutboundTransferSample-ignored.xml @@ -15,9 +15,9 @@ - + - + - + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/sftp.properties b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/sftp.properties index 3a9061aa89..9f4aeb1e30 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/sftp.properties +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/sftp.properties @@ -1 +1 @@ -delete.remote.files=false \ No newline at end of file +delete.remote.files=false diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/filters/SftpPersistentAcceptOnceFileListFilterTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/filters/SftpPersistentAcceptOnceFileListFilterTests.java index ea5122c385..abe5d83932 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/filters/SftpPersistentAcceptOnceFileListFilterTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/filters/SftpPersistentAcceptOnceFileListFilterTests.java @@ -64,6 +64,7 @@ public class SftpPersistentAcceptOnceFileListFilterTests { assertEquals("baz", now.get(1).getFilename()); now = filter.filterFiles(files); assertEquals(0, now.size()); + filter.close(); } @Test @@ -82,6 +83,7 @@ public class SftpPersistentAcceptOnceFileListFilterTests { assertEquals(2, now.size()); assertEquals("foo", now.get(0).getFilename()); assertEquals("bar", now.get(1).getFilename()); + filter.close(); } } diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java index f898179b68..bf26106a67 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java @@ -46,7 +46,6 @@ import org.mockito.stubbing.Answer; import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.BeanFactory; -import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.expression.common.LiteralExpression; import org.springframework.integration.file.DefaultFileNameGenerator; @@ -163,17 +162,20 @@ public class SftpOutboundTests { File destFile = new File(targetDir, srcFile.getName()); destFile.deleteOnExit(); - ApplicationContext context = new ClassPathXmlApplicationContext("SftpOutboundInsideChainTests-context.xml", getClass()); + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "SftpOutboundInsideChainTests-context.xml", getClass()); MessageChannel channel = context.getBean("outboundChannelAdapterInsideChain", MessageChannel.class); channel.send(new GenericMessage(srcFile)); assertTrue("destination file was not created", destFile.exists()); + context.close(); } @Test //INT-2275 public void testFtpOutboundGatewayInsideChain() throws Exception { - ApplicationContext context = new ClassPathXmlApplicationContext("SftpOutboundInsideChainTests-context.xml", getClass()); + ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( + "SftpOutboundInsideChainTests-context.xml", getClass()); MessageChannel channel = context.getBean("outboundGatewayInsideChain", MessageChannel.class); @@ -191,6 +193,7 @@ public class SftpOutboundTests { for (FileInfo remoteFile : remoteFiles) { assertTrue(files.contains(remoteFile.getFilename())); } + context.close(); } @Test //INT-2954 diff --git a/spring-integration-sftp/src/test/resources/TestInboundSftp.xml b/spring-integration-sftp/src/test/resources/TestInboundSftp.xml deleted file mode 100644 index a296e93de1..0000000000 --- a/spring-integration-sftp/src/test/resources/TestInboundSftp.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-integration-sftp/src/test/resources/TestOutboundSftp.xml b/spring-integration-sftp/src/test/resources/TestOutboundSftp.xml deleted file mode 100644 index 801c23ad86..0000000000 --- a/spring-integration-sftp/src/test/resources/TestOutboundSftp.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java index cb0fcb9b97..28869548bb 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleInboundChannelAdapterParserTests.java @@ -72,6 +72,7 @@ public class ConsoleInboundChannelAdapterParserTests { Message message = source.receive(); assertNotNull(message); assertEquals("foo", message.getPayload()); + context.close(); } @Test @@ -92,14 +93,15 @@ public class ConsoleInboundChannelAdapterParserTests { Message message = source.receive(); assertNotNull(message); assertEquals("foo", message.getPayload()); + context.close(); } @Test public void testConsoleSourceWithInvalidCharset() { BeanCreationException beanCreationException = null; try { - new ClassPathXmlApplicationContext( - "invalidConsoleInboundChannelAdapterParserTests.xml", ConsoleInboundChannelAdapterParserTests.class); + new ClassPathXmlApplicationContext("invalidConsoleInboundChannelAdapterParserTests.xml", + ConsoleInboundChannelAdapterParserTests.class).close(); } catch (BeanCreationException e) { beanCreationException = e; diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java index 259b980274..682c38e8b7 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/ConsoleOutboundChannelAdapterParserTests.java @@ -33,17 +33,18 @@ import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; + import org.springframework.beans.DirectFieldAccessor; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.messaging.MessageChannel; -import org.springframework.messaging.MessageHandler; import org.springframework.integration.handler.MessageHandlerChain; -import org.springframework.messaging.support.GenericMessage; import org.springframework.integration.stream.CharacterStreamWritingMessageHandler; import org.springframework.integration.test.util.TestUtils; +import org.springframework.messaging.MessageChannel; +import org.springframework.messaging.MessageHandler; +import org.springframework.messaging.support.GenericMessage; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -127,8 +128,8 @@ public class ConsoleOutboundChannelAdapterParserTests { public void stdoutAdapterWithInvalidCharset() { BeanCreationException beanCreationException = null; try { - new ClassPathXmlApplicationContext( - "invalidConsoleOutboundChannelAdapterParserTests.xml", ConsoleOutboundChannelAdapterParserTests.class); + new ClassPathXmlApplicationContext("invalidConsoleOutboundChannelAdapterParserTests.xml", + ConsoleOutboundChannelAdapterParserTests.class).close(); } catch (BeanCreationException e) { beanCreationException = e; diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/consoleInboundChannelAdapterParserTests.xml b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/consoleInboundChannelAdapterParserTests.xml index 4d9857597f..d8c25cf996 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/consoleInboundChannelAdapterParserTests.xml +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/consoleInboundChannelAdapterParserTests.xml @@ -9,7 +9,7 @@ http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd"> - + @@ -18,4 +18,4 @@ - \ No newline at end of file + diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleInboundChannelAdapterParserTests.xml b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleInboundChannelAdapterParserTests.xml index 1f6340b619..79c8ca0baa 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleInboundChannelAdapterParserTests.xml +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleInboundChannelAdapterParserTests.xml @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleOutboundChannelAdapterParserTests.xml b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleOutboundChannelAdapterParserTests.xml index 19f388df4f..2018bcf6f9 100644 --- a/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleOutboundChannelAdapterParserTests.xml +++ b/spring-integration-stream/src/test/java/org/springframework/integration/stream/config/invalidConsoleOutboundChannelAdapterParserTests.xml @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/spring-integration-syslog/src/test/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterParserTests.java b/spring-integration-syslog/src/test/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterParserTests.java index 7538709026..91ee776d2e 100644 --- a/spring-integration-syslog/src/test/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterParserTests.java +++ b/spring-integration-syslog/src/test/java/org/springframework/integration/syslog/config/SyslogReceivingChannelAdapterParserTests.java @@ -164,19 +164,21 @@ public class SyslogReceivingChannelAdapterParserTests { @Test public void testPortOnUdpChild() { try { - new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail1-context.xml", this.getClass()); + new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail1-context.xml", this.getClass()) + .close(); fail("Expected exception"); } catch (BeanDefinitionParsingException e) { assertTrue(e.getMessage().startsWith( - "Configuration problem: When child element 'udp-attributes' is present, 'port' must be defined there")); + "Configuration problem: When child element 'udp-attributes' is present, 'port' must be defined there")); } } @Test public void testPortWithTCPFactory() { try { - new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail2-context.xml", this.getClass()); + new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail2-context.xml", this.getClass()) + .close(); fail("Expected exception"); } catch (BeanCreationException e) { @@ -187,7 +189,8 @@ public class SyslogReceivingChannelAdapterParserTests { @Test public void testUdpChildWithTcp() { try { - new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail3-context.xml", this.getClass()); + new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail3-context.xml", this.getClass()) + .close(); fail("Expected exception"); } catch (BeanCreationException e) { @@ -200,11 +203,13 @@ public class SyslogReceivingChannelAdapterParserTests { @Test public void testUDPWithTCPFactory() { try { - new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail4-context.xml", this.getClass()); + new ClassPathXmlApplicationContext(this.getClass().getSimpleName() + "-fail4-context.xml", this.getClass()) + .close(); fail("Expected exception"); } catch (BeanCreationException e) { - assertEquals("Cannot specifiy 'connection-factory' unless the protocol is 'tcp'", e.getCause().getMessage()); + assertEquals("Cannot specifiy 'connection-factory' unless the protocol is 'tcp'", + e.getCause().getMessage()); } } diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParser-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParser-context.xml index 14212c9e08..d6d2134ae3 100644 --- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParser-context.xml +++ b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestReceivingMessageSourceParser-context.xml @@ -20,32 +20,32 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParser-context.xml b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParser-context.xml index 5388c02a91..675858e7dd 100644 --- a/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParser-context.xml +++ b/spring-integration-twitter/src/test/java/org/springframework/integration/twitter/config/TestSendingMessageHandlerParser-context.xml @@ -23,7 +23,7 @@ - + - - + diff --git a/spring-integration-twitter/src/test/java/twitter.sender.properties b/spring-integration-twitter/src/test/java/twitter.sender.properties index 4434f0ab55..ab585c9761 100644 --- a/spring-integration-twitter/src/test/java/twitter.sender.properties +++ b/spring-integration-twitter/src/test/java/twitter.sender.properties @@ -2,4 +2,4 @@ twitter.oauth.consumerKey= twitter.oauth.consumerSecret= twitter.oauth.accessToken= twitter.oauth.accessTokenSecret= -twitter.oauth.pin= \ No newline at end of file +twitter.oauth.pin=