Skip to content

Commit 568e6a3

Browse files
author
David Syer
committed
RESOLVED - issue SPR-6321: Regression: ResourceEditor in 3.0 does not ignore unresolvable placeholders, but it did in 2.5.6
Different initialization exception popped up in app context
1 parent 38f1383 commit 568e6a3

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

org.springframework.context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,20 @@
1616

1717
package org.springframework.context.support;
1818

19+
import static org.junit.Assert.assertTrue;
20+
import static org.junit.Assert.fail;
21+
1922
import java.io.FileNotFoundException;
2023

21-
import static org.junit.Assert.*;
22-
import org.junit.Before;
2324
import org.junit.Ignore;
2425
import org.junit.Test;
25-
2626
import org.springframework.beans.MutablePropertyValues;
2727
import org.springframework.beans.TestBean;
28-
import org.springframework.beans.factory.BeanCreationException;
2928
import org.springframework.beans.factory.BeanDefinitionStoreException;
3029
import org.springframework.beans.factory.BeanInitializationException;
3130
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
3231
import org.springframework.beans.factory.config.PropertyResourceConfigurer;
3332
import org.springframework.beans.factory.config.RuntimeBeanReference;
34-
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
3533
import org.springframework.context.ApplicationContext;
3634
import org.springframework.util.StringUtils;
3735

@@ -46,13 +44,6 @@
4644
*/
4745
public class PropertyResourceConfigurerIntegrationTests {
4846

49-
private DefaultListableBeanFactory factory;
50-
51-
@Before
52-
public void setUp() {
53-
factory = new DefaultListableBeanFactory();
54-
}
55-
5647
@Test
5748
public void testPropertyPlaceholderConfigurerWithSystemPropertyInLocation() {
5849
StaticApplicationContext ac = new StaticApplicationContext();
@@ -118,9 +109,9 @@ public void testPropertyPlaceholderConfigurerWithUnresolvableSystemPropertiesInL
118109
ac.registerSingleton("configurer", PropertyPlaceholderConfigurer.class, pvs);
119110
try {
120111
ac.refresh();
121-
fail("Should have thrown BeanCreationException");
112+
fail("Should have thrown BeanInitializationException");
122113
}
123-
catch (BeanCreationException ex) {
114+
catch (BeanInitializationException ex) {
124115
// expected
125116
assertTrue(ex.getMessage().contains("myprop"));
126117
}

0 commit comments

Comments
 (0)