提交 3a5fb1fd 编写于 作者: R Rossen Stoyanchev

Fix test failing after #99302f

上级 71396121
......@@ -16,7 +16,6 @@
package org.springframework.context.config;
import java.io.FileNotFoundException;
import java.util.Calendar;
import java.util.Date;
......@@ -32,6 +31,7 @@ import org.springframework.mock.env.MockEnvironment;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* @author Arjen Poutsma
......@@ -129,14 +129,14 @@ public class ContextNamespaceHandlerTests {
@Test
public void propertyPlaceholderLocationWithSystemPropertyMissing() {
try {
ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
new ClassPathXmlApplicationContext(
"contextNamespaceHandlerTests-location-placeholder.xml", getClass());
assertEquals("bar", applicationContext.getBean("foo"));
assertEquals("foo", applicationContext.getBean("bar"));
assertEquals("maps", applicationContext.getBean("spam"));
fail("Should have thrown FatalBeanException");
}
catch (FatalBeanException ex) {
assertTrue(ex.getRootCause() instanceof FileNotFoundException);
Throwable cause = ex.getRootCause();
assertTrue(cause instanceof IllegalArgumentException);
assertEquals("Could not resolve placeholder 'foo' in value \"${foo}\"", cause.getMessage());
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册