Polishing

(cherry picked from commit 2f9ed59)
This commit is contained in:
Juergen Hoeller
2016-10-28 23:49:21 +02:00
parent 0ee8322947
commit 144f687ee9
8 changed files with 47 additions and 71 deletions

View File

@@ -82,6 +82,7 @@ public class CustomNamespaceHandlerTests {
private GenericApplicationContext beanFactory;
@Before
public void setUp() throws Exception {
NamespaceHandlerResolver resolver = new DefaultNamespaceHandlerResolver(CLASS.getClassLoader(), NS_PROPS);
@@ -148,30 +149,21 @@ public class CustomNamespaceHandlerTests {
assertEquals("foo", beanDefinition.getAttribute("objectName"));
}
/**
* http://opensource.atlassian.com/projects/spring/browse/SPR-2728
*/
@Test
@Test // SPR-2728
public void testCustomElementNestedWithinUtilList() throws Exception {
List<?> things = (List<?>) this.beanFactory.getBean("list.of.things");
assertNotNull(things);
assertEquals(2, things.size());
}
/**
* http://opensource.atlassian.com/projects/spring/browse/SPR-2728
*/
@Test
@Test // SPR-2728
public void testCustomElementNestedWithinUtilSet() throws Exception {
Set<?> things = (Set<?>) this.beanFactory.getBean("set.of.things");
assertNotNull(things);
assertEquals(2, things.size());
}
/**
* http://opensource.atlassian.com/projects/spring/browse/SPR-2728
*/
@Test
@Test // SPR-2728
public void testCustomElementNestedWithinUtilMap() throws Exception {
Map<?, ?> things = (Map<?, ?>) this.beanFactory.getBean("map.of.things");
assertNotNull(things);
@@ -229,6 +221,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
registerBeanDefinitionDecoratorForAttribute("object-name", new ObjectNameBeanDefinitionDecorator());
}
private static class TestBeanDefinitionParser implements BeanDefinitionParser {
@Override
@@ -247,6 +240,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
}
}
private static final class PersonDefinitionParser extends AbstractSingleBeanDefinitionParser {
@Override
@@ -261,6 +255,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
}
}
private static class PropertyModifyingBeanDefinitionDecorator implements BeanDefinitionDecorator {
@Override
@@ -277,6 +272,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
}
}
private static class DebugBeanDefinitionDecorator extends AbstractInterceptorDrivenBeanDefinitionDecorator {
@Override
@@ -285,6 +281,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
}
}
private static class NopInterceptorBeanDefinitionDecorator extends AbstractInterceptorDrivenBeanDefinitionDecorator {
@Override
@@ -293,6 +290,7 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
}
}
private static class ObjectNameBeanDefinitionDecorator implements BeanDefinitionDecorator {
@Override
@@ -302,5 +300,5 @@ final class TestNamespaceHandler extends NamespaceHandlerSupport {
return definition;
}
}
}
}