From b1c6c9834f231985afaa69a7f2f90d5184e400ea Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Wed, 17 Nov 2010 21:20:22 -0500 Subject: [PATCH] INT-1631 added tests for failure to auto-create local directories when auto-create set to false --- ...terParserTests-context-fail-autocreate.xml | 48 +++++++++++++++++++ .../InboundChannelAdapaterParserTests.java | 7 ++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests-context-fail-autocreate.xml diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests-context-fail-autocreate.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests-context-fail-autocreate.xml new file mode 100644 index 0000000000..4a3b551b7f --- /dev/null +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests-context-fail-autocreate.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java index 58a75eb6b3..299f8dca09 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java @@ -62,7 +62,7 @@ public class InboundChannelAdapaterParserTests { @Test(expected=BeanDefinitionStoreException.class) //exactly one of 'filename-pattern' or 'filter' is allowed on SFTP inbound adapter - public void testLocalFilesAutoCreationFalse() throws Exception{ + public void testFailWithFilePatternAndFilter() throws Exception{ assertTrue(!new File("target/bar").exists()); new ClassPathXmlApplicationContext("InboundChannelAdapaterParserTests-context-fail.xml", this.getClass()); } @@ -81,6 +81,11 @@ public class InboundChannelAdapaterParserTests { assertTrue(new File("foo").exists()); } + @Test(expected=BeanCreationException.class) + public void testLocalDirAutoCreateFailed() throws Exception{ + new ClassPathXmlApplicationContext("InboundChannelAdapaterParserTests-context-fail-autocreate.xml", this.getClass()); + } + @After public void cleanUp() throws Exception{ new File("foo").delete();