You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2007/10/13 01:20:19 UTC

svn commit: r584317 - /directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java

Author: akarasulu
Date: Fri Oct 12 16:20:18 2007
New Revision: 584317

URL: http://svn.apache.org/viewvc?rev=584317&view=rev
Log:
fixing some issues with the abstract test which was resulting in NPE due to order of setUp commands

Modified:
    directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java

Modified: directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?rev=584317&r1=584316&r2=584317&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java Fri Oct 12 16:20:18 2007
@@ -109,11 +109,6 @@
             return EMPTY_LIST;
         }
         
-//        if ( ! apacheDS.isStarted() )
-//        {
-//            throw new ConfigurationException( "The server has not been started - cannot add entries." );
-//        }
-        
         LdifReader ldifReader = new LdifReader( in );
         List<Entry> entries = new ArrayList<Entry>();
         while ( ldifReader.hasNext() )
@@ -229,17 +224,16 @@
         start++;
         directoryService = new DefaultDirectoryService();
         directoryService.setShutdownHookEnabled( false );
+        socketAcceptor = new SocketAcceptor( null );
+        ldapServer = new LdapServer( socketAcceptor, directoryService );
+        ldapServer.setIpPort( port = AvailablePortFinder.getNextAvailable( 1024 ) );
+
         doDelete( directoryService.getWorkingDirectory() );
         configureDirectoryService();
         directoryService.startup();
-        port = AvailablePortFinder.getNextAvailable( 1024 );
 
-        socketAcceptor = new SocketAcceptor( null );
-        ldapServer = new LdapServer( socketAcceptor, directoryService );
-        ldapServer.setIpPort( port );
         configureLdapServer();
         ldapServer.start();
-
         setContexts( "uid=admin,ou=system", "secret" );
     }