directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r379013 [43/45] - in /directory/trunks/apacheds: ./ core-plugin/ core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/ core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/ core-shared/ core-shared/src/...
Date Mon, 20 Feb 2006 03:58:21 GMT
Modified: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java (original)
+++ directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java Sun Feb 19 19:57:02 2006
@@ -16,21 +16,11 @@
  */
 package org.apache.directory.server.tools;
 
-
 import java.io.IOException;
 import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
 import java.util.Properties;
 
 import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
 import org.apache.directory.server.configuration.ServerStartupConfiguration;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.FileSystemXmlApplicationContext;
@@ -44,123 +34,67 @@
  */
 public class ApachedsTools
 {
-    private final static Map commands = new HashMap();
-    private final static Options global = new Options();
-    private final static Properties props = new Properties();
-    private final static String version;
-    
-    static
+    public static void main( String[] args ) throws Exception
     {
-        ToolCommand command;
-        command = new DumpCommand();
-        commands.put( command.getName(), command );
-        command = new GracefulShutdownCommand();
-        commands.put( command.getName(), command );
-        command = new DiagnosticCommand();
-        commands.put( command.getName(), command );
-        command = new DisconnectNotificationCommand();
-        commands.put( command.getName(), command );
-
-        Option op = new Option( "i", "install-path", true, "path to apacheds installation directory" );
-        global.addOption( op );
-        op = new Option( "b", "banner", false, "suppress banner print outs" );
-        global.addOption( op );
-        op = new Option( "d", "debug", false, "toggle debug mode" );
-        global.addOption( op );
-        op = new Option( "v", "verbose", false, "toggle verbose debugging" );
-        global.addOption( op );
-        op = new Option( "q", "quiet", false, "keep the noise down to a minimum" );
-        global.addOption( op );
-        op = new Option( "c", "configuration", false, "force loading the server.xml (requires -i)" );
-        global.addOption( op );
-        op = new Option( "version", false, "print the version information and exit" );
-        global.addOption( op );
-        
-        try
-        {
-            props.load( ApachedsTools.class.getResourceAsStream( "ApachedsTools.properties" ) );
-        }
-        catch ( IOException e )
-        {
-            e.printStackTrace();
-        }
+        BaseCommand tools = getInstance();
         
-        version = props.getProperty( "apacheds.tools.version" );
-    }
-    
-    
-    private static boolean hasBannerOption( String[] args )
-    {
-        for ( int ii = 0; ii < args.length; ii++ )
-        {
-            if ( args[ii].equals( "-b" ) || args[ii].equals( "-banner" ))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-
-    public static void main( String [] args ) throws Exception
-    {
-        if ( ! hasBannerOption( args ) )
+        if ( !BaseCommand.hasBannerOption( args ) )
         {
-            printBanner();
+            tools.printBanner();
         }
 
         if ( args.length == 0 )
         {
-            System.err.println( "Type apacheds-tools help for usage." );
+            System.err.println( "Type " + tools.getProductCommand() + " help for usage." );
             System.exit( 1 );
         }
-        
+
         // help is a special command 
         String command = args[0].toLowerCase();
         if ( "help".equals( command ) )
         {
-            CommandLine cmdline = getCommandLine( command, args );
+            CommandLine cmdline = tools.getCommandLine( command, args );
             if ( cmdline.getArgs().length > 1 )
             {
-                helpOnCommand( cmdline.getArgs()[1] );
+                tools.helpOnCommand( cmdline.getArgs()[1] );
                 System.exit( 0 );
             }
             else
             {
-                printUsage();
+                tools.printUsage();
                 System.exit( 0 );
             }
         }
-        else if ( command.equals( "-version" ) ) 
+        else if ( command.equals( "-version" ) )
         {
-            System.out.println( "apacheds-tools version " + version );
+            System.out.println( tools.getProductCommand() + " version " + tools.getProductVersion() );
             System.exit( 0 );
         }
-        
-        ToolCommand cmd = ( ToolCommand ) commands.get( command );
+
+        ToolCommand cmd = ( ToolCommand ) tools.getCommands().get( command );
         if ( cmd == null )
         {
             System.err.println( "Unknown command: " + args[0] );
-            System.err.println( "Type apacheds-tools help for usage." );
+            System.err.println( "Type " + tools.getProductCommand() + " help for usage." );
             System.exit( 1 );
-        }        
-        
-        CommandLine cmdline = getCommandLine( command, args );
+        }
+
+        CommandLine cmdline = tools.getCommandLine( command, args );
         if ( cmdline.hasOption( 'd' ) )
         {
             cmd.setDebugEnabled( true );
-            dumpArgs( "raw command line arguments: ", args );
-            dumpArgs( "parsed arguments: ", cmdline.getArgs() );
+            BaseCommand.dumpArgs( "raw command line arguments: ", args );
+            BaseCommand.dumpArgs( "parsed arguments: ", cmdline.getArgs() );
         }
-        
+
         cmd.setQuietEnabled( cmdline.hasOption( 'q' ) );
         cmd.setDebugEnabled( cmdline.hasOption( 'd' ) );
         cmd.setVerboseEnabled( cmdline.hasOption( 'v' ) );
-        cmd.setVersion( version );
+        cmd.setVersion( tools.getProductVersion() );
         if ( cmdline.getOptionValue( 'i' ) != null )
         {
             cmd.setLayout( cmdline.getOptionValue( 'i' ) );
-            if ( ! cmd.isQuietEnabled() )
+            if ( !cmd.isQuietEnabled() )
             {
                 System.out.println( "loading settings from: " + cmd.getLayout().getConfigurationFile() );
             }
@@ -174,120 +108,36 @@
             System.err.println( "forced configuration load (-c) requires the -i option" );
             System.exit( 1 );
         }
-        
+
         cmd.execute( cmdline );
     }
-    
 
-    private static CommandLine getCommandLine( String command, String[] args )
-    {
-        Options all = allOptions( command );
-        CommandLineParser parser = new PosixParser();
-        CommandLine cmdline = null;
-        try
-        {
-            cmdline = parser.parse( all, args );
-        }
-        catch( ParseException e )
-        {
-            System.err.println( "Command line parsing failed for " + command 
-                + ".  Reason: " + e.getMessage() );
-            System.exit( 1 );
-        }
-        return cmdline;
-    }
-    
-    
-    private static Options allOptions( String command )
-    {
-        if ( command.equals( "help" ) )
-        {
-            return global;
-        }
-        
-        Options all = new Options();
-        ToolCommand cmd = ( ToolCommand ) commands.get( command );
-        for ( Iterator ii = global.getOptions().iterator(); ii.hasNext(); )
-        {
-            all.addOption( ( Option ) ii.next() );
-        }
-        
-        for ( Iterator ii = cmd.getOptions().getOptions().iterator(); ii.hasNext(); )
-        {
-            all.addOption( ( Option ) ii.next() );
-        }
-        return all;
-    }
 
-    
-    private static void dumpArgs( String msg, String[] args )
-    {
-        if ( args.length == 0 )
-        {
-            System.out.println( msg );
-            System.out.println( "\t NONE" );
-            return;
-        }
-        
-        StringBuffer buf = new StringBuffer();
-        buf.append( msg ).append( "\n" );
-        for ( int ii = 0; ii < args.length; ii++ )
-        {
-            buf.append( "\targs[" + ii + "] = " ).append( args[ii] ).append( "\n" );
-        }
-        System.out.println( buf );
-    }
-    
-    
-    private static void helpOnCommand( String command )
+    public static BaseCommand getInstance() throws InstantiationException, IllegalAccessException, ClassNotFoundException
     {
-        if ( command.equals( "help" ) )
-        {
-            printUsage();
-            System.exit( 0 );
-        }
-        if ( commands.containsKey( command ) )
-        {
-            ToolCommand cmd = ( ToolCommand ) commands.get( command );
-            HelpFormatter formatter = new HelpFormatter();
-            formatter.printHelp( "apacheds-tools "+cmd+" [options]", cmd.getOptions() );
-        }
-        else
+        Properties props = new Properties();
+        try
         {
-            System.err.println( command + ": unknown command" );
-            System.exit( 1 );
+            props.load( BaseCommand.class.getResourceAsStream( "product.properties" ) );
         }
-    }
-
-
-    private static void printUsage()
-    {
-        HelpFormatter formatter = new HelpFormatter();
-        formatter.printHelp( "apacheds-tools <command> [options]", 
-            "\nGlobal options:", global, "\nType \"apacheds-tools help <command>\" for help on a command." );
-        System.out.println( "\nAvalable commands:" );
-        Iterator it = commands.values().iterator();
-        System.out.println( "\thelp" );
-        while( it.hasNext() )
+        catch ( IOException e )
         {
-            System.out.println( "\t" + it.next() );
+            e.printStackTrace();
         }
-        
-        System.out.println( "\nThese apacheds-tools are used to manage the Apache Directory Server." );
-        System.out.println( "For additional information, see http://directory.apache.org/" );
-    }
-    
 
-    public static final String BANNER = 
-        "       _                     _          ____  ____    _____           _      \n" +
-        "      / \\   _ __   __ _  ___| |__   ___|  _ \\/ ___|  |_   _|__   ___ | |___  \n" +
-        "     / _ \\ | '_ \\ / _` |/ __| '_ \\ / _ \\ | | \\___ \\    | |/ _ \\ / _ \\| / __| \n" +
-        "    / ___ \\| |_) | (_| | (__| | | |  __/ |_| |___) |   | | (_) | (_) | \\__ \\ \n" +
-        "   /_/   \\_\\ .__/ \\__,_|\\___|_| |_|\\___|____/|____/    |_|\\___/ \\___/|_|___/ \n" +
-        "           |_|                                                               \n";
-
-    public static void printBanner()
-    {
-        System.out.println( BANNER );
+        String productVersion = props.getProperty( "product.version", "UNKNOWN" );
+        String productUrl = props.getProperty( "product.url", "http://directory.apache.org" );
+        String productDisplayName = props.getProperty( "product.display.name", "Apache Directory Server" );
+        String productCommand = props.getProperty( "product.command", "apacheds-tools" );
+        String productBanner = props.getProperty( "product.banner", BaseCommand.BANNER );
+        String productClass = props.getProperty( "product.class", "org.apache.directory.server.tools.BaseCommand" );
+        
+        BaseCommand baseCommand = ( BaseCommand ) Class.forName( productClass ).newInstance();
+        baseCommand.setProductBanner( productBanner );
+        baseCommand.setProductDisplayName( productDisplayName );
+        baseCommand.setProductUrl( productUrl );
+        baseCommand.setProductVersion( productVersion );
+        baseCommand.setProductCommand( productCommand );
+        return baseCommand;
     }
 }

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java (original)
+++ directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java Sun Feb 19 19:57:02 2006
@@ -40,14 +40,14 @@
  */
 public class DiagnosticCommand extends ToolCommand
 {
-    public static final String PORT_RANGE = "(" + AvailablePortFinder.MIN_PORT_NUMBER + ", " 
-    + AvailablePortFinder.MAX_PORT_NUMBER + ")";
+    public static final String PORT_RANGE = "(" + AvailablePortFinder.MIN_PORT_NUMBER + ", "
+        + AvailablePortFinder.MAX_PORT_NUMBER + ")";
 
     private int port = 10389;
     private String host = "localhost";
     private String password = "secret";
 
-    
+
     protected DiagnosticCommand()
     {
         super( "diagnostic" );
@@ -57,7 +57,7 @@
     public void execute( CommandLine cmd ) throws Exception
     {
         processOptions( cmd );
-        
+
         if ( isDebugEnabled() )
         {
             System.out.println( "Parameters for LaunchDiagnosticUI extended request:" );
@@ -76,8 +76,7 @@
         LdapContext ctx = new InitialLdapContext( env, null );
         if ( isDebugEnabled() )
         {
-            System.out.println( "Connection to the server established.\n"+
-                "Sending extended request ... " );
+            System.out.println( "Connection to the server established.\n" + "Sending extended request ... " );
         }
         ctx.extendedOperation( new LaunchDiagnosticUiRequest( 3 ) );
         ctx.close();
@@ -90,12 +89,12 @@
         {
             System.out.println( "Processing options for launching diagnostic UI ..." );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out and error check the port value
         // -------------------------------------------------------------------
 
-        if ( cmd.hasOption( 'p' ) )   // - user provided port w/ -p takes precedence
+        if ( cmd.hasOption( 'p' ) ) // - user provided port w/ -p takes precedence
         {
             String val = cmd.getOptionValue( 'p' );
             try
@@ -107,20 +106,20 @@
                 System.err.println( "port value of '" + val + "' is not a number" );
                 System.exit( 1 );
             }
-            
+
             if ( port > AvailablePortFinder.MAX_PORT_NUMBER )
             {
-                System.err.println( "port value of '" + val + "' is larger than max port number: " 
+                System.err.println( "port value of '" + val + "' is larger than max port number: "
                     + AvailablePortFinder.MAX_PORT_NUMBER );
                 System.exit( 1 );
             }
             else if ( port < AvailablePortFinder.MIN_PORT_NUMBER )
             {
-                System.err.println( "port value of '" + val + "' is smaller than the minimum port number: " 
+                System.err.println( "port value of '" + val + "' is smaller than the minimum port number: "
                     + AvailablePortFinder.MIN_PORT_NUMBER );
                 System.exit( 1 );
             }
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "port overriden by -p option: " + port );
@@ -129,7 +128,7 @@
         else if ( getConfiguration() != null )
         {
             port = getConfiguration().getLdapPort();
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "port overriden by server.xml configuration: " + port );
@@ -139,7 +138,7 @@
         {
             System.out.println( "port set to default: " + port );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the host value
         // -------------------------------------------------------------------
@@ -147,7 +146,7 @@
         if ( cmd.hasOption( 'h' ) )
         {
             host = cmd.getOptionValue( 'h' );
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "host overriden by -h option: " + host );
@@ -157,7 +156,7 @@
         {
             System.out.println( "host set to default: " + host );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the password value
         // -------------------------------------------------------------------
@@ -184,7 +183,7 @@
         Option op = new Option( "h", "host", true, "server host: defaults to localhost" );
         op.setRequired( false );
         opts.addOption( op );
-        op = new Option(  "p", "port", true, "server port: defaults to 10389 or server.xml specified port" );
+        op = new Option( "p", "port", true, "server port: defaults to 10389 or server.xml specified port" );
         op.setRequired( false );
         opts.addOption( op );
         op = new Option( "w", "password", true, "the apacheds administrator's password: defaults to secret" );

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java (original)
+++ directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java Sun Feb 19 19:57:02 2006
@@ -52,11 +52,12 @@
     private int port = 10389;
     private String bindDn = "uid=admin,ou=system";
     private String password = "secret";
-//    private String shutdownCommand = "echo"; 
-//    private String[] shutdownCommandArgs = new String[] { 
-//        "server $HOST:$PORT will shutdown for $OFFLINE minutes in $DELAY seconds" };
 
-    
+
+    //    private String shutdownCommand = "echo"; 
+    //    private String[] shutdownCommandArgs = new String[] { 
+    //        "server $HOST:$PORT will shutdown for $OFFLINE minutes in $DELAY seconds" };
+
     protected DisconnectNotificationCommand()
     {
         super( "notifications" );
@@ -66,7 +67,7 @@
     public void notificationReceived( UnsolicitedNotificationEvent evt )
     {
         notification = evt.getNotification();
-        
+
         if ( notification.getID().equals( NoticeOfDisconnect.EXTENSION_OID ) )
         {
             System.out.println( "\nRecieved NoticeOfDisconnect: " + NoticeOfDisconnect.EXTENSION_OID );
@@ -79,14 +80,14 @@
             GracefulDisconnect gd = new GracefulDisconnect( notification.getEncodedValue() );
             System.out.println( "LDAP server will shutdown in " + gd.getDelay() + " seconds." );
             System.out.println( "LDAP server will be back online in " + gd.getTimeOffline() + " minutes." );
-            
+
             if ( gd.getDelay() > 0 )
             {
                 Thread t = new Thread( new Counter( gd.getDelay() ) );
                 t.start();
             }
         }
-        else 
+        else
         {
             System.out.println( "Unknown event recieved with OID: " + evt.getNotification().getID() );
         }
@@ -100,29 +101,36 @@
         System.out.println( "Process shutting down abruptly." );
         System.exit( 1 );
     }
-    
-    
+
     class Counter implements Runnable
     {
         int delay;
-        
-        Counter( int delay )
+
+
+        Counter(int delay)
         {
             this.delay = delay;
         }
-        
+
+
         public void run()
         {
             System.out.println( "Starting countdown until server shutdown:" );
-            System.out.print( "[" ); 
+            System.out.print( "[" );
             long delayMillis = delay * 1000 - 1000; // 1000 is for setup costs
             long startTime = System.currentTimeMillis();
             while ( System.currentTimeMillis() - startTime < delayMillis && !canceled )
             {
-                try{ Thread.sleep( 1000 ); }catch ( InterruptedException e ){}
+                try
+                {
+                    Thread.sleep( 1000 );
+                }
+                catch ( InterruptedException e )
+                {
+                }
                 System.out.print( "." );
             }
-            
+
             if ( canceled )
             {
                 System.out.println( " -- countdown canceled -- " );
@@ -140,19 +148,19 @@
     public void execute( CommandLine cmd ) throws Exception
     {
         processOptions( cmd );
-        
+
         Hashtable env = new Hashtable();
-        env.put("java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory");
-        env.put("java.naming.provider.url", "ldap://" + host + ":" + port ); 
-        env.put("java.naming.security.principal", bindDn ); 
-        env.put("java.naming.security.credentials", password );
-        env.put("java.naming.security.authentication", "simple" );
+        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( "java.naming.security.principal", bindDn );
+        env.put( "java.naming.security.credentials", password );
+        env.put( "java.naming.security.authentication", "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
         ctx = ctx.newInstance( null );
         UnsolicitedNotificationListener listener = new DisconnectNotificationCommand();
         ( ( EventContext ) ctx ).addNamingListener( "", SearchControls.SUBTREE_SCOPE, listener );
-        
+
         System.out.println( "Listening for notifications." );
         System.out.println( "Press any key to terminate." );
         System.in.read();
@@ -167,12 +175,12 @@
         {
             System.out.println( "Processing options for disconnect notifications ..." );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out and error check the port value
         // -------------------------------------------------------------------
 
-        if ( cmd.hasOption( 'p' ) )   // - user provided port w/ -p takes precedence
+        if ( cmd.hasOption( 'p' ) ) // - user provided port w/ -p takes precedence
         {
             String val = cmd.getOptionValue( 'p' );
             try
@@ -184,20 +192,20 @@
                 System.err.println( "port value of '" + val + "' is not a number" );
                 System.exit( 1 );
             }
-            
+
             if ( port > AvailablePortFinder.MAX_PORT_NUMBER )
             {
-                System.err.println( "port value of '" + val + "' is larger than max port number: " 
+                System.err.println( "port value of '" + val + "' is larger than max port number: "
                     + AvailablePortFinder.MAX_PORT_NUMBER );
                 System.exit( 1 );
             }
             else if ( port < AvailablePortFinder.MIN_PORT_NUMBER )
             {
-                System.err.println( "port value of '" + val + "' is smaller than the minimum port number: " 
+                System.err.println( "port value of '" + val + "' is smaller than the minimum port number: "
                     + AvailablePortFinder.MIN_PORT_NUMBER );
                 System.exit( 1 );
             }
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "port overriden by -p option: " + port );
@@ -206,7 +214,7 @@
         else if ( getConfiguration() != null )
         {
             port = getConfiguration().getLdapPort();
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "port overriden by server.xml configuration: " + port );
@@ -216,7 +224,7 @@
         {
             System.out.println( "port set to default: " + port );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the host value
         // -------------------------------------------------------------------
@@ -224,7 +232,7 @@
         if ( cmd.hasOption( 'h' ) )
         {
             host = cmd.getOptionValue( 'h' );
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "host overriden by -h option: " + host );
@@ -234,7 +242,7 @@
         {
             System.out.println( "host set to default: " + host );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the password value
         // -------------------------------------------------------------------
@@ -252,7 +260,7 @@
         {
             System.out.println( "password set to default: " + password );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the binddn value
         // -------------------------------------------------------------------
@@ -279,7 +287,7 @@
         Option op = new Option( "h", "host", true, "server host: defaults to localhost" );
         op.setRequired( false );
         opts.addOption( op );
-        op = new Option(  "p", "port", true, "server port: defaults to 10389 or server.xml specified port" );
+        op = new Option( "p", "port", true, "server port: defaults to 10389 or server.xml specified port" );
         op.setRequired( false );
         opts.addOption( op );
         op = new Option( "w", "password", true, "the apacheds administrator's password: defaults to secret" );

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java (original)
+++ directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java Sun Feb 19 19:57:02 2006
@@ -50,7 +50,6 @@
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 
 
-
 /**
  * Simple tool used to dump the contents of a jdbm based partition.
  * 
@@ -63,14 +62,14 @@
     private BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
     private Set exclusions = new HashSet();
     private boolean includeOperational = false;
-    
-    
+
+
     public DumpCommand()
     {
         super( "dump" );
     }
-    
-    
+
+
     public void execute( CommandLine cmdline ) throws Exception
     {
         getLayout().verifyInstallation();
@@ -80,7 +79,7 @@
         String[] partitions = cmdline.getOptionValues( 'p' );
         String outputFile = cmdline.getOptionValue( 'f' );
         PrintWriter out = null;
-        
+
         String[] excludedAttributes = cmdline.getOptionValues( 'e' );
         if ( excludedAttributes != null )
         {
@@ -91,7 +90,7 @@
                 exclusions.add( type.getName() );
             }
         }
-        
+
         if ( outputFile == null )
         {
             out = new PrintWriter( System.out );
@@ -100,7 +99,7 @@
         {
             out = new PrintWriter( new FileWriter( outputFile ) );
         }
-        
+
         for ( int ii = 0; ii < partitions.length; ii++ )
         {
             File partitionDirectory = new File( getLayout().getPartitionsDirectory(), partitions[ii] );
@@ -108,20 +107,20 @@
             dump( partitionDirectory, out );
         }
     }
-    
-    
+
+
     private void dump( File partitionDirectory, PrintWriter out ) throws Exception
     {
-        if ( ! partitionDirectory.exists() )
+        if ( !partitionDirectory.exists() )
         {
             System.err.println( "Partition directory " + partitionDirectory + " does not exist!" );
             System.exit( 1 );
         }
 
-        out.println( "# ========================================================================");
+        out.println( "# ========================================================================" );
         out.println( "# ApacheDS Tools Version: " + getVersion() );
         out.println( "# Partition Directory: " + partitionDirectory );
-        out.println( "# ========================================================================\n\n");
+        out.println( "# ========================================================================\n\n" );
 
         String path = partitionDirectory.getPath() + File.separator + "master";
         BaseRecordManager base = new BaseRecordManager( path );
@@ -143,8 +142,8 @@
             Attributes entry = ( Attributes ) tuple.getValue();
 
             filterAttributes( dn, entry );
-            
-            if ( ! ( entry instanceof LockableAttributesImpl ) )
+
+            if ( !( entry instanceof LockableAttributesImpl ) )
             {
                 Attributes tmp = entry;
                 entry = new LockableAttributesImpl();
@@ -160,7 +159,7 @@
                     }
                 }
             }
-            
+
             buf.append( "# Entry: " ).append( id ).append( "\n#---------------------\n\n" );
             buf.append( "dn: " ).append( dn ).append( "\n" ).append( entry );
             if ( list.hasMore() )
@@ -182,19 +181,19 @@
         while ( attrs.hasMore() )
         {
             Attribute attr = ( Attribute ) attrs.next();
-            if ( ! registry.hasAttributeType( attr.getID() ) )
+            if ( !registry.hasAttributeType( attr.getID() ) )
             {
-                if ( ! isQuietEnabled() )
+                if ( !isQuietEnabled() )
                 {
-                    System.out.println( "# Cannot properly filter unrecognized attribute " 
-                        + attr.getID() + " in " + dn );
+                    System.out
+                        .println( "# Cannot properly filter unrecognized attribute " + attr.getID() + " in " + dn );
                 }
                 continue;
             }
-            
+
             AttributeType type = registry.lookup( attr.getID() );
             boolean isOperational = type.getUsage() != UsageEnum.USERAPPLICATIONS;
-            if ( exclusions.contains( attr.getID() ) || ( isOperational && ( ! includeOperational ) ) )
+            if ( exclusions.contains( attr.getID() ) || ( isOperational && ( !includeOperational ) ) )
             {
                 toRemove.add( attr.getID() );
             }
@@ -209,15 +208,15 @@
             }
         }
     }
-    
-    
+
+
     public Options getOptions()
     {
         Options opts = new Options();
         Option op = new Option( "f", "file", true, "file to output the dump to" );
         op.setRequired( false );
         opts.addOption( op );
-        op = new Option(  "p", "partitions", true, "the partitions to dump" );
+        op = new Option( "p", "partitions", true, "the partitions to dump" );
         op.setRequired( true );
         op.setValueSeparator( File.pathSeparatorChar );
         opts.addOption( op );

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java (original)
+++ directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java Sun Feb 19 19:57:02 2006
@@ -39,7 +39,7 @@
  */
 public class GracefulShutdownCommand extends ToolCommand
 {
-    public static final String PORT_RANGE = "(" + AvailablePortFinder.MIN_PORT_NUMBER + ", " 
+    public static final String PORT_RANGE = "(" + AvailablePortFinder.MIN_PORT_NUMBER + ", "
         + AvailablePortFinder.MAX_PORT_NUMBER + ")";
 
     private static final int DELAY_MAX = 86400;
@@ -52,7 +52,7 @@
     private int delay;
     private int timeOffline;
 
-    
+
     protected GracefulShutdownCommand()
     {
         super( "graceful" );
@@ -61,11 +61,13 @@
     private boolean isWaiting;
     private boolean isSuccess = false;
     private Thread executeThread = null;
+
+
     public void execute( CommandLine cmd ) throws Exception
     {
         executeThread = Thread.currentThread();
         processOptions( cmd );
-        
+
         if ( isDebugEnabled() )
         {
             System.out.println( "Parameters for GracefulShutdown extended request:" );
@@ -75,7 +77,7 @@
             System.out.println( "delay = " + delay );
             System.out.println( "timeOffline = " + timeOffline );
         }
-        
+
         Hashtable env = new Hashtable();
         env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
         env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
@@ -84,10 +86,10 @@
         env.put( "java.naming.security.authentication", "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
-        if ( ! isQuietEnabled() )
+        if ( !isQuietEnabled() )
         {
-            System.out.println( "Connection to the server established.\n"+
-                "Sending extended request and blocking for shutdown:" );
+            System.out.println( "Connection to the server established.\n"
+                + "Sending extended request and blocking for shutdown:" );
             isWaiting = true;
             Thread t = new Thread( new Ticker() );
             t.start();
@@ -97,7 +99,7 @@
             ctx.extendedOperation( new GracefulShutdownRequest( 0, timeOffline, delay ) );
             isSuccess = true;
         }
-        catch( Throwable t )
+        catch ( Throwable t )
         {
             isSuccess = false;
             System.err.print( "failed with error: " + t.getMessage() );
@@ -105,14 +107,14 @@
         isWaiting = false;
         ctx.close();
     }
-    
-    
+
     class Ticker implements Runnable
     {
         public void run()
         {
-            if ( ! isQuietEnabled() ) System.out.print( "[waiting for shutdown] " );
-            while( isWaiting )
+            if ( !isQuietEnabled() )
+                System.out.print( "[waiting for shutdown] " );
+            while ( isWaiting )
             {
                 try
                 {
@@ -123,11 +125,13 @@
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                 }
-                if ( ! isQuietEnabled() ) System.out.print( "." );
+                if ( !isQuietEnabled() )
+                    System.out.print( "." );
             }
             if ( isSuccess )
             {
-                if ( ! isQuietEnabled() ) System.out.println( "\n[shutdown complete]" );
+                if ( !isQuietEnabled() )
+                    System.out.println( "\n[shutdown complete]" );
                 try
                 {
                     executeThread.join( 1000 );
@@ -140,7 +144,8 @@
             }
             else
             {
-                if ( ! isQuietEnabled() ) System.out.println( "\n[shutdown failed]" );
+                if ( !isQuietEnabled() )
+                    System.out.println( "\n[shutdown failed]" );
                 try
                 {
                     executeThread.join( 1000 );
@@ -161,12 +166,12 @@
         {
             System.out.println( "Processing options for graceful shutdown ..." );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out and error check the port value
         // -------------------------------------------------------------------
 
-        if ( cmd.hasOption( 'p' ) )   // - user provided port w/ -p takes precedence
+        if ( cmd.hasOption( 'p' ) ) // - user provided port w/ -p takes precedence
         {
             String val = cmd.getOptionValue( 'p' );
             try
@@ -178,20 +183,20 @@
                 System.err.println( "port value of '" + val + "' is not a number" );
                 System.exit( 1 );
             }
-            
+
             if ( port > AvailablePortFinder.MAX_PORT_NUMBER )
             {
-                System.err.println( "port value of '" + val + "' is larger than max port number: " 
+                System.err.println( "port value of '" + val + "' is larger than max port number: "
                     + AvailablePortFinder.MAX_PORT_NUMBER );
                 System.exit( 1 );
             }
             else if ( port < AvailablePortFinder.MIN_PORT_NUMBER )
             {
-                System.err.println( "port value of '" + val + "' is smaller than the minimum port number: " 
+                System.err.println( "port value of '" + val + "' is smaller than the minimum port number: "
                     + AvailablePortFinder.MIN_PORT_NUMBER );
                 System.exit( 1 );
             }
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "port overriden by -p option: " + port );
@@ -200,7 +205,7 @@
         else if ( getConfiguration() != null )
         {
             port = getConfiguration().getLdapPort();
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "port overriden by server.xml configuration: " + port );
@@ -210,7 +215,7 @@
         {
             System.out.println( "port set to default: " + port );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the host value
         // -------------------------------------------------------------------
@@ -218,7 +223,7 @@
         if ( cmd.hasOption( 'h' ) )
         {
             host = cmd.getOptionValue( 'h' );
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "host overriden by -h option: " + host );
@@ -228,7 +233,7 @@
         {
             System.out.println( "host set to default: " + host );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the password value
         // -------------------------------------------------------------------
@@ -246,7 +251,7 @@
         {
             System.out.println( "password set to default: " + password );
         }
-        
+
         // -------------------------------------------------------------------
         // figure out the delay value
         // -------------------------------------------------------------------
@@ -263,11 +268,10 @@
                 System.err.println( "delay value of '" + val + "' is not a number" );
                 System.exit( 1 );
             }
-            
+
             if ( delay > DELAY_MAX )
             {
-                System.err.println( "delay value of '" + val 
-                    + "' is larger than max delay (seconds) allowed: " 
+                System.err.println( "delay value of '" + val + "' is larger than max delay (seconds) allowed: "
                     + DELAY_MAX );
                 System.exit( 1 );
             }
@@ -276,7 +280,7 @@
                 System.err.println( "delay value of '" + val + "' is less than zero and makes no sense" );
                 System.exit( 1 );
             }
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "delay seconds overriden by -e option: " + delay );
@@ -287,7 +291,6 @@
             System.out.println( "Using default delay value of " + delay );
         }
 
-    
         // -------------------------------------------------------------------
         // figure out the timeOffline value
         // -------------------------------------------------------------------
@@ -304,12 +307,11 @@
                 System.err.println( "timeOffline value of '" + val + "' is not a number" );
                 System.exit( 1 );
             }
-            
+
             if ( timeOffline > TIME_OFFLINE_MAX )
             {
-                System.err.println( "timeOffline value of '" + val 
-                    + "' is larger than max timeOffline (minutes) allowed: " 
-                    + TIME_OFFLINE_MAX );
+                System.err.println( "timeOffline value of '" + val
+                    + "' is larger than max timeOffline (minutes) allowed: " + TIME_OFFLINE_MAX );
                 System.exit( 1 );
             }
             else if ( timeOffline < 0 )
@@ -317,7 +319,7 @@
                 System.err.println( "timeOffline value of '" + val + "' is less than zero and makes no sense" );
                 System.exit( 1 );
             }
-            
+
             if ( isDebugEnabled() )
             {
                 System.out.println( "timeOffline seconds overriden by -t option: " + timeOffline );
@@ -336,7 +338,7 @@
         Option op = new Option( "h", "host", true, "server host: defaults to localhost" );
         op.setRequired( false );
         opts.addOption( op );
-        op = new Option(  "p", "port", true, "server port: defaults to 10389 or server.xml specified port" );
+        op = new Option( "p", "port", true, "server port: defaults to 10389 or server.xml specified port" );
         op.setRequired( false );
         opts.addOption( op );
         op = new Option( "e", "delay", true, "delay (seconds) before shutdown: defaults to 0" );
@@ -345,8 +347,7 @@
         op = new Option( "w", "password", true, "the apacheds administrator's password: defaults to secret" );
         op.setRequired( false );
         opts.addOption( op );
-        op = new Option( "t", "time-offline", true, 
-            "server offline time (minutes): defaults to 0 (indefinate)" );
+        op = new Option( "t", "time-offline", true, "server offline time (minutes): defaults to 0 (indefinate)" );
         op.setRequired( false );
         opts.addOption( op );
         op = new Option( "i", "install-path", true, "path to apacheds installation directory" );

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java (original)
+++ directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java Sun Feb 19 19:57:02 2006
@@ -40,24 +40,26 @@
     private String version;
     private InstallationLayout layout;
     private ServerStartupConfiguration configuration;
-    
 
-    protected ToolCommand( String name )
+
+    protected ToolCommand(String name)
     {
         this.name = name;
     }
-    
-    
+
+
     public abstract void execute( CommandLine cmd ) throws Exception;
+
+
     public abstract Options getOptions();
 
-    
+
     public String getName()
     {
         return this.name;
     }
-    
-    
+
+
     public void setLayout( File installationDirectory )
     {
         this.layout = new InstallationLayout( installationDirectory );

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-tools/src/main/manifest/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-tools/src/main/manifest/MANIFEST.MF?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-tools/src/main/manifest/MANIFEST.MF (original)
+++ directory/trunks/apacheds/server-tools/src/main/manifest/MANIFEST.MF Sun Feb 19 19:57:02 2006
@@ -1,6 +1,6 @@
 Manifest-Version: 1.0
 Main-Class: org.apache.directory.server.tools.ApachedsTools
-Class-Path: logger.jar daemon.jar bootstrapper.jar ../lib/antlr-2.7.2.jar ../lib/commons-collections-3.1.jar ../lib/commons-lang-2.0.jar ../lib/commons-logging-1.0.4.jar ../lib/shared-asn1-0.9.4.jar ../lib/jdbm-1.0.jar ../lib/lcrypto-jdk14-131.jar ../lib/mina-core-0.9.1.jar ../lib/mina-filter-codec-asn1-0.9.1.jar ../lib/mina-filter-ssl-0.9.1.jar ../lib/apacheds-kerberos-shared-0.7-SNAPSHOT.jar ../lib/apacheds-protocol-changepw-0.7-SNAPSHOT.jar ../lib/apacheds-protocol-shared-0.7.1-SNAPSHOT.jar ../lib/apacheds-protocol-kerberos-0.7-SNAPSHOT.jar ../lib/apacheds-protocol-ldap-1.0-RC1-SNAPSHOT.jar ../lib/apacheds-protocol-ntp-0.5-SNAPSHOT.jar ../lib/shared-ldap-0.9.4.jar ../lib/apacheds-core-1.0-RC1-SNAPSHOT.jar ../lib/apacheds-core-shared-1.0-RC1-SNAPSHOT.jar ../lib/apacheds-server-jndi-1.0-RC1-SNAPSHOT.jar ../lib/apacheds-server-main-1.0-RC1-SNAPSHOT.jar ../lib/oro-2.0.8.jar ../lib/spring-beans-1.2.1.jar ../lib/spring-context-1.2.1.jar ../lib/spring-core-1.2.1.jar ../lib/commo
 ns-cli-1.0.jar
+Class-Path: logger.jar daemon.jar bootstrapper.jar ../lib/antlr-2.7.2.jar ../lib/commons-collections-3.1.jar ../lib/commons-lang-2.0.jar ../lib/commons-logging-1.0.4.jar ../lib/shared-asn1-0.9.5.jar ../lib/jdbm-1.0.jar ../lib/lcrypto-jdk14-131.jar ../lib/mina-core-0.9.1.jar ../lib/mina-filter-codec-asn1-0.9.1.jar ../lib/mina-filter-ssl-0.9.1.jar ../lib/apacheds-kerberos-shared-1.0-RC1.jar ../lib/apacheds-protocol-changepw-1.0-RC1.jar ../lib/apacheds-protocol-shared-1.0-RC1.jar ../lib/apacheds-protocol-kerberos-1.0-RC1.jar ../lib/apacheds-protocol-ldap-1.0-RC1.jar ../lib/apacheds-protocol-ntp-1.0-RC1.jar ../lib/shared-ldap-0.9.5.jar ../lib/apacheds-core-1.0-RC1.jar ../lib/apacheds-core-shared-1.0-RC1.jar ../lib/apacheds-server-jndi-1.0-RC1.jar ../lib/apacheds-server-main-1.0-RC1.jar ../lib/oro-2.0.8.jar ../lib/spring-beans-1.2.1.jar ../lib/spring-context-1.2.1.jar ../lib/spring-core-1.2.1.jar ../lib/commons-cli-1.0.jar
 Specification-Title: apacheds-tools
 Specification-Version: 1.0
 

Propchange: directory/trunks/apacheds/server-tools/src/main/resources/org/apache/directory/server/tools/product.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/trunks/apacheds/server-unit/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-unit/pom.xml?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/pom.xml (original)
+++ directory/trunks/apacheds/server-unit/pom.xml Sun Feb 19 19:57:02 2006
@@ -4,11 +4,14 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>build</artifactId>
-    <version>1.0-RC1-SNAPSHOT</version>
+    <version>1.0-RC1</version>
   </parent>
   <artifactId>apacheds-server-unit</artifactId>
   <name>ApacheDS Server Unit</name>
   <packaging>jar</packaging>  
+  <description>
+    Unit testing framework for ApacheDS Server JNDI Provider
+  </description>
   <dependencies>
     <dependency>
       <groupId>junit</groupId>

Modified: directory/trunks/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java Sun Feb 19 19:57:02 2006
@@ -63,6 +63,7 @@
 
     protected int port = -1;
 
+
     /**
      * Get's the initial context factory for the provider's ou=system context
      * root.
@@ -152,7 +153,13 @@
         env.putAll( new ShutdownConfiguration().toJndiEnvironment() );
         env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
         env.put( Context.SECURITY_CREDENTIALS, "secret" );
-        try { new InitialContext( env ); } catch( Exception e ) {}
+        try
+        {
+            new InitialContext( env );
+        }
+        catch ( Exception e )
+        {
+        }
 
         sysRoot = null;
         doDelete( configuration.getWorkingDirectory() );

Propchange: directory/trunks/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddObjectClassesToEntryTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddObjectClassesToEntryTest.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddObjectClassesToEntryTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddObjectClassesToEntryTest.java Sun Feb 19 19:57:02 2006
@@ -1,168 +1,168 @@
-/*
- *   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
- *
- */
-package org.apache.directory.server;
-
-
-import javax.naming.directory.*;
-import javax.naming.NamingException;
-
-import org.apache.directory.server.unit.AbstractServerTest;
-
-import java.util.Hashtable;
-
-
-/**
- * Test case to verify DIREVE-216.  Starts up the server binds via SUN JNDI provider
- * to perform add modify operations on entries.
- * 
- * @author szoerner
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public class AddObjectClassesToEntryTest extends AbstractServerTest
-{
-    private static final String RDN = "cn=The Person";
-
-    private DirContext ctx = null;
-
-
-    /**
-     * Create an entry for a person.
-     */
-    public void setUp() throws Exception
-    {
-        super.setUp();
-
-        Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system" );
-        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 );
-
-        // Create a person
-        Attributes attributes = new BasicAttributes( true );
-        Attribute attribute = new BasicAttribute( "objectClass" );
-        attribute.add( "top" );
-        attribute.add( "person" );
-        attributes.put( attribute );
-        attributes.put( "cn", "The Person" );
-        attributes.put( "sn", "Person" );
-        attributes.put( "description", "this is a person" );
-        DirContext person = ctx.createSubcontext( RDN, attributes );
-
-        assertNotNull( person );
-    }
-
-
-    /**
-     * Remove the person.
-     */
-    public void tearDown() throws Exception
-    {
-        ctx.unbind(RDN);
-        ctx.close();
-        ctx = null;
-        super.tearDown();
-    }
-
-
-    /**
-     * Just a little test to check wether the person is created correctly after
-     * setup.
-     * 
-     * @throws NamingException
-     */
-    public void testSetUpTearDown() throws NamingException
-    {
-        DirContext person = (DirContext) ctx.lookup(RDN);
-        assertNotNull(person);
-
-        // Check object classes
-
-        Attributes attributes = person.getAttributes("");
-        Attribute ocls = attributes.get("objectClass");
-
-        String[] expectedOcls = { "top", "person" };
-        for ( int i = 0; i < expectedOcls.length; i++ )
-        {
-            String name = expectedOcls[i];
-            assertTrue( "object class " + name + " is NOT present when it should be!",
-                    ocls.contains( name ) );
-        }
-    }
-
-
-    /**
-     * This is the original defect as in JIRA DIREVE-216.
-     * 
-     * @throws NamingException
-     */
-    public void testAddObjectClasses() throws NamingException
-    {
-
-        // modify object classes, add two more
-        Attributes attributes = new BasicAttributes( true );
-        Attribute ocls = new BasicAttribute("objectClass");
-        ocls.add("organizationalPerson");
-        ocls.add("inetOrgPerson");
-        attributes.put(ocls);
-
-        DirContext person = (DirContext) ctx.lookup(RDN);
-        person.modifyAttributes("", DirContext.ADD_ATTRIBUTE, attributes);
-
-        // Read again from directory
-        person = (DirContext) ctx.lookup(RDN);
-        attributes = person.getAttributes("");
-        Attribute newOcls = attributes.get("objectClass");
-
-        String[] expectedOcls = { "top", "person", "organizationalPerson",
-                "inetOrgPerson" };
-        for (int i = 0; i < expectedOcls.length; i++) {
-            String name = expectedOcls[i];
-            assertTrue("object class " + name + " is present", newOcls
-                    .contains(name));
-        }
-    }
-
-
-    /**
-     * This changes a single attribute value. Just as a reference.
-     * 
-     * @throws NamingException
-     */
-    public void testModifyDescription() throws NamingException
-    {
-        String newDescription = "More info on the user ...";
-
-        // modify object classes, add two more
-        Attributes attributes = new BasicAttributes( true );
-        Attribute desc = new BasicAttribute("description", newDescription);
-        attributes.put(desc);
-
-        DirContext person = (DirContext) ctx.lookup(RDN);
-        person.modifyAttributes("", DirContext.REPLACE_ATTRIBUTE, attributes);
-
-        // Read again from directory
-        person = (DirContext) ctx.lookup(RDN);
-        attributes = person.getAttributes("");
-        Attribute newDesc = attributes.get("description");
-
-        assertTrue("new Description", newDesc.contains(newDescription));
-    }
-}
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.directory.server;
+
+
+import javax.naming.directory.*;
+import javax.naming.NamingException;
+
+import org.apache.directory.server.unit.AbstractServerTest;
+
+import java.util.Hashtable;
+
+
+/**
+ * Test case to verify DIREVE-216.  Starts up the server binds via SUN JNDI provider
+ * to perform add modify operations on entries.
+ * 
+ * @author szoerner
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class AddObjectClassesToEntryTest extends AbstractServerTest
+{
+    private static final String RDN = "cn=The Person";
+
+    private DirContext ctx = null;
+
+
+    /**
+     * Create an entry for a person.
+     */
+    public void setUp() throws Exception
+    {
+        super.setUp();
+
+        Hashtable env = new Hashtable();
+        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system" );
+        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 );
+
+        // Create a person
+        Attributes attributes = new BasicAttributes( true );
+        Attribute attribute = new BasicAttribute( "objectClass" );
+        attribute.add( "top" );
+        attribute.add( "person" );
+        attributes.put( attribute );
+        attributes.put( "cn", "The Person" );
+        attributes.put( "sn", "Person" );
+        attributes.put( "description", "this is a person" );
+        DirContext person = ctx.createSubcontext( RDN, attributes );
+
+        assertNotNull( person );
+    }
+
+
+    /**
+     * Remove the person.
+     */
+    public void tearDown() throws Exception
+    {
+        ctx.unbind( RDN );
+        ctx.close();
+        ctx = null;
+        super.tearDown();
+    }
+
+
+    /**
+     * Just a little test to check wether the person is created correctly after
+     * setup.
+     * 
+     * @throws NamingException
+     */
+    public void testSetUpTearDown() throws NamingException
+    {
+        DirContext person = ( DirContext ) ctx.lookup( RDN );
+        assertNotNull( person );
+
+        // Check object classes
+
+        Attributes attributes = person.getAttributes( "" );
+        Attribute ocls = attributes.get( "objectClass" );
+
+        String[] expectedOcls =
+            { "top", "person" };
+        for ( int i = 0; i < expectedOcls.length; i++ )
+        {
+            String name = expectedOcls[i];
+            assertTrue( "object class " + name + " is NOT present when it should be!", ocls.contains( name ) );
+        }
+    }
+
+
+    /**
+     * This is the original defect as in JIRA DIREVE-216.
+     * 
+     * @throws NamingException
+     */
+    public void testAddObjectClasses() throws NamingException
+    {
+
+        // modify object classes, add two more
+        Attributes attributes = new BasicAttributes( true );
+        Attribute ocls = new BasicAttribute( "objectClass" );
+        ocls.add( "organizationalPerson" );
+        ocls.add( "inetOrgPerson" );
+        attributes.put( ocls );
+
+        DirContext person = ( DirContext ) ctx.lookup( RDN );
+        person.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, attributes );
+
+        // Read again from directory
+        person = ( DirContext ) ctx.lookup( RDN );
+        attributes = person.getAttributes( "" );
+        Attribute newOcls = attributes.get( "objectClass" );
+
+        String[] expectedOcls =
+            { "top", "person", "organizationalPerson", "inetOrgPerson" };
+        for ( int i = 0; i < expectedOcls.length; i++ )
+        {
+            String name = expectedOcls[i];
+            assertTrue( "object class " + name + " is present", newOcls.contains( name ) );
+        }
+    }
+
+
+    /**
+     * This changes a single attribute value. Just as a reference.
+     * 
+     * @throws NamingException
+     */
+    public void testModifyDescription() throws NamingException
+    {
+        String newDescription = "More info on the user ...";
+
+        // modify object classes, add two more
+        Attributes attributes = new BasicAttributes( true );
+        Attribute desc = new BasicAttribute( "description", newDescription );
+        attributes.put( desc );
+
+        DirContext person = ( DirContext ) ctx.lookup( RDN );
+        person.modifyAttributes( "", DirContext.REPLACE_ATTRIBUTE, attributes );
+
+        // Read again from directory
+        person = ( DirContext ) ctx.lookup( RDN );
+        attributes = person.getAttributes( "" );
+        Attribute newDesc = attributes.get( "description" );
+
+        assertTrue( "new Description", newDesc.contains( newDescription ) );
+    }
+}

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddObjectClassesToEntryTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/AddObjectClassesToEntryTest.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BadDnTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BadDnTest.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BadDnTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BadDnTest.java Sun Feb 19 19:57:02 2006
@@ -72,17 +72,16 @@
      * Test with bindDn that is under a naming context but points to non-existant user.
      * @todo make this pass: see http://issues.apache.org/jira/browse/DIREVE-339
      */
-//    public void testBadBindDnMalformed() throws Exception
-//    {
-//        try
-//        {
-//            bind( "system", "blah" );
-//            fail( "should never get here due to a " );
-//        }
-//        catch ( InvalidNameException e ){}
-//    }
+    //    public void testBadBindDnMalformed() throws Exception
+    //    {
+    //        try
+    //        {
+    //            bind( "system", "blah" );
+    //            fail( "should never get here due to a " );
+    //        }
+    //        catch ( InvalidNameException e ){}
+    //    }
 
-    
     /**
      * Test with bindDn that is under a naming context but points to non-existant user.
      */

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BadDnTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/BadDnTest.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ChangeListener.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ChangeListener.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ChangeListener.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ChangeListener.java Sun Feb 19 19:57:02 2006
@@ -55,15 +55,16 @@
         control.setReturnECs( true );
         control.setCritical( true );
         control.setChangeTypes( PersistentSearchControl.ALL_CHANGES );
-        Control[] ctxCtls = new Control[] { control };
-        
+        Control[] ctxCtls = new Control[]
+            { control };
+
         try
         {
             Control[] respCtls;
             ctx.setRequestControls( ctxCtls );
             EntryChangeControl ecCtl = null;
             NamingEnumeration list = ctx.search( "", "objectClass=*", null );
-            while( list.hasMore() )
+            while ( list.hasMore() )
             {
                 SearchResult result = ( SearchResult ) list.next();
                 if ( result instanceof HasControls )
@@ -71,9 +72,9 @@
                     respCtls = ( ( HasControls ) result ).getControls();
                     if ( respCtls != null )
                     {
-                        for ( int ii = 0; ii < respCtls.length; ii ++ )
+                        for ( int ii = 0; ii < respCtls.length; ii++ )
                         {
-                            if ( respCtls[ii].getID().equals( 
+                            if ( respCtls[ii].getID().equals(
                                 org.apache.directory.shared.ldap.message.EntryChangeControl.CONTROL_OID ) )
                             {
                                 EntryChangeControlDecoder decoder = new EntryChangeControlDecoder();
@@ -82,7 +83,7 @@
                         }
                     }
                 }
-                
+
                 StringBuffer buf = new StringBuffer();
                 buf.append( "DN: " ).append( result.getName() ).append( "\n" );
                 if ( ecCtl != null )
@@ -93,38 +94,45 @@
                     buf.append( "        previousDN   : " ).append( ecCtl.getPreviousDn() ).append( "\n" );
                     buf.append( "        changeNumber : " ).append( ecCtl.getChangeNumber() ).append( "\n" );
                 }
-                
+
                 System.out.println( buf.toString() );
-                
+
                 if ( ecCtl != null )
                 {
                     System.out.println( "==============================================" );
                 }
             }
         }
-        catch( Exception e ) 
+        catch ( Exception e )
         {
             e.printStackTrace();
         }
     }
-    
-    
+
     static class ShutdownHook implements Runnable
     {
         final Context ctx;
-        
-        ShutdownHook( Context ctx )
+
+
+        ShutdownHook(Context ctx)
         {
             this.ctx = ctx;
         }
-        
+
+
         public void run()
         {
             if ( ctx != null )
             {
-                try { ctx.close(); } catch( Exception e ){ e.printStackTrace(); };
+                try
+                {
+                    ctx.close();
+                }
+                catch ( Exception e )
+                {
+                    e.printStackTrace();
+                };
             }
         }
     }
 }
-

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ChangeListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/ChangeListener.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java (original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java Sun Feb 19 19:57:02 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.directory.server;
 
+
 import java.util.Hashtable;
 
 import javax.naming.NamingEnumeration;
@@ -30,6 +31,7 @@
 
 import org.apache.directory.server.unit.AbstractServerTest;
 
+
 /**
  * Tests with compare operations on attributes which use different matching
  * rules. Created to demonstrate JIRA DIREVE-243 ("Compare operation does not
@@ -51,32 +53,35 @@
     public static final String GROUP_CN = "Artists";
     public static final String GROUP_RDN = "cn=" + GROUP_CN;
 
-    protected Attributes getPersonAttributes(String sn, String cn)
+
+    protected Attributes getPersonAttributes( String sn, String cn )
     {
         Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute("objectClass");
-        attribute.add("top");
-        attribute.add("person");
-        attributes.put(attribute);
-        attributes.put("cn", cn);
-        attributes.put("sn", sn);
+        Attribute attribute = new BasicAttribute( "objectClass" );
+        attribute.add( "top" );
+        attribute.add( "person" );
+        attributes.put( attribute );
+        attributes.put( "cn", cn );
+        attributes.put( "sn", sn );
 
         return attributes;
     }
 
-    protected Attributes getGroupOfNamesAttributes(String cn, String member)
+
+    protected Attributes getGroupOfNamesAttributes( String cn, String member )
     {
         Attributes attributes = new BasicAttributes();
-        Attribute attribute = new BasicAttribute("objectClass");
-        attribute.add("top");
-        attribute.add("groupOfNames");
-        attributes.put(attribute);
-        attributes.put("cn", cn);
-        attributes.put("member", member);
+        Attribute attribute = new BasicAttribute( "objectClass" );
+        attribute.add( "top" );
+        attribute.add( "groupOfNames" );
+        attributes.put( attribute );
+        attributes.put( "cn", cn );
+        attributes.put( "member", member );
 
         return attributes;
     }
 
+
     /**
      * Create context, a person entry and a group.
      */
@@ -85,40 +90,42 @@
         super.setUp();
 
         Hashtable env = new Hashtable();
-        env.put("java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory");
-        env.put("java.naming.provider.url", "ldap://localhost:" + port + "/ou=system");
-        env.put("java.naming.security.principal", "uid=admin,ou=system");
-        env.put("java.naming.security.credentials", "secret");
-        env.put("java.naming.security.authentication", "simple");
+        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system" );
+        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 InitialLdapContext(env, null);
-        assertNotNull(ctx);
+        ctx = new InitialLdapContext( env, null );
+        assertNotNull( ctx );
 
         // Create a person
-        Attributes attributes = this.getPersonAttributes(PERSON_SN, PERSON_CN);
-        attributes.put("telephoneNumber", PERSON_TELEPHONE);
-        attributes.put("userPassword", PERSON_PWD);
-        ctx.createSubcontext(PERSON_RDN, attributes);
+        Attributes attributes = this.getPersonAttributes( PERSON_SN, PERSON_CN );
+        attributes.put( "telephoneNumber", PERSON_TELEPHONE );
+        attributes.put( "userPassword", PERSON_PWD );
+        ctx.createSubcontext( PERSON_RDN, attributes );
 
         // Create a group
-        DirContext member = (DirContext) ctx.lookup(PERSON_RDN);
-        attributes = this.getGroupOfNamesAttributes(GROUP_CN, member.getNameInNamespace());
-        ctx.createSubcontext(GROUP_RDN, attributes);
+        DirContext member = ( DirContext ) ctx.lookup( PERSON_RDN );
+        attributes = this.getGroupOfNamesAttributes( GROUP_CN, member.getNameInNamespace() );
+        ctx.createSubcontext( GROUP_RDN, attributes );
     }
 
+
     /**
      * Remove entries and close context.
      */
     public void tearDown() throws Exception
     {
-        ctx.unbind(PERSON_RDN);
-        ctx.unbind(GROUP_RDN);
+        ctx.unbind( PERSON_RDN );
+        ctx.unbind( GROUP_RDN );
 
         ctx.close();
 
         super.tearDown();
     }
 
+
     /**
      * Compare with caseIgnoreMatch matching rule.
      * 
@@ -128,24 +135,30 @@
     {
         // Setting up search controls for compare op
         SearchControls ctls = new SearchControls();
-        ctls.setReturningAttributes(new String[] {}); // no attributes
-        ctls.setSearchScope(SearchControls.OBJECT_SCOPE);
-
-        String[] values = { PERSON_SN, PERSON_SN.toUpperCase(), PERSON_SN.toLowerCase(), PERSON_SN + "X" };
-        boolean[] expected = { true, true, true, false };
+        ctls.setReturningAttributes( new String[]
+            {} ); // no attributes
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+
+        String[] values =
+            { PERSON_SN, PERSON_SN.toUpperCase(), PERSON_SN.toLowerCase(), PERSON_SN + "X" };
+        boolean[] expected =
+            { true, true, true, false };
 
-        for (int i = 0; i < values.length; i++) {
+        for ( int i = 0; i < values.length; i++ )
+        {
             String value = values[i];
 
-            NamingEnumeration enumeration = ctx.search(PERSON_RDN, "sn={0}", new String[] { value }, ctls);
+            NamingEnumeration enumeration = ctx.search( PERSON_RDN, "sn={0}", new String[]
+                { value }, ctls );
             boolean result = enumeration.hasMore();
 
-            assertEquals("compare sn value '" + PERSON_SN + "' with '" + value + "'", expected[i], result);
+            assertEquals( "compare sn value '" + PERSON_SN + "' with '" + value + "'", expected[i], result );
 
             enumeration.close();
         }
     }
 
+
     //
 
     /**
@@ -154,31 +167,29 @@
      * @throws NamingException
      */
 
-// Comment this out until we have the telephone number match working.
-
-//    public void testTelephoneNumberMatch() throws NamingException
-//    {
-//        // Setting up search controls for compare op
-//        SearchControls ctls = new SearchControls();
-//        ctls.setReturningAttributes(new String[] {}); // no attributes
-//        ctls.setSearchScope(SearchControls.OBJECT_SCOPE);
-//
-//        String[] values = { "", "1234567890abc", "   1234567890 A B C", "123 456 7890 abc", "123-456-7890 abC",
-//                "123456-7890 A bc" };
-//        boolean[] expected = { false, true, true, true, true, true };
-//
-//        for (int i = 0; i < values.length; i++) {
-//            String value = values[i];
-//
-//            NamingEnumeration enumeration = ctx.search(PERSON_RDN, "telephoneNumber={0}", new String[] { value }, ctls);
-//            boolean result = enumeration.hasMore();
-//
-//            assertEquals("compare '" + PERSON_TELEPHONE + "' with '" + value + "'", expected[i], result);
-//
-//            enumeration.close();
-//        }
-//    }
-
+    // Comment this out until we have the telephone number match working.
+    //    public void testTelephoneNumberMatch() throws NamingException
+    //    {
+    //        // Setting up search controls for compare op
+    //        SearchControls ctls = new SearchControls();
+    //        ctls.setReturningAttributes(new String[] {}); // no attributes
+    //        ctls.setSearchScope(SearchControls.OBJECT_SCOPE);
+    //
+    //        String[] values = { "", "1234567890abc", "   1234567890 A B C", "123 456 7890 abc", "123-456-7890 abC",
+    //                "123456-7890 A bc" };
+    //        boolean[] expected = { false, true, true, true, true, true };
+    //
+    //        for (int i = 0; i < values.length; i++) {
+    //            String value = values[i];
+    //
+    //            NamingEnumeration enumeration = ctx.search(PERSON_RDN, "telephoneNumber={0}", new String[] { value }, ctls);
+    //            boolean result = enumeration.hasMore();
+    //
+    //            assertEquals("compare '" + PERSON_TELEPHONE + "' with '" + value + "'", expected[i], result);
+    //
+    //            enumeration.close();
+    //        }
+    //    }
     /**
      * Compare with octetStringMatch matching rule.
      * 
@@ -188,24 +199,30 @@
     {
         // Setting up search controls for compare op
         SearchControls ctls = new SearchControls();
-        ctls.setReturningAttributes(new String[] {}); // no attributes
-        ctls.setSearchScope(SearchControls.OBJECT_SCOPE);
-
-        String[] values = { "", PERSON_PWD, PERSON_PWD.toUpperCase(), PERSON_PWD.toLowerCase(), PERSON_PWD + "X" };
-        boolean[] expected = { false, true, false, false, false };
+        ctls.setReturningAttributes( new String[]
+            {} ); // no attributes
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+
+        String[] values =
+            { "", PERSON_PWD, PERSON_PWD.toUpperCase(), PERSON_PWD.toLowerCase(), PERSON_PWD + "X" };
+        boolean[] expected =
+            { false, true, false, false, false };
 
-        for (int i = 0; i < values.length; i++) {
+        for ( int i = 0; i < values.length; i++ )
+        {
             String value = values[i];
 
-            NamingEnumeration enumeration = ctx.search(PERSON_RDN, "userPassword={0}", new String[] { value }, ctls);
+            NamingEnumeration enumeration = ctx.search( PERSON_RDN, "userPassword={0}", new String[]
+                { value }, ctls );
             boolean result = enumeration.hasMore();
 
-            assertEquals("compare '" + PERSON_PWD + "' with '" + value + "'", expected[i], result);
+            assertEquals( "compare '" + PERSON_PWD + "' with '" + value + "'", expected[i], result );
 
             enumeration.close();
         }
     }
 
+
     /**
      * Compare with distinguishedNameMatch matching rule.
      * 
@@ -214,25 +231,29 @@
     public void testDistinguishedNameMatch() throws NamingException
     {
         // determine member DN of person
-        DirContext member = (DirContext) ctx.lookup(PERSON_RDN);
+        DirContext member = ( DirContext ) ctx.lookup( PERSON_RDN );
         String memberDN = member.getNameInNamespace();
 
         // Setting up search controls for compare op
         SearchControls ctls = new SearchControls();
-        ctls.setReturningAttributes(new String[] {}); // no attributes
-        ctls.setSearchScope(SearchControls.OBJECT_SCOPE);
-
-        String[] values = { "", memberDN, "cn=nobody", memberDN.toLowerCase(),
-                PERSON_RDN + " , " + ctx.getNameInNamespace() };
-        boolean[] expected = { false, true, false, true, true };
+        ctls.setReturningAttributes( new String[]
+            {} ); // no attributes
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+
+        String[] values =
+            { "", memberDN, "cn=nobody", memberDN.toLowerCase(), PERSON_RDN + " , " + ctx.getNameInNamespace() };
+        boolean[] expected =
+            { false, true, false, true, true };
 
-        for (int i = 0; i < values.length; i++) {
+        for ( int i = 0; i < values.length; i++ )
+        {
             String value = values[i];
 
-            NamingEnumeration enumeration = ctx.search(GROUP_RDN, "member={0}", new Object[] { value }, ctls);
+            NamingEnumeration enumeration = ctx.search( GROUP_RDN, "member={0}", new Object[]
+                { value }, ctls );
             boolean result = enumeration.hasMore();
 
-            assertEquals("compare '" + memberDN + "' with '" + value + "'", expected[i], result);
+            assertEquals( "compare '" + memberDN + "' with '" + value + "'", expected[i], result );
 
             enumeration.close();
         }

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id



Mime
View raw message