directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r584303 - /directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java
Date Fri, 12 Oct 2007 22:27:32 GMT
Author: djencks
Date: Fri Oct 12 15:27:06 2007
New Revision: 584303

URL: http://svn.apache.org/viewvc?rev=584303&view=rev
Log:
this should fix NPE (untested)

Modified:
    directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java

Modified: directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java?rev=584303&r1=584302&r2=584303&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java
(original)
+++ directory/apacheds/branches/bigbang/server-unit/src/test/java/org/apache/directory/server/PasswordPolicyServiceITest.java
Fri Oct 12 15:27:06 2007
@@ -59,9 +59,27 @@
      */
     public void setUp() throws Exception
     {
+        super.setUp();
         setAllowAnonymousAccess( false );
 
         Attributes attrs;
+
+
+        Hashtable<String, String> env = new Hashtable<String, String>();
+        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/dc=example,dc=com"
);
+        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
+        env.put( "java.naming.security.credentials", "secret" );
+        env.put( "java.naming.security.authentication", "simple" );
+        ctx = new InitialDirContext( env );
+
+        attrs = getOrgUnitAttributes( "users" );
+        users = ctx.createSubcontext( "ou=users", attrs );
+    }
+
+    protected void configureDirectoryService()
+    {
+        Attributes attrs;
         Set<Partition> partitions = new HashSet<Partition>();
 
         // Add partition 'example'
@@ -92,19 +110,6 @@
 
         list.add( new PasswordPolicyInterceptor() );
         directoryService.setInterceptors( list );
-
-        super.setUp();
-
-        Hashtable<String, String> env = new Hashtable<String, String>();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/dc=example,dc=com"
);
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        ctx = new InitialDirContext( env );
-
-        attrs = getOrgUnitAttributes( "users" );
-        users = ctx.createSubcontext( "ou=users", attrs );
     }
 
 



Mime
View raw message