IN PROGRESS - issue INT-731: file inbound channel parser adds file: prefix to property placeholders

http://jira.springframework.org/browse/INT-731

Ignored testcase
This commit is contained in:
Iwein Fuld
2009-07-18 17:45:39 +00:00
parent 59c0fd0e8d
commit 30a6316887
3 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
xmlns="http://www.springframework.org/schema/integration/file"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:integration="http://www.springframework.org/schema/integration"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-1.0.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-1.0.xsd">
<inbound-channel-adapter id="inputDirPoller"
directory="${inputdir}"
auto-startup="false">
<integration:poller>
<integration:interval-trigger interval="5000"/>
</integration:poller>
</inbound-channel-adapter>
<context:property-placeholder location="classpath:org/springframework/integration/file/config/test.properties" />
</beans:beans>

View File

@@ -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);
}
}