Minor refactoring of debug filter and tidying up tests.
This commit is contained in:
@@ -15,6 +15,9 @@ public class SecurityNamespaceHandlerTests {
|
||||
@Test
|
||||
public void constructionSucceeds() {
|
||||
new SecurityNamespaceHandler();
|
||||
// Shameless class coverage stats boosting
|
||||
new BeanIds() {};
|
||||
new Elements() {};
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.springframework.security.config.util;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.AbstractXmlApplicationContext;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -32,11 +33,21 @@ public class InMemoryXmlApplicationContext extends AbstractXmlApplicationContext
|
||||
public InMemoryXmlApplicationContext(String xml, String secVersion, ApplicationContext parent) {
|
||||
String fullXml = BEANS_OPENING + secVersion + ".xsd'>\n" + xml + BEANS_CLOSE;
|
||||
inMemoryXml = new InMemoryResource(fullXml);
|
||||
setAllowBeanDefinitionOverriding(false);
|
||||
setAllowBeanDefinitionOverriding(true);
|
||||
setParent(parent);
|
||||
refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected DefaultListableBeanFactory createBeanFactory() {
|
||||
return new DefaultListableBeanFactory(getInternalParentBeanFactory()) {
|
||||
@Override
|
||||
protected boolean allowAliasOverriding() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected Resource[] getConfigResources() {
|
||||
return new Resource[] {inMemoryXml};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user