|
16 | 16 |
|
17 | 17 | package org.springframework.context.support;
|
18 | 18 |
|
| 19 | +import static org.junit.Assert.assertTrue; |
| 20 | +import static org.junit.Assert.fail; |
| 21 | + |
19 | 22 | import java.io.FileNotFoundException;
|
20 | 23 |
|
21 |
| -import static org.junit.Assert.*; |
22 |
| -import org.junit.Before; |
23 | 24 | import org.junit.Ignore;
|
24 | 25 | import org.junit.Test;
|
25 |
| - |
26 | 26 | import org.springframework.beans.MutablePropertyValues;
|
27 | 27 | import org.springframework.beans.TestBean;
|
28 |
| -import org.springframework.beans.factory.BeanCreationException; |
29 | 28 | import org.springframework.beans.factory.BeanDefinitionStoreException;
|
30 | 29 | import org.springframework.beans.factory.BeanInitializationException;
|
31 | 30 | import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
|
32 | 31 | import org.springframework.beans.factory.config.PropertyResourceConfigurer;
|
33 | 32 | import org.springframework.beans.factory.config.RuntimeBeanReference;
|
34 |
| -import org.springframework.beans.factory.support.DefaultListableBeanFactory; |
35 | 33 | import org.springframework.context.ApplicationContext;
|
36 | 34 | import org.springframework.util.StringUtils;
|
37 | 35 |
|
|
46 | 44 | */
|
47 | 45 | public class PropertyResourceConfigurerIntegrationTests {
|
48 | 46 |
|
49 |
| - private DefaultListableBeanFactory factory; |
50 |
| - |
51 |
| - @Before |
52 |
| - public void setUp() { |
53 |
| - factory = new DefaultListableBeanFactory(); |
54 |
| - } |
55 |
| - |
56 | 47 | @Test
|
57 | 48 | public void testPropertyPlaceholderConfigurerWithSystemPropertyInLocation() {
|
58 | 49 | StaticApplicationContext ac = new StaticApplicationContext();
|
@@ -118,9 +109,9 @@ public void testPropertyPlaceholderConfigurerWithUnresolvableSystemPropertiesInL
|
118 | 109 | ac.registerSingleton("configurer", PropertyPlaceholderConfigurer.class, pvs);
|
119 | 110 | try {
|
120 | 111 | ac.refresh();
|
121 |
| - fail("Should have thrown BeanCreationException"); |
| 112 | + fail("Should have thrown BeanInitializationException"); |
122 | 113 | }
|
123 |
| - catch (BeanCreationException ex) { |
| 114 | + catch (BeanInitializationException ex) { |
124 | 115 | // expected
|
125 | 116 | assertTrue(ex.getMessage().contains("myprop"));
|
126 | 117 | }
|
|
0 commit comments