ConfigurationClassParser processes late-arriving DeferredImportSelectors as regular import selectors

Also contains refined exception handling, treating regular class loading and ASM-based loading consistently in terms of exception wrapping, and always mentioning the current configuration class in all exception messages.

Issue: SPR-11997
This commit is contained in:
Juergen Hoeller
2014-07-15 22:04:52 +02:00
parent 10a4c2cd81
commit bbf5800831
2 changed files with 65 additions and 67 deletions

View File

@@ -99,11 +99,16 @@ public class PropertySourceAnnotationTests {
}
}
@Test(expected=IllegalArgumentException.class)
@Test
public void withUnresolvablePlaceholder() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(ConfigWithUnresolvablePlaceholder.class);
ctx.refresh();
try {
ctx.refresh();
}
catch (BeanDefinitionStoreException ex) {
assertTrue(ex.getCause() instanceof IllegalArgumentException);
}
}
@Test
@@ -124,11 +129,16 @@ public class PropertySourceAnnotationTests {
System.clearProperty("path.to.properties");
}
@Test(expected = IllegalArgumentException.class)
@Test
public void withEmptyResourceLocations() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(ConfigWithEmptyResourceLocations.class);
ctx.refresh();
try {
ctx.refresh();
}
catch (BeanDefinitionStoreException ex) {
assertTrue(ex.getCause() instanceof IllegalArgumentException);
}
}
// SPR-10820