Ignore placeholder resolution failure as well in case of ignoreResourceNotFound=true

Issue: SPR-11524
This commit is contained in:
Juergen Hoeller
2014-03-07 13:39:01 +01:00
parent 3dfa7e9ac0
commit bcde955ec9
2 changed files with 16 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 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.
@@ -18,12 +18,12 @@ package org.springframework.context.annotation;
import java.io.FileNotFoundException;
import java.util.Iterator;
import javax.inject.Inject;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MutablePropertySources;
@@ -250,6 +250,7 @@ public class PropertySourceAnnotationTests {
static class ConfigWithNameAndMultipleResourceLocations {
}
@Configuration
@PropertySource(
value = {
@@ -268,6 +269,7 @@ public class PropertySourceAnnotationTests {
static class ConfigWithPropertySources {
}
@Configuration
@PropertySources({
@PropertySource(name = "psName", value="classpath:org/springframework/context/annotation/p1.properties"),
@@ -282,13 +284,16 @@ public class PropertySourceAnnotationTests {
@PropertySources({
@PropertySource(name = "psName", value="classpath:org/springframework/context/annotation/p1.properties"),
@PropertySource(name = "psName", value="classpath:org/springframework/context/annotation/missing.properties", ignoreResourceNotFound=true),
@PropertySource(name = "psName", value="classpath:${myPath}/missing.properties", ignoreResourceNotFound=true),
@PropertySource(name = "psName", value="classpath:org/springframework/context/annotation/p2.properties")
})
static class ConfigWithIgnoredPropertySource {
}
@Configuration
@PropertySource(value = {})
static class ConfigWithEmptyResourceLocations {
}
}