shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lhazlew...@apache.org
Subject svn commit: r1228565 - /shiro/trunk/core/src/test/groovy/org/apache/shiro/config/ReflectionBuilderTest.groovy
Date Sat, 07 Jan 2012 03:39:38 GMT
Author: lhazlewood
Date: Sat Jan  7 03:39:38 2012
New Revision: 1228565

URL: http://svn.apache.org/viewvc?rev=1228565&view=rev
Log:
SHIRO-305: expanded pn one test case

Modified:
    shiro/trunk/core/src/test/groovy/org/apache/shiro/config/ReflectionBuilderTest.groovy

Modified: shiro/trunk/core/src/test/groovy/org/apache/shiro/config/ReflectionBuilderTest.groovy
URL: http://svn.apache.org/viewvc/shiro/trunk/core/src/test/groovy/org/apache/shiro/config/ReflectionBuilderTest.groovy?rev=1228565&r1=1228564&r2=1228565&view=diff
==============================================================================
--- shiro/trunk/core/src/test/groovy/org/apache/shiro/config/ReflectionBuilderTest.groovy
(original)
+++ shiro/trunk/core/src/test/groovy/org/apache/shiro/config/ReflectionBuilderTest.groovy
Sat Jan  7 03:39:38 2012
@@ -21,6 +21,7 @@ package org.apache.shiro.config
 import org.apache.shiro.codec.Base64
 import org.apache.shiro.codec.CodecSupport
 import org.apache.shiro.codec.Hex
+import org.apache.shiro.realm.ldap.JndiLdapRealm
 import org.apache.shiro.util.CollectionUtils
 
 /**
@@ -85,14 +86,17 @@ class ReflectionBuilderTest extends Groo
         ini.load('''
             ldapRealm = org.apache.shiro.realm.ldap.JndiLdapRealm
             ldapRealm.contextFactory.environment[java.naming.security.protocol] = ssl
-            ldapRealm.contextFactory.environment[com.sun.jndi.ldap.connect.pool.protocol]
= plain ssl 
             ldapRealm.contextFactory.environment[com.sun.jndi.ldap.connect.pool] = true 
+            ldapRealm.contextFactory.environment[com.sun.jndi.ldap.connect.pool.protocol]
= plain ssl 
         ''')
         def builder = new ReflectionBuilder()
         def objects = builder.buildObjects(ini.getSections().iterator().next())
         
         assertFalse objects.isEmpty()
-        assertEquals 'ssl', objects['ldapRealm'].contextFactory.environment['java.naming.security.protocol']
+        def ldapRealm = objects['ldapRealm'] as JndiLdapRealm
+        assertEquals 'ssl', ldapRealm.contextFactory.environment['java.naming.security.protocol']
+        assertEquals 'true', ldapRealm.contextFactory.environment['com.sun.jndi.ldap.connect.pool']
+        assertEquals 'plain ssl', ldapRealm.contextFactory.environment['com.sun.jndi.ldap.connect.pool.protocol']
     }
 
     void testSimpleConfig() {



Mime
View raw message