[spring-extensions] branch master updated: Cleanup nits
Tom Zeller
tzeller at dragonacea.biz
Wed Sep 28 09:10:43 EDT 2016
This is an automated email from the git hooks/post-receive script.
tzeller pushed a commit to branch master
in repository spring-extensions.
View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=ec3fd1a75e0d4f475d412cc39798b069e28f8cf0
The following commit(s) were added to refs/heads/master by this push:
new ec3fd1a Cleanup nits
ec3fd1a is described below
commit ec3fd1a75e0d4f475d412cc39798b069e28f8cf0
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Wed Sep 28 09:10:34 2016 -0400
Cleanup nits
---
.../spring/util/ParameterNameAnnotationTest.java | 24 +++++++++-------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/src/test/java/net/shibboleth/ext/spring/util/ParameterNameAnnotationTest.java b/src/test/java/net/shibboleth/ext/spring/util/ParameterNameAnnotationTest.java
index 6b09343..16d73d2 100644
--- a/src/test/java/net/shibboleth/ext/spring/util/ParameterNameAnnotationTest.java
+++ b/src/test/java/net/shibboleth/ext/spring/util/ParameterNameAnnotationTest.java
@@ -24,24 +24,22 @@ import org.springframework.context.support.GenericApplicationContext;
import org.testng.Assert;
import org.testng.annotations.Test;
-/**
- *
- */
+/** {@link AnnotationParameterNameDiscoverer} unit test. */
public class ParameterNameAnnotationTest {
@Test public void testNoAnnotationFilter() {
-
+
final GenericApplicationContext context = new GenericApplicationContext();
final XmlBeanDefinitionReader beanDefinitionReader = new SchemaTypeAwareXMLBeanDefinitionReader(context);
beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
beanDefinitionReader.loadBeanDefinitions("net/shibboleth/ext/spring/util/paramBeans.xml");
context.refresh();
-
+
final ParamClass byNumber = context.getBean("TheBeanRemainsTheSame", ParamClass.class);
Assert.assertEquals(byNumber.getP1(), "Param the First");
Assert.assertEquals(byNumber.getP2(), "Param the Second");
-
+
final ParamClass byId = context.getBean("InThroughTheOutBean", ParamClass.class);
// Swapped
Assert.assertEquals(byId.getP1(), "Param the Second");
@@ -52,27 +50,26 @@ public class ParameterNameAnnotationTest {
Assert.assertEquals(single.getP2(), "HardWired Param The Second");
}
-
- @Test(enabled=true) public void testWithAnnotationFilter() {
-
+
+ @Test(enabled = true) public void testWithAnnotationFilter() {
+
final GenericApplicationContext context = new GenericApplicationContext();
final XmlBeanDefinitionReader beanDefinitionReader = new SchemaTypeAwareXMLBeanDefinitionReader(context);
-
+
final ConfigurableListableBeanFactory factory = context.getBeanFactory();
if (factory instanceof AbstractAutowireCapableBeanFactory) {
final AbstractAutowireCapableBeanFactory aaBeanFactory = (AbstractAutowireCapableBeanFactory) factory;
aaBeanFactory.setParameterNameDiscoverer(new AnnotationParameterNameDiscoverer());
}
-
beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_XSD);
beanDefinitionReader.loadBeanDefinitions("net/shibboleth/ext/spring/util/paramBeans.xml");
context.refresh();
-
+
final ParamClass byNumber = context.getBean("TheBeanRemainsTheSame", ParamClass.class);
Assert.assertEquals(byNumber.getP1(), "Param the First");
Assert.assertEquals(byNumber.getP2(), "Param the Second");
-
+
final ParamClass byId = context.getBean("InThroughTheOutBean", ParamClass.class);
// Correct
Assert.assertEquals(byId.getP1(), "Param the First");
@@ -83,7 +80,6 @@ public class ParameterNameAnnotationTest {
Assert.assertEquals(single.getP1(), "Param the First");
Assert.assertEquals(single.getP2(), "HardWired Param The Second");
-
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list