RESOLVED - issue SPR-6366: Cannot import bean definitions using classpath*: resource location

http://jira.springframework.org/browse/SPR-6366

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2445 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
David Syer 2009-11-18 07:54:19 +00:00
parent d349ea9ea6
commit 62570a8e82
2 changed files with 34 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import org.junit.Test;
*
* @author Rick Evans
* @author Arjen Poutsma
* @author Dave Syer
*/
public final class ResourceEditorTests {

View File

@ -0,0 +1,33 @@
package org.springframework.core.io.support;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.core.io.Resource;
public class ResourceArrayPropertyEditorTests {
private ResourceArrayPropertyEditor editor = new ResourceArrayPropertyEditor();
@Test
public void testVanillaResource() throws Exception {
editor.setAsText("classpath:org/springframework/core/io/support/ResourceArrayPropertyEditor.class");
Resource[] resources = (Resource[]) editor.getValue();
assertNotNull(resources);
assertTrue(resources[0].exists());
}
@Test
public void testPatternResource() throws Exception {
// N.B. this will sometimes fail if you use classpath: instead of classpath*:.
// The result depends on the classpath - if test-classes are segregated from classes
// and they come first on the classpath (like in Maven) then it breaks, if classes
// comes first (like in Spring Build) then it is OK.
editor.setAsText("classpath*:org/springframework/core/io/support/Resource*Editor.class");
Resource[] resources = (Resource[]) editor.getValue();
assertNotNull(resources);
assertTrue(resources[0].exists());
}
}