directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r190555 [3/4] - in /directory: apacheds/branches/ apacheds/branches/direve-158/ apacheds/trunk/ apacheds/trunk/core/ apacheds/trunk/core/src/main/aspects/org/apache/ldap/server/jndi/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/authn/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/configuration/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/db/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/db/gui/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/db/jdbm/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/interceptor/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/invocation/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/normalization/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/prefs/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/ apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/ apacheds/trunk/core/src/test/org/apache/ldap/server/authn/ apacheds/trunk/core/src/test/org/apache/ldap/server/authz/ apacheds/trunk/core/src/test/org/apache/ldap/server/exception/ apacheds/trunk/core/src/test/org/apache/ldap/server/interceptor/ apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ apacheds/trunk/core/src/test/org/apache/ldap/server/operational/ apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ apacheds/trunk/core/src/test/org/apache/ldap/server/schema/bootstrap/ apacheds/trunk/main/ apacheds/trunk/main/src/main/java/org/apache/ldap/server/ apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/ apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ apacheds/trunk/main/src/test/org/apache/ldap/server/ apacheds/trunk/main/src/test/org/apache/ldap/server/jndi/ protocol-providers/ldap/branches/direve-158/ protocol-providers/ldap/trunk/ protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/
Date Tue, 14 Jun 2005 05:09:31 GMT
Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapMatchingRuleRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapMatchingRuleUseRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapNameFormRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapNormalizerRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapObjectClassRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapObjectFactoryRegistry.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapOidRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapRegistries.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java Mon Jun 13 22:09:25 2005
@@ -17,13 +17,40 @@
 package org.apache.ldap.server.schema.bootstrap;
 
 
-import org.apache.ldap.common.schema.*;
-import org.apache.ldap.server.jndi.ServerDirObjectFactory;
-import org.apache.ldap.server.jndi.ServerDirStateFactory;
-import org.apache.ldap.server.schema.*;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
 
 import javax.naming.NamingException;
-import java.util.*;
+
+import org.apache.ldap.common.schema.AttributeType;
+import org.apache.ldap.common.schema.DITContentRule;
+import org.apache.ldap.common.schema.DITStructureRule;
+import org.apache.ldap.common.schema.MatchingRule;
+import org.apache.ldap.common.schema.MatchingRuleUse;
+import org.apache.ldap.common.schema.NameForm;
+import org.apache.ldap.common.schema.Normalizer;
+import org.apache.ldap.common.schema.ObjectClass;
+import org.apache.ldap.common.schema.Syntax;
+import org.apache.ldap.common.schema.SyntaxChecker;
+import org.apache.ldap.server.jndi.ServerDirObjectFactory;
+import org.apache.ldap.server.jndi.ServerDirStateFactory;
+import org.apache.ldap.server.schema.AttributeTypeRegistry;
+import org.apache.ldap.server.schema.ComparatorRegistry;
+import org.apache.ldap.server.schema.DITContentRuleRegistry;
+import org.apache.ldap.server.schema.DITStructureRuleRegistry;
+import org.apache.ldap.server.schema.MatchingRuleRegistry;
+import org.apache.ldap.server.schema.MatchingRuleUseRegistry;
+import org.apache.ldap.server.schema.NameFormRegistry;
+import org.apache.ldap.server.schema.NormalizerRegistry;
+import org.apache.ldap.server.schema.ObjectClassRegistry;
+import org.apache.ldap.server.schema.ObjectFactoryRegistry;
+import org.apache.ldap.server.schema.StateFactoryRegistry;
+import org.apache.ldap.server.schema.SyntaxCheckerRegistry;
+import org.apache.ldap.server.schema.SyntaxRegistry;
 
 
 /**
@@ -66,39 +93,30 @@
      * Loads a set of schemas by loading and running all producers for each
      * dependent schema first.
      *
-     * @param schemaClasses the full qualified class names of the schema classes
+     * @param bootstrapSchemas Collection of {@link BootstrapSchema}s to load
      * @param registries the registries to fill with producer created objects
      * @throws NamingException if there are any failures during this process
      */
-    public final void load( String[] schemaClasses, BootstrapRegistries registries )
+    public final void load( Collection bootstrapSchemas, BootstrapRegistries registries )
         throws NamingException
     {
-        BootstrapSchema[] schemas = new BootstrapSchema[schemaClasses.length];
+        BootstrapSchema[] schemas = new BootstrapSchema[ bootstrapSchemas.size() ];
+        schemas = ( BootstrapSchema[] ) bootstrapSchemas.toArray( schemas );
         HashMap loaded = new HashMap();
         HashMap notLoaded = new HashMap();
 
-
         for ( int ii = 0; ii < schemas.length; ii++ )
         {
-            try
-            {
-                Class schemaClass = Class.forName( schemaClasses[ii] );
-                schemas[ii] = ( BootstrapSchema ) schemaClass.newInstance();
-                notLoaded.put( schemas[ii].getSchemaName(), schemas[ii] );
-            }
-            catch ( Exception e )
-            {
-                String msg = "problem loading/creating " + schemaClasses[ii];
-                NamingException ne = new NamingException( msg );
-                ne.setRootCause( e );
-                throw ne;
-            }
+            notLoaded.put( schemas[ii].getSchemaName(), schemas[ii] );
         }
-
-        // kick it off by loading system which will never depend on anything
-        BootstrapSchema schema = ( BootstrapSchema ) notLoaded.get( "system" );
+        
+        BootstrapSchema schema;
+        
+        // Create system schema and kick it off by loading system which
+        // will never depend on anything.
+        schema = new SystemSchema();
         load( schema, registries );
-        notLoaded.remove( "system" );
+        notLoaded.remove( schema.getSchemaName() ); // Remove if user specified it.
         loaded.put( schema.getSchemaName(), schema );
 
         Iterator list = notLoaded.values().iterator();

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoader.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapStateFactoryRegistry.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSyntaxCheckerRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/BootstrapSyntaxRegistry.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/InetorgpersonComparatorProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/InetorgpersonMatchingRuleProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/InetorgpersonNormalizerProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/NisComparatorProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/NisMatchingRuleProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/NisNormalizerProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/NisSyntaxCheckerProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/NisSyntaxProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/ProducerCallback.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/SystemComparatorProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/SystemMatchingRuleProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/SystemNormalizerProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/SystemSyntaxCheckerProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/SystemSyntaxProducer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/bootstrap/package.html
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/package.html
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authn/SimpleAuthenticationTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authn/SimpleAuthenticationTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authn/SimpleAuthenticationTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authn/SimpleAuthenticationTest.java Mon Jun 13 22:09:25 2005
@@ -17,22 +17,24 @@
 package org.apache.ldap.server.authn;
 
 
-import org.apache.ldap.common.exception.LdapConfigurationException;
-import org.apache.ldap.common.exception.LdapNoPermissionException;
-import org.apache.ldap.common.util.ArrayUtils;
-import org.apache.ldap.server.AbstractCoreTest;
-import org.apache.ldap.server.jndi.EnvKeys;
-import org.apache.mina.util.AvailablePortFinder;
+import java.io.File;
+import java.io.IOException;
+import java.util.Hashtable;
 
-import javax.naming.*;
+import javax.naming.ConfigurationException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InitialDirContext;
 import javax.naming.ldap.InitialLdapContext;
-import java.io.File;
-import java.io.IOException;
-import java.util.Hashtable;
+
+import org.apache.ldap.common.exception.LdapConfigurationException;
+import org.apache.ldap.common.exception.LdapNoPermissionException;
+import org.apache.ldap.common.util.ArrayUtils;
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -42,7 +44,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class SimpleAuthenticationTest extends AbstractCoreTest
+public class SimpleAuthenticationTest extends AbstractAdminTestCase
 {
     /**
      * Cleans up old database files on creation.
@@ -138,7 +140,7 @@
 
     public void test3UseAkarasulu() throws NamingException
     {
-        Hashtable env = new Hashtable();
+        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "ou=system" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=akarasulu,ou=users,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "test" );
@@ -179,15 +181,10 @@
     {
         // clean out the database
         tearDown();
-        doDelete( new File( "target" + File.separator + "eve" ) );
-        Hashtable env = new Hashtable();
+        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
         env.put( Context.SECURITY_AUTHENTICATION, "none" );
-        env.put( EnvKeys.DISABLE_ANONYMOUS, "true" );
-
-        int port = AvailablePortFinder.getNextAvailable( 1024 );
-
-        env.put( EnvKeys.LDAP_PORT, String.valueOf( port ) );
-
+        
+        configuration.setAllowAnonymousAccess( false );
         try
         {
             setSysRoot( env );
@@ -196,13 +193,14 @@
         catch( LdapNoPermissionException e )
         {
         }
+        tearDown();
 
         // ok this should start up the system now as admin
-        Hashtable anonymous = new Hashtable();
-
-        anonymous.put( EnvKeys.LDAP_PORT, String.valueOf( port ) );
+        env = new Hashtable( configuration.toJndiEnvironment() );
+        env.put( Context.SECURITY_AUTHENTICATION, "none" );
+        configuration.setAllowAnonymousAccess( true );
 
-        InitialLdapContext ctx = ( InitialLdapContext ) setSysRoot( anonymous );
+        InitialLdapContext ctx = ( InitialLdapContext ) setSysRoot( env );
         assertNotNull( ctx );
 
         // now go in as anonymous user and we should be wh
@@ -240,7 +238,7 @@
         // clean out the database
         tearDown();
         doDelete( new File( "target" + File.separator + "eve" ) );
-        Hashtable env = new Hashtable();
+        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
         env.put( Context.SECURITY_AUTHENTICATION, "none" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
 
@@ -269,7 +267,7 @@
         // clean out the database
         tearDown();
         doDelete( new File( "target" + File.separator + "eve" ) );
-        Hashtable env = new Hashtable();
+        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
         env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=akarasulu,ou=users,ou=system" );
 
@@ -292,7 +290,7 @@
      */
     public void test8PassPrincAuthTypeSimple() throws Exception
     {
-        Hashtable env = new Hashtable();
+        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "ou=system" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
@@ -310,7 +308,7 @@
      */
     public void test10TestNonAdminUser() throws Exception
     {
-        Hashtable env = new Hashtable();
+        Hashtable env = new Hashtable( configuration.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "ou=system" );
         env.put( Context.SECURITY_PRINCIPAL, "uid=akarasulu,ou=users,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "test" );

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authn/SimpleAuthenticationTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Copied: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsAdminTest.java (from r190553, directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsAdminTest.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsAdminTest.java?p2=directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsAdminTest.java&p1=directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsAdminTest.java&r1=190553&r2=190555&rev=190555&view=diff
==============================================================================
    (empty)

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsAdminTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Copied: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsNonAdminTest.java (from r190553, directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsNonAdminTest.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsNonAdminTest.java?p2=directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsNonAdminTest.java&p1=directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsNonAdminTest.java&r1=190553&r2=190555&rev=190555&view=diff
==============================================================================
    (empty)

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/authz/AuthorizationServiceAsNonAdminTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/exception/ExceptionServiceTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/exception/ExceptionServiceTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/exception/ExceptionServiceTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/exception/ExceptionServiceTest.java Mon Jun 13 22:09:25 2005
@@ -17,18 +17,25 @@
 package org.apache.ldap.server.exception;
 
 
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+
 import org.apache.ldap.common.exception.LdapContextNotEmptyException;
 import org.apache.ldap.common.exception.LdapNameAlreadyBoundException;
 import org.apache.ldap.common.exception.LdapNameNotFoundException;
 import org.apache.ldap.common.exception.LdapNamingException;
 import org.apache.ldap.common.message.ResultCodeEnum;
-import org.apache.ldap.server.AbstractCoreTest;
-
-import javax.naming.Context;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.*;
-import javax.naming.ldap.LdapContext;
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -37,7 +44,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ExceptionServiceTest extends AbstractCoreTest
+public class ExceptionServiceTest extends AbstractAdminTestCase
 {
     // ------------------------------------------------------------------------
     // Search Operation Tests

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/exception/ExceptionServiceTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ComparatorNPEBugTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ComparatorNPEBugTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ComparatorNPEBugTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ComparatorNPEBugTest.java Mon Jun 13 22:09:25 2005
@@ -17,7 +17,7 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -27,7 +27,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ComparatorNPEBugTest extends AbstractCoreTest
+public class ComparatorNPEBugTest extends AbstractAdminTestCase
 {
     public ComparatorNPEBugTest()
     {

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ComparatorNPEBugTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/CreateContextTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/CreateContextTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/CreateContextTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/CreateContextTest.java Mon Jun 13 22:09:25 2005
@@ -17,10 +17,14 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
-
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -29,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class CreateContextTest extends AbstractCoreTest
+public class CreateContextTest extends AbstractAdminTestCase
 {
     /**
      * Tests the creation and subsequent read of a new JNDI context under the

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/CreateContextTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/DestroyContextTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/DestroyContextTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/DestroyContextTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/DestroyContextTest.java Mon Jun 13 22:09:25 2005
@@ -17,11 +17,15 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.common.exception.LdapNameNotFoundException;
-import org.apache.ldap.server.AbstractCoreTest;
-
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+import org.apache.ldap.common.exception.LdapNameNotFoundException;
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -30,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class DestroyContextTest extends AbstractCoreTest
+public class DestroyContextTest extends AbstractAdminTestCase
 {
     protected void setUp() throws Exception
     {

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/DestroyContextTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Copied: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsAdminTest.java (from r190553, directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/jndi/ListAsAdminTest.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsAdminTest.java?p2=directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsAdminTest.java&p1=directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/jndi/ListAsAdminTest.java&r1=190553&r2=190555&rev=190555&view=diff
==============================================================================
    (empty)

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsAdminTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Copied: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsNonAdminTest.java (from r190553, directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/jndi/ListAsNonAdminTest.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsNonAdminTest.java?p2=directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsNonAdminTest.java&p1=directory/apacheds/branches/direve-158/core/src/test/org/apache/ldap/server/jndi/ListAsNonAdminTest.java&r1=190553&r2=190555&rev=190555&view=diff
==============================================================================
    (empty)

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ListAsNonAdminTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ModifyContextTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ModifyContextTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ModifyContextTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ModifyContextTest.java Mon Jun 13 22:09:25 2005
@@ -17,10 +17,14 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
-
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -30,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ModifyContextTest extends AbstractCoreTest
+public class ModifyContextTest extends AbstractAdminTestCase
 {
     protected void setUp() throws Exception
     {

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ModifyContextTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ObjStateFactoryTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ObjStateFactoryTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ObjStateFactoryTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ObjStateFactoryTest.java Mon Jun 13 22:09:25 2005
@@ -17,15 +17,20 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
+import java.util.Hashtable;
 
 import javax.naming.Context;
 import javax.naming.Name;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.SchemaViolationException;
 import javax.naming.spi.DirObjectFactory;
 import javax.naming.spi.DirStateFactory;
-import java.util.Hashtable;
+
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -34,7 +39,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ObjStateFactoryTest extends AbstractCoreTest
+public class ObjStateFactoryTest extends AbstractAdminTestCase
 {
     public void testObjectFactory() throws NamingException
     {

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ObjStateFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RFC2713Tests.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RFC2713Tests.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RFC2713Tests.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RFC2713Tests.java Mon Jun 13 22:09:25 2005
@@ -17,11 +17,12 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
+import java.util.ArrayList;
 
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-import java.util.ArrayList;
+
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -31,7 +32,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class RFC2713Tests extends AbstractCoreTest
+public class RFC2713Tests extends AbstractAdminTestCase
 {
     public void testSerialization() throws Exception
     {

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RFC2713Tests.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RootDSETest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RootDSETest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RootDSETest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RootDSETest.java Mon Jun 13 22:09:25 2005
@@ -17,9 +17,9 @@
 package org.apache.ldap.server.jndi;
 
 
-import junit.framework.TestCase;
-import org.apache.commons.io.FileUtils;
-import org.apache.ldap.common.exception.LdapNoPermissionException;
+import java.io.File;
+import java.io.IOException;
+import java.util.Hashtable;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
@@ -27,9 +27,13 @@
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
-import java.io.File;
-import java.io.IOException;
-import java.util.Hashtable;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.ldap.common.exception.LdapNoPermissionException;
+import org.apache.ldap.server.configuration.MutableStartupConfiguration;
+import org.apache.ldap.server.configuration.ShutdownConfiguration;
 
 
 /**
@@ -90,7 +94,7 @@
 
         env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.CoreContextFactory" );
 
-        env.put( EnvKeys.SHUTDOWN, "" );
+        env.putAll( new ShutdownConfiguration().toJndiEnvironment() );
 
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
 
@@ -108,20 +112,17 @@
      */
     public void testGetInitialContext() throws NamingException
     {
-        Hashtable env = new Hashtable();
-
-        env.put( EnvKeys.WKDIR, "target/server" );
+        MutableStartupConfiguration cfg = new MutableStartupConfiguration();
+        cfg.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
 
+        Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "" );
-
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         InitialContext initCtx = new InitialContext( env );
-
         assertNotNull( initCtx );
     }
 
@@ -134,16 +135,14 @@
      */
     public void testGetInitialContextLookupAttributes() throws NamingException
     {
-        Hashtable env = new Hashtable();
-
-        env.put( EnvKeys.WKDIR, "target/server" );
+        MutableStartupConfiguration cfg = new MutableStartupConfiguration();
+        cfg.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
 
+        Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "" );
-
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         InitialContext initCtx = new InitialContext( env );
@@ -167,16 +166,14 @@
      */
     public void testGetInitialContextLookupAttributesByName() throws NamingException
     {
-        Hashtable env = new Hashtable();
-
-        env.put( EnvKeys.WKDIR, "target/server" );
+        MutableStartupConfiguration cfg = new MutableStartupConfiguration();
+        cfg.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
 
+        Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "" );
-
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         InitialContext initCtx = new InitialContext( env );
@@ -202,16 +199,14 @@
      */
     public void testDelete() throws NamingException
     {
-        Hashtable env = new Hashtable();
-
-        env.put( EnvKeys.WKDIR, "target/server" );
+        MutableStartupConfiguration cfg = new MutableStartupConfiguration();
+        cfg.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
 
+        Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "" );
-
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         InitialContext initCtx = new InitialContext( env );
@@ -244,16 +239,14 @@
      */
     public void testRename() throws NamingException
     {
-        Hashtable env = new Hashtable();
-
-        env.put( EnvKeys.WKDIR, "target/server" );
+        MutableStartupConfiguration cfg = new MutableStartupConfiguration();
+        cfg.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
 
+        Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "" );
-
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         InitialContext initCtx = new InitialContext( env );
@@ -286,16 +279,14 @@
      */
     public void testModify() throws NamingException
     {
-        Hashtable env = new Hashtable();
-
-        env.put( EnvKeys.WKDIR, "target/server" );
+        MutableStartupConfiguration cfg = new MutableStartupConfiguration();
+        cfg.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
 
+        Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "" );
-
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         InitialContext initCtx = new InitialContext( env );
@@ -328,16 +319,14 @@
      */
     public void testModify2() throws NamingException
     {
-        Hashtable env = new Hashtable();
-
-        env.put( EnvKeys.WKDIR, "target/server" );
+        MutableStartupConfiguration cfg = new MutableStartupConfiguration();
+        cfg.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
 
+        Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
         env.put( Context.PROVIDER_URL, "" );
-
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-
+        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
 
         InitialContext initCtx = new InitialContext( env );

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/RootDSETest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SearchContextTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SearchContextTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SearchContextTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SearchContextTest.java Mon Jun 13 22:09:25 2005
@@ -17,13 +17,20 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.common.message.DerefAliasesEnum;
-import org.apache.ldap.server.AbstractCoreTest;
+import java.util.HashMap;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
-import java.util.HashMap;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
+import org.apache.ldap.common.message.DerefAliasesEnum;
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -32,7 +39,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class SearchContextTest extends AbstractCoreTest
+public class SearchContextTest extends AbstractAdminTestCase
 {
     protected void setUp() throws Exception
     {

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SearchContextTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ShutdownTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ShutdownTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ShutdownTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ShutdownTest.java Mon Jun 13 22:09:25 2005
@@ -17,7 +17,8 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
+import org.apache.ldap.server.AbstractAdminTestCase;
+import org.apache.ldap.server.configuration.ShutdownConfiguration;
 
 
 /**
@@ -26,7 +27,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ShutdownTest extends AbstractCoreTest
+public class ShutdownTest extends AbstractAdminTestCase
 {
     protected void tearDown() throws Exception
     {
@@ -43,17 +44,7 @@
      */
     public void testShutdownNonNullContext() throws Exception
     {
-        overrides.put( EnvKeys.SHUTDOWN, "true" );
-
-        try
-        {
-            setSysRoot( "uid=admin,ou=system", "secret" );
-        }
-        finally
-        {
-            overrides.remove( EnvKeys.SHUTDOWN );
-        }
-
+        setSysRoot( "uid=admin,ou=system", "secret", new ShutdownConfiguration() );
         assertNotNull( sysRoot );
     }
 
@@ -65,20 +56,13 @@
      */
     public void testShutdownRestart() throws Exception
     {
-        overrides.put( EnvKeys.SHUTDOWN, "true" );
-
-        try
-        {
-            setSysRoot( "uid=admin,ou=system", "secret" );
-        }
-        finally
-        {
-            overrides.remove( EnvKeys.SHUTDOWN );
-        }
-
+        setSysRoot( "uid=admin,ou=system", "secret", new ShutdownConfiguration() );
         assertNotNull( sysRoot );
 
         // restart the system now
-        setSysRoot( "uid=admin,ou=system", "secret" );
+        setSysRoot( "uid=admin,ou=system", "secret", configuration );
+        
+        // Shutdown again (tearDown is overriden)
+        setSysRoot( "uid=admin,ou=system", "secret", new ShutdownConfiguration() );
     }
 }

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/ShutdownTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SyncTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SyncTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SyncTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SyncTest.java Mon Jun 13 22:09:25 2005
@@ -17,10 +17,11 @@
 package org.apache.ldap.server.jndi;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
-
 import javax.naming.directory.Attributes;
 
+import org.apache.ldap.server.AbstractAdminTestCase;
+import org.apache.ldap.server.configuration.SyncConfiguration;
+
 
 /**
  * Tests the sync operation on the JNDI provider.
@@ -28,7 +29,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class SyncTest extends AbstractCoreTest
+public class SyncTest extends AbstractAdminTestCase
 {
     /**
      * Makes sure the changes to the JNDI provider take effect where a sync op
@@ -38,8 +39,7 @@
      */
     public void testSyncNoException() throws Exception
     {
-        overrides.put( EnvKeys.SYNC, "true" );
-        sysRoot = setSysRoot( "uid=admin,ou=system", "secret" );
+        sysRoot = setSysRoot( "uid=admin,ou=system", "secret", new SyncConfiguration() );
         assertNotNull( sysRoot );
     }
 
@@ -52,8 +52,8 @@
      */
     public void testPostSyncLookup() throws Exception
     {
-        overrides.put( EnvKeys.SYNC, "true" );
-        sysRoot = setSysRoot( "uid=admin,ou=system", "secret" );
+        sysRoot = setSysRoot( "uid=admin,ou=system", "secret", new SyncConfiguration() );
+        
         Attributes users = sysRoot.getAttributes( "ou=users" );
 
         // assert making sure the entry is ok

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/jndi/SyncTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java Mon Jun 13 22:09:25 2005
@@ -17,14 +17,14 @@
 package org.apache.ldap.server.operational;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
-
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 
+import org.apache.ldap.server.AbstractAdminTestCase;
+
 
 /**
  * Tests to see that the binary property filtering in the schema service's
@@ -34,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class BinaryAttributeFilterTest extends AbstractCoreTest
+public class BinaryAttributeFilterTest extends AbstractAdminTestCase
 {
     private static final String BINARY_KEY = "java.naming.ldap.attributes.binary";
 

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/BinaryAttributeFilterTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/OperationalAttributeServiceTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/OperationalAttributeServiceTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/OperationalAttributeServiceTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/OperationalAttributeServiceTest.java Mon Jun 13 22:09:25 2005
@@ -17,12 +17,18 @@
 package org.apache.ldap.server.operational;
 
 
-import org.apache.ldap.common.message.DerefAliasesEnum;
-import org.apache.ldap.server.AbstractCoreTest;
-
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.*;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
+import org.apache.ldap.common.message.DerefAliasesEnum;
+import org.apache.ldap.server.AbstractAdminTestCase;
 
 
 /**
@@ -32,7 +38,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class OperationalAttributeServiceTest extends AbstractCoreTest
+public class OperationalAttributeServiceTest extends AbstractAdminTestCase
 {
     private static final String CREATORS_NAME = "creatorsName";
     private static final String CREATE_TIMESTAMP = "createTimestamp";

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/operational/OperationalAttributeServiceTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/PreferencesUtilsTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerPreferencesFactoryTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerPreferencesFactoryTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerPreferencesFactoryTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerPreferencesFactoryTest.java Mon Jun 13 22:09:25 2005
@@ -17,10 +17,10 @@
 package org.apache.ldap.server.prefs;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
-
 import java.util.prefs.Preferences;
 
+import org.apache.ldap.server.AbstractAdminTestCase;
+
 
 /**
  * Test cases for the server PreferencessFactory.
@@ -28,16 +28,14 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ServerPreferencesFactoryTest extends AbstractCoreTest
+public class ServerPreferencesFactoryTest extends AbstractAdminTestCase
 {
     public void testSystemRoot()
     {
         ServerPreferencesFactory factory = new ServerPreferencesFactory();
-
         Preferences prefs = factory.systemRoot();
 
         assertNotNull( prefs );
-
-        assertEquals( "sysPrefRoot", prefs.get( "prefNodeName", "sysPrefRoot" ) );
+        assertEquals( "sysPrefRoot", prefs.get( "prefNodeName", "default value" ) );
     }
 }

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerPreferencesFactoryTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerSystemPreferencesTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerSystemPreferencesTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerSystemPreferencesTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerSystemPreferencesTest.java Mon Jun 13 22:09:25 2005
@@ -17,11 +17,11 @@
 package org.apache.ldap.server.prefs;
 
 
-import org.apache.ldap.server.AbstractCoreTest;
-
 import java.util.prefs.BackingStoreException;
 import java.util.prefs.Preferences;
 
+import org.apache.ldap.server.AbstractAdminTestCase;
+
 
 /**
  * Tests the ServerSystemPreferences class.
@@ -29,19 +29,24 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ServerSystemPreferencesTest extends AbstractCoreTest
+public class ServerSystemPreferencesTest extends AbstractAdminTestCase
 {
+    private ServerSystemPreferences prefs;
+    
+    public void setUp() throws Exception
+    {
+        super.setUp();
+        prefs = new ServerSystemPreferences();
+    }
+    
     /**
      * Tests to make sure the system preferences root has entry (test, abc123).
      */
-    public void testRoot() throws BackingStoreException
+    public void testRoot() throws Exception
     {
-        ServerSystemPreferences prefs = new ServerSystemPreferences();
-
         assertEquals( "sysPrefRoot", prefs.get( "prefNodeName", "not the value" ) );
     }
 
-
     /**
      * Tests the creation and use of a new preferences node.
      *
@@ -49,12 +54,9 @@
      */
     public void testCreate() throws BackingStoreException
     {
-        Preferences prefs = new ServerSystemPreferences();
-
         Preferences testNode = prefs.node( "testNode" );
 
         testNode.put( "testNodeKey", "testNodeValue" );
-
         testNode.sync();
     }
 
@@ -66,38 +68,25 @@
      */
     public void testCreateAndSet() throws BackingStoreException
     {
-        Preferences prefs = new ServerSystemPreferences();
-
         Preferences testNode = prefs.node( "testNode" );
 
         testNode.put( "testNodeKey", "testNodeValue" );
-
         testNode.sync();
 
         testNode.putBoolean( "boolKey", true );
-
         testNode.putByteArray( "arrayKey", new byte[10] );
-
         testNode.putDouble( "doubleKey", 3.14 );
-
         testNode.putFloat( "floatKey", ( float ) 3.14 );
-
         testNode.putInt( "intKey", 345 );
-
         testNode.putLong( "longKey", 75449559185447L );
-
         testNode.sync();
 
         testNode = prefs.node( "testNode" );
 
         assertEquals( true, testNode.getBoolean( "boolKey", false ) );
-
         assertTrue( 3.14 == testNode.getDouble( "doubleKey", 9.20 ) );
-
         assertTrue( (float) 3.14 == testNode.getFloat( "floatKey", (float) 3.90 ) );
-
         assertEquals( 345, testNode.getInt( "intKey", 87 ) );
-
         assertEquals( 75449559185447L, testNode.getLong( "longKey", 75449547L ) );
     }
 
@@ -109,52 +98,36 @@
      */
     public void testCreateAndRemove() throws BackingStoreException
     {
-        Preferences prefs = new ServerSystemPreferences();
-
         Preferences testNode = prefs.node( "testNode" );
 
         testNode.put( "testNodeKey", "testNodeValue" );
-
         testNode.sync();
 
         testNode.putBoolean( "boolKey", true );
-
         testNode.putByteArray( "arrayKey", new byte[10] );
-
         testNode.putDouble( "doubleKey", 3.14 );
-
         testNode.putFloat( "floatKey", ( float ) 3.14 );
-
         testNode.putInt( "intKey", 345 );
-
         testNode.putLong( "longKey", 75449559185447L );
-
         testNode.sync();
 
         testNode = prefs.node( "testNode" );
 
         assertEquals( true, testNode.getBoolean( "boolKey", false ) );
-
         assertTrue( 3.14 == testNode.getDouble( "doubleKey", 9.20 ) );
-
         assertTrue( (float) 3.14 == testNode.getFloat( "floatKey", (float) 3.90 ) );
-
         assertEquals( 345, testNode.getInt( "intKey", 87 ) );
-
         assertEquals( 75449559185447L, testNode.getLong( "longKey", 75449547L ) );
 
         testNode.remove( "doubleKey" );
-
         testNode.remove( "arrayKey" );
 
         assertEquals( "no value", testNode.get( "doubleKey", "no value" ) );
-
         assertEquals( "no value", testNode.get( "arrayKey", "no value" ) );
 
         testNode.sync();
 
         assertEquals( "no value", testNode.get( "doubleKey", "no value" ) );
-
         assertEquals( "no value", testNode.get( "arrayKey", "no value" ) );
     }
 }

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/prefs/ServerSystemPreferencesTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoaderTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/test/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoaderTest.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoaderTest.java (original)
+++ directory/apacheds/trunk/core/src/test/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoaderTest.java Mon Jun 13 22:09:25 2005
@@ -17,13 +17,17 @@
 package org.apache.ldap.server.schema.bootstrap;
 
 
-import junit.framework.TestCase;
-import org.apache.ldap.common.schema.AttributeType;
-
-import javax.naming.NamingException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+
+import javax.naming.NamingException;
+
+import junit.framework.TestCase;
+
+import org.apache.ldap.common.schema.AttributeType;
 
 
 /**
@@ -54,19 +58,19 @@
     public void testLoadAll() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        String[] schemaClasses = {
-            "org.apache.ldap.server.schema.bootstrap.AutofsSchema",
-            "org.apache.ldap.server.schema.bootstrap.CoreSchema",
-            "org.apache.ldap.server.schema.bootstrap.CosineSchema",
-            "org.apache.ldap.server.schema.bootstrap.CorbaSchema",
-            "org.apache.ldap.server.schema.bootstrap.ApacheSchema",
-            "org.apache.ldap.server.schema.bootstrap.InetorgpersonSchema",
-            "org.apache.ldap.server.schema.bootstrap.JavaSchema",
-            "org.apache.ldap.server.schema.bootstrap.Krb5kdcSchema",
-            "org.apache.ldap.server.schema.bootstrap.NisSchema",
-            "org.apache.ldap.server.schema.bootstrap.SystemSchema"
-        };
-        loader.load( schemaClasses, registries );
+        Set schemas = new HashSet();
+        schemas.add( new AutofsSchema() );
+        schemas.add( new CoreSchema() );
+        schemas.add( new CosineSchema() );
+        schemas.add( new CorbaSchema() );
+        schemas.add( new ApacheSchema() );
+        schemas.add( new InetorgpersonSchema() );
+        schemas.add( new JavaSchema() );
+        schemas.add( new Krb5kdcSchema() );
+        schemas.add( new NisSchema() );
+        schemas.add( new SystemSchema() );
+
+        loader.load( schemas, registries );
         AttributeType type;
 
         // from autofs.schema
@@ -153,11 +157,12 @@
     public void testEveDepsSchemaLoad() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        String[] schemaClasses = {
-            "org.apache.ldap.server.schema.bootstrap.ApacheSchema",
-            "org.apache.ldap.server.schema.bootstrap.SystemSchema"
-        };
-        loader.load( schemaClasses, registries );
+        
+        Set schemas = new HashSet();
+        schemas.add( new ApacheSchema() );
+        schemas.add( new SystemSchema() );
+        
+        loader.load( schemas, registries );
         AttributeType type;
         type = registries.getAttributeTypeRegistry().lookup( "apacheNdn" );
         assertNotNull( type );
@@ -193,11 +198,12 @@
     public void testCoreDepsSchemaLoad() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        String[] schemaClasses = {
-            "org.apache.ldap.server.schema.bootstrap.CoreSchema",
-            "org.apache.ldap.server.schema.bootstrap.SystemSchema"
-        };
-        loader.load( schemaClasses, registries );
+
+        Set schemas = new HashSet();
+        schemas.add( new CoreSchema() );
+        schemas.add( new SystemSchema() );
+        
+        loader.load( schemas, registries );
         AttributeType type;
         type = registries.getAttributeTypeRegistry().lookup( "knowledgeInformation" );
         assertNotNull( type );
@@ -233,12 +239,13 @@
     public void testJavaDepsSchemaLoad() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        String[] schemaClasses = {
-            "org.apache.ldap.server.schema.bootstrap.CoreSchema",
-            "org.apache.ldap.server.schema.bootstrap.JavaSchema",
-            "org.apache.ldap.server.schema.bootstrap.SystemSchema"
-        };
-        loader.load( schemaClasses, registries );
+
+        Set schemas = new HashSet();
+        schemas.add( new CoreSchema() );
+        schemas.add( new JavaSchema() );
+        schemas.add( new SystemSchema() );
+        
+        loader.load( schemas, registries );
         AttributeType type;
         type = registries.getAttributeTypeRegistry().lookup( "javaFactory" );
         assertNotNull( type );
@@ -254,13 +261,14 @@
     public void testEveAndJavaDepsSchemaLoad() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        String[] schemaClasses = {
-            "org.apache.ldap.server.schema.bootstrap.ApacheSchema",
-            "org.apache.ldap.server.schema.bootstrap.CoreSchema",
-            "org.apache.ldap.server.schema.bootstrap.JavaSchema",
-            "org.apache.ldap.server.schema.bootstrap.SystemSchema"
-        };
-        loader.load( schemaClasses, registries );
+
+        Set schemas = new HashSet();
+        schemas.add( new ApacheSchema() );
+        schemas.add( new CoreSchema() );
+        schemas.add( new JavaSchema() );
+        schemas.add( new SystemSchema() );
+
+        loader.load( schemas, registries );
         AttributeType type;
         type = registries.getAttributeTypeRegistry().lookup( "apacheAlias" );
         assertNotNull( type );

Propchange: directory/apacheds/trunk/core/src/test/org/apache/ldap/server/schema/bootstrap/BootstrapSchemaLoaderTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/main/project.properties
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/project.properties?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/main/project.properties (original)
+++ directory/apacheds/trunk/main/project.properties Mon Jun 13 22:09:25 2005
@@ -1,5 +1,4 @@
 
-
 #
 # Javaapp plugin properties
 #

Modified: directory/apacheds/trunk/main/project.xml
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/project.xml?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/main/project.xml (original)
+++ directory/apacheds/trunk/main/project.xml Mon Jun 13 22:09:25 2005
@@ -101,7 +101,7 @@
       <dependency>
         <groupId>directory-protocols</groupId>
         <artifactId>ldap-protocol</artifactId>
-        <version>0.9</version>
+        <version>0.9.1-SNAPSHOT</version>
       </dependency>
       <dependency>
         <groupId>directory-protocols</groupId>
@@ -126,7 +126,7 @@
     <dependency>
       <groupId>directory-network</groupId>
       <artifactId>mina</artifactId>
-      <version>0.7.2-SNAPSHOT</version>
+      <version>0.7.3-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>${pom.groupId}</groupId>
@@ -138,6 +138,24 @@
       <artifactId>maven-javaapp-plugin</artifactId>
       <version>1.3</version>
       <type>plugin</type>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>1.2.1</version>
+      <url>http://www.springframework.com/</url>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>1.2.1</version>
+      <url>http://www.springframework.com/</url>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>1.2.1</version>
+      <url>http://www.springframework.com/</url>
     </dependency>
   </dependencies>
 

Modified: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java (original)
+++ directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java Mon Jun 13 22:09:25 2005
@@ -17,15 +17,17 @@
 package org.apache.ldap.server;
 
 
-import java.io.File;
 import java.util.Properties;
 
 import javax.naming.Context;
-import javax.naming.NamingException;
 import javax.naming.directory.InitialDirContext;
 
-import org.apache.ldap.common.util.PropertiesUtils;
-import org.apache.ldap.server.jndi.EnvKeys;
+import org.apache.ldap.server.configuration.MutableServerStartupConfiguration;
+import org.apache.ldap.server.configuration.ServerStartupConfiguration;
+import org.apache.ldap.server.configuration.SyncConfiguration;
+import org.apache.ldap.server.jndi.ServerContextFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
 
 
 /**
@@ -37,48 +39,37 @@
  */
 public class ServerMain
 {
-    /** the default LDAP port to use */
-    private static final int LDAP_PORT = 389;
-
     /**
      * Takes a single argument, an optional properties file to load with server
      * startup settings.
      *
      * @param args the arguments
      */
-    public static void main( String[] args )
+    public static void main( String[] args ) throws Exception
     {
         long startTime = System.currentTimeMillis();
         Properties env;
+        ServerStartupConfiguration cfg;
 
         if ( args.length > 0 )
         {
-            System.out.println( "server: loading properties from " + args[0] );
-            env = PropertiesUtils.getProperties( new File( args[0] ) );
+            System.out.println( "server: loading settings from " + args[0] );
+            ApplicationContext factory = new FileSystemXmlApplicationContext( args[0] );
+            cfg = ( ServerStartupConfiguration ) factory.getBean( "configuration" );
+            env = ( Properties ) factory.getBean( "environment" );
         }
         else
         {
-            System.out.println( "server: using default properties ..." );
+            System.out.println( "server: using default settings ..." );
             env = new Properties();
-        }
-
-        if ( ! env.containsKey( EnvKeys.LDAP_PORT ) )
-        {
-            int port = LDAP_PORT;
-            env.setProperty( EnvKeys.LDAP_PORT, String.valueOf( port ) );
+            cfg = new MutableServerStartupConfiguration();
         }
 
         env.setProperty( Context.PROVIDER_URL, "ou=system" );
-        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.ServerContextFactory" );
+        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
+        env.putAll( cfg.toJndiEnvironment() );
 
-        try
-        {
-            new InitialDirContext( env );
-        }
-        catch ( NamingException e )
-        {
-            e.printStackTrace();
-        }
+        new InitialDirContext( env );
 
         System.out.println( "server: started in "
                 + ( System.currentTimeMillis() - startTime )
@@ -90,21 +81,13 @@
             {
                 // this is a big time cludge for now to just play
                 Thread.sleep( 20000 );
-
-                try
-                {
-                    env.setProperty( EnvKeys.SYNC, "true" );
-                    new InitialDirContext( env );
-                }
-                catch ( NamingException e )
-                {
-                    e.printStackTrace();
-                }
             }
             catch ( InterruptedException e )
             {
-                e.printStackTrace();
             }
+
+            env.putAll( new SyncConfiguration().toJndiEnvironment() );
+            new InitialDirContext( env );
         }
     }
 }

Propchange: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/ServerMain.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Copied: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/MutableServerStartupConfiguration.java (from r190553, directory/apacheds/branches/direve-158/main/src/main/java/org/apache/ldap/server/configuration/MutableServerStartupConfiguration.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/MutableServerStartupConfiguration.java?p2=directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/MutableServerStartupConfiguration.java&p1=directory/apacheds/branches/direve-158/main/src/main/java/org/apache/ldap/server/configuration/MutableServerStartupConfiguration.java&r1=190553&r2=190555&rev=190555&view=diff
==============================================================================
    (empty)

Propchange: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/MutableServerStartupConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Copied: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/ServerStartupConfiguration.java (from r190553, directory/apacheds/branches/direve-158/main/src/main/java/org/apache/ldap/server/configuration/ServerStartupConfiguration.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/ServerStartupConfiguration.java?p2=directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/ServerStartupConfiguration.java&p1=directory/apacheds/branches/direve-158/main/src/main/java/org/apache/ldap/server/configuration/ServerStartupConfiguration.java&r1=190553&r2=190555&rev=190555&view=diff
==============================================================================
    (empty)

Propchange: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/configuration/ServerStartupConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java?rev=190555&r1=190554&r2=190555&view=diff
==============================================================================
--- directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java (original)
+++ directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java Mon Jun 13 22:09:25 2005
@@ -20,26 +20,25 @@
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.util.Hashtable;
-import java.util.Properties;
 import java.util.Iterator;
+import java.util.Properties;
 
-import javax.naming.Context;
 import javax.naming.NamingException;
-import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.Control;
+import javax.naming.ldap.InitialLdapContext;
 
+import org.apache.kerberos.protocol.KerberosProtocolProvider;
+import org.apache.kerberos.service.KdcConfiguration;
+import org.apache.kerberos.store.JndiPrincipalStoreImpl;
+import org.apache.kerberos.store.PrincipalStore;
 import org.apache.ldap.common.exception.LdapConfigurationException;
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.common.util.PropertiesUtils;
+import org.apache.ldap.server.configuration.ServerStartupConfiguration;
 import org.apache.ldap.server.protocol.LdapProtocolProvider;
 import org.apache.mina.common.TransportType;
 import org.apache.mina.registry.Service;
 import org.apache.mina.registry.ServiceRegistry;
-import org.apache.mina.registry.SimpleServiceRegistry;
-import org.apache.kerberos.service.KdcConfiguration;
-import org.apache.kerberos.protocol.KerberosProtocolProvider;
-import org.apache.kerberos.store.PrincipalStore;
-import org.apache.kerberos.store.JndiPrincipalStoreImpl;
 
 
 /**
@@ -52,11 +51,6 @@
  */
 public class ServerContextFactory extends CoreContextFactory
 {
-    /** the default LDAP port to use */
-    private static final int LDAP_PORT = 389;
-
-    private static final ServiceRegistry DEFAULT_MINA_REGISTRY;
-    
     private static Service ldapService;
 
     private static Service kerberosService;
@@ -64,142 +58,52 @@
     private static ServiceRegistry minaRegistry;
 
 
-    static
-    {
-        ServiceRegistry tmp = null;
-
-        try
-        {
-            tmp = new SimpleServiceRegistry();
-        }
-        catch( IOException e )
-        {
-            e.printStackTrace();
-        }
-        
-        DEFAULT_MINA_REGISTRY = tmp;
-    }
-
     // ------------------------------------------------------------------------
     // Members
     // ------------------------------------------------------------------------
 
-
-    /**
-     * Checks first for a shutdown operation and if so stops the server.  Otherwise
-     * it initializes the networking subsystem starting up the mina registery and
-     * other protocol provider services if enabled including the LDAP provider.
-     *
-     * @param env the JNDI environment parameters
-     * @return the new LDAP context to be wrapped by InitialContext
-     * @throws NamingException if there are problems starting or stopping the server
-     */
-    public Context getInitialContext( Hashtable env ) throws NamingException
+    protected void afterShutdown( ContextFactoryContext ctx )
     {
-        Context ctx = null;
-
-        if ( env.containsKey( EnvKeys.SHUTDOWN ) )
+        if ( minaRegistry != null )
         {
-            if ( this.provider == null )
+            if ( ldapService != null )
             {
-                return new DeadContext();
+                minaRegistry.unbind( ldapService );
+                ldapService = null;
             }
 
-            try
+            if ( kerberosService != null )
             {
-                this.provider.shutdown();
-
-                if ( minaRegistry != null )
-                {
-                    if ( ldapService != null )
-                    {
-                        minaRegistry.unbind( ldapService );
-
-                        ldapService = null;
-                    }
-
-                    if ( kerberosService != null )
-                    {
-                        minaRegistry.unbind( kerberosService );
-
-                        kerberosService = null;
-                    }
-                }
-            }
-            catch( NamingException ne )
-            {
-                throw ne;
+                minaRegistry.unbind( kerberosService );
+                kerberosService = null;
             }
-            catch( Throwable t )
-            {
-                NamingException ne = new NamingException( "Failed to shutdown." );
-
-                ne.setRootCause( t );
-
-                throw ne;
-            }
-            finally
-            {
-                ctx = new DeadContext();
-
-                provider = null;
-
-                initialEnv = null;
-            }
-
-            return ctx;
         }
+    }
+    
+    protected void afterStartup( ContextFactoryContext ctx ) throws NamingException
+    {
+        ServerStartupConfiguration cfg =
+            ( ServerStartupConfiguration ) ctx.getConfiguration();
+        Hashtable env = ctx.getEnvironment();
 
-        ctx = super.getInitialContext( env );
-
-        // fire up the front end if we have not explicitly disabled it
-
-        if ( initialEnv != null && ! initialEnv.containsKey( EnvKeys.DISABLE_PROTOCOL ) )
+        if ( cfg.isEnableNetworking() )
         {
-            setupRegistry();
-
-            startLdapProtocol();
+            setupRegistry( cfg );
+            startLdapProtocol( cfg, env );
 
-            if ( initialEnv.containsKey( EnvKeys.ENABLE_KERBEROS ) )
+            if ( cfg.isEnableKerberos() )
             {
-                startKerberosProtocol();
+                startKerberosProtocol( env );
             }
         }
-
-        return ctx;
     }
 
-
     /**
      * Starts up the MINA registry so various protocol providers can be started.
-     *
-     * @throws NamingException if there is a problem initializing the registry
      */
-    private void setupRegistry() throws NamingException
+    private void setupRegistry( ServerStartupConfiguration cfg )
     {
-        ServiceRegistry registry = null;
-
-        if ( initialEnv.containsKey( EnvKeys.PASSTHRU ) )
-        {
-            registry = ( ServiceRegistry ) initialEnv.get( EnvKeys.PASSTHRU );
-
-            if ( registry != null )
-            {
-                initialEnv.put( EnvKeys.PASSTHRU, "Handoff Succeeded!" );
-            }
-        }
-
-        if( DEFAULT_MINA_REGISTRY == null )
-        {
-            throw new NamingException( "Default MINA service registry is not available." );
-        }
-
-        if( registry == null )
-        {
-            registry = DEFAULT_MINA_REGISTRY;
-        }
-
-        minaRegistry = registry;
+        minaRegistry = cfg.getMinaServiceRegistry();
     }
 
 
@@ -208,7 +112,7 @@
      *
      * @throws NamingException if there are problems starting up the Kerberos provider
      */
-    private void startKerberosProtocol() throws NamingException
+    private void startKerberosProtocol( Hashtable env ) throws NamingException
     {
         /*
          * Looks like KdcConfiguration takes properties and we use Hashtable for JNDI
@@ -216,26 +120,24 @@
          */
 
         Properties props = new Properties();
-
-        Iterator list = initialEnv.keySet().iterator();
-
+        Iterator list = env.keySet().iterator();
         while ( list.hasNext() )
         {
             String key = ( String ) list.next();
 
-            if ( initialEnv.get( key ) instanceof String )
+            if ( env.get( key ) instanceof String )
             {
-                props.setProperty( key, ( String ) initialEnv.get( key ) );
+                props.setProperty( key, ( String ) env.get( key ) );
             }
         }
 
         KdcConfiguration config = new KdcConfiguration( props );
 
-        int port = PropertiesUtils.get( initialEnv, KdcConfiguration.KERBEROS_PORT_KEY, KdcConfiguration.DEFAULT_KERBEROS_PORT );
+        int port = PropertiesUtils.get( env, KdcConfiguration.KERBEROS_PORT_KEY, KdcConfiguration.DEFAULT_KERBEROS_PORT );
 
         Service service= new Service( "kerberos", TransportType.DATAGRAM, new InetSocketAddress( port ) );
 
-        InitialLdapContext ctx = new InitialLdapContext( initialEnv, new Control[]{} );
+        InitialLdapContext ctx = new InitialLdapContext( env, new Control[]{} );
 
         PrincipalStore store = new JndiPrincipalStoreImpl( ctx, new LdapName( "ou=Users" ) );
 
@@ -257,15 +159,15 @@
      *
      * @throws NamingException if there are problems starting the LDAP provider
      */
-    private void startLdapProtocol() throws NamingException
+    private void startLdapProtocol( ServerStartupConfiguration cfg, Hashtable env ) throws NamingException
     {
-        int port = PropertiesUtils.get( initialEnv, EnvKeys.LDAP_PORT, LDAP_PORT );
+        int port = cfg.getLdapPort();
 
         Service service = new Service( "ldap", TransportType.SOCKET, new InetSocketAddress( port ) );
 
         try
         {
-            minaRegistry.bind( service, new LdapProtocolProvider( ( Hashtable ) initialEnv.clone() ) );
+            minaRegistry.bind( service, new LdapProtocolProvider( ( Hashtable ) env.clone() ) );
 
             ldapService = service;
         }

Propchange: directory/apacheds/trunk/main/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Jun 13 22:09:25 2005
@@ -1 +1 @@
-Rev
+HeadURL Id LastChangedBy LastChangedDate LastChangedRevision



Mime
View raw message