From 568e6a3b3889a75a8c2d03795f39b88b77975d4c Mon Sep 17 00:00:00 2001 From: David Syer Date: Thu, 12 Nov 2009 11:20:51 +0000 Subject: [PATCH] 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 --- ...rtyResourceConfigurerIntegrationTests.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/org.springframework.context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java b/org.springframework.context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java index dde0ea027c0..35d22d2a686 100644 --- a/org.springframework.context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java +++ b/org.springframework.context/src/test/java/org/springframework/context/support/PropertyResourceConfigurerIntegrationTests.java @@ -16,22 +16,20 @@ package org.springframework.context.support; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.io.FileNotFoundException; -import static org.junit.Assert.*; -import org.junit.Before; import org.junit.Ignore; import org.junit.Test; - import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.TestBean; -import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.BeanInitializationException; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.beans.factory.config.PropertyResourceConfigurer; import org.springframework.beans.factory.config.RuntimeBeanReference; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.util.StringUtils; @@ -46,13 +44,6 @@ import org.springframework.util.StringUtils; */ public class PropertyResourceConfigurerIntegrationTests { - private DefaultListableBeanFactory factory; - - @Before - public void setUp() { - factory = new DefaultListableBeanFactory(); - } - @Test public void testPropertyPlaceholderConfigurerWithSystemPropertyInLocation() { StaticApplicationContext ac = new StaticApplicationContext(); @@ -118,9 +109,9 @@ public class PropertyResourceConfigurerIntegrationTests { ac.registerSingleton("configurer", PropertyPlaceholderConfigurer.class, pvs); try { ac.refresh(); - fail("Should have thrown BeanCreationException"); + fail("Should have thrown BeanInitializationException"); } - catch (BeanCreationException ex) { + catch (BeanInitializationException ex) { // expected assertTrue(ex.getMessage().contains("myprop")); }