From 30a6316887fbe1449893d8309953d69af059ec26 Mon Sep 17 00:00:00 2001 From: Iwein Fuld Date: Sat, 18 Jul 2009 17:45:39 +0000 Subject: [PATCH] IN PROGRESS - issue INT-731: file inbound channel parser adds file: prefix to property placeholders http://jira.springframework.org/browse/INT-731 Ignored testcase --- ...WithClasspathInPropertiesTests-context.xml | 25 ++++++++ ...AdapterWithClasspathInPropertiesTests.java | 59 +++++++++++++++++++ .../integration/file/config/test.properties | 1 + 3 files changed, 85 insertions(+) create mode 100644 org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests-context.xml create mode 100644 org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests.java create mode 100644 org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/test.properties diff --git a/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests-context.xml b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests-context.xml new file mode 100644 index 0000000000..59dec883d2 --- /dev/null +++ b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests-context.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests.java b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests.java new file mode 100644 index 0000000000..26d31657bc --- /dev/null +++ b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileInboundChannelAdapterWithClasspathInPropertiesTests.java @@ -0,0 +1,59 @@ +/* + * Copyright 2002-2009 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.file.config; + +import static org.junit.Assert.assertEquals; + +import java.io.File; + +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.DirectFieldAccessor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; +import org.springframework.integration.file.FileReadingMessageSource; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +/** + * @author Iwein Fuld + */ +@ContextConfiguration +@RunWith(SpringJUnit4ClassRunner.class) +@Ignore +public class FileInboundChannelAdapterWithClasspathInPropertiesTests { + + @Autowired(required=true) + private FileReadingMessageSource source; + + private DirectFieldAccessor accessor; + + @Before + public void init() { + accessor = new DirectFieldAccessor(source); + } + + @Test + public void inputDirectory() throws Exception { + File expected = new ClassPathResource("").getFile(); + File actual = (File) accessor.getPropertyValue("inputDirectory"); + assertEquals("'inputDirectory' should be set", expected, actual); + } + +} diff --git a/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/test.properties b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/test.properties new file mode 100644 index 0000000000..6f5f2dfac1 --- /dev/null +++ b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/test.properties @@ -0,0 +1 @@ +inputdir=classpath: \ No newline at end of file