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

svn commit: r584060 - in /directory/apacheds/branches/bigbang/protocol-ldap/src: main/java/org/apache/directory/server/ldap/LdapServer.java test/java/org/apache/directory/server/ldap/LdapServerTest.java

Author: djencks
Date: Thu Oct 11 23:12:07 2007
New Revision: 584060

URL: http://svn.apache.org/viewvc?rev=584060&view=rev
Log:
alex must have been tired

Modified:
    directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java

Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=584060&r1=584059&r2=584060&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java Thu Oct 11 23:12:07 2007
@@ -231,7 +231,6 @@
         else
         {
             chain = new DefaultIoFilterChainBuilder();
-            startLDAP0( getIpPort(), chain );
         }
 
         startLDAP0( getIpPort(), chain );

Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java?rev=584060&r1=584059&r2=584060&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java Thu Oct 11 23:12:07 2007
@@ -24,14 +24,13 @@
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.ldap.support.*;
+import org.apache.directory.server.protocol.shared.SocketAcceptor;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.*;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.SimpleByteBufferAllocator;
-import org.apache.mina.filter.executor.ExecutorFilter;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.util.AvailablePortFinder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,8 +52,8 @@
     private static final Logger LOG = LoggerFactory.getLogger( LdapServerTest.class.getName() );
     LdapServer ldapServer;
     DirectoryService directoryService;
-    ExecutorService ioExecutor;
-    ExecutorService logicExecutor;
+//    ExecutorService ioExecutor;
+//    ExecutorService logicExecutor;
     SocketAcceptor tcpAcceptor;
 
 
@@ -63,6 +62,14 @@
         directoryService = new DefaultDirectoryService();
         directoryService.startup();
 
+        ByteBuffer.setAllocator( new SimpleByteBufferAllocator() );
+        ByteBuffer.setUseDirectBuffers( false );
+        tcpAcceptor = new SocketAcceptor( null );
+
+        ldapServer = new LdapServer( tcpAcceptor );
+        ldapServer.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
+        ldapServer.setDirectoryService( directoryService );
+        System.err.println( "********** => " + ldapServer.getIpPort() );
         if ( getName().equals( "testAlternativeConfiguration" ) )
         {
             ldapServer.setAbandonHandler( new BogusAbandonHandler() );
@@ -76,17 +83,6 @@
             ldapServer.setUnbindHandler( new BogusUnbindHandler() );
         }
 
-        ByteBuffer.setAllocator( new SimpleByteBufferAllocator() );
-        ByteBuffer.setUseDirectBuffers( false );
-        ioExecutor = Executors.newCachedThreadPool();
-        logicExecutor = Executors.newFixedThreadPool( 8 );
-        tcpAcceptor = new SocketAcceptor( Runtime.getRuntime().availableProcessors(), ioExecutor );
-        tcpAcceptor.getFilterChain().addLast( "executor", new ExecutorFilter( logicExecutor ) );
-
-        ldapServer = new LdapServer( tcpAcceptor );
-        ldapServer.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
-        ldapServer.setDirectoryService( directoryService );
-        System.err.println( "********** => " + ldapServer.getIpPort() );
         ldapServer.start();
     }
 
@@ -94,7 +90,7 @@
     public void tearDown() throws Exception
     {
         ldapServer.stop();
-        logicExecutor.shutdown();
+/*
         for (;;) {
             try {
                 if ( logicExecutor.awaitTermination( Integer.MAX_VALUE, TimeUnit.SECONDS ) )
@@ -121,6 +117,7 @@
                 LOG.error( "Failed to terminate io executor", e );
             }
         }
+*/
         directoryService.shutdown();
     }
 
@@ -134,15 +131,6 @@
      */
     public void testDefaultOperation() throws LdapNamingException
     {
-        assertEquals( ldapServer.getAbandonHandler().getClass(), BogusAbandonHandler.class  );
-        assertEquals( ldapServer.getAddHandler().getClass(), BogusAddHandler.class  );
-        assertEquals( ldapServer.getBindHandler().getClass(), BogusBindHandler.class  );
-        assertEquals( ldapServer.getCompareHandler().getClass(), BogusCompareHandler.class  );
-        assertEquals( ldapServer.getDeleteHandler().getClass(), BogusDeleteHandler.class  );
-        assertEquals( ldapServer.getModifyDnHandler().getClass(), BogusModifyDnHandler.class  );
-        assertEquals( ldapServer.getModifyHandler().getClass(), BogusModifyHandler.class  );
-        assertEquals( ldapServer.getSearchHandler().getClass(), BogusSearchHandler.class  );
-        assertEquals( ldapServer.getUnbindHandler().getClass(), BogusUnbindHandler.class  );
         assertNotNull( ldapServer.getCodecFactory() );
         assertEquals( ldapServer.getName(), LdapServer.SERVICE_NAME );
     }
@@ -157,6 +145,15 @@
      */
     public void testAlternativeConfiguration() throws LdapNamingException
     {
+        assertEquals( ldapServer.getAbandonHandler().getClass(), BogusAbandonHandler.class  );
+        assertEquals( ldapServer.getAddHandler().getClass(), BogusAddHandler.class  );
+        assertEquals( ldapServer.getBindHandler().getClass(), BogusBindHandler.class  );
+        assertEquals( ldapServer.getCompareHandler().getClass(), BogusCompareHandler.class  );
+        assertEquals( ldapServer.getDeleteHandler().getClass(), BogusDeleteHandler.class  );
+        assertEquals( ldapServer.getModifyDnHandler().getClass(), BogusModifyDnHandler.class  );
+        assertEquals( ldapServer.getModifyHandler().getClass(), BogusModifyHandler.class  );
+        assertEquals( ldapServer.getSearchHandler().getClass(), BogusSearchHandler.class  );
+        assertEquals( ldapServer.getUnbindHandler().getClass(), BogusUnbindHandler.class  );
         assertNotNull( ldapServer.getCodecFactory() );
         assertEquals( ldapServer.getName(), LdapServer.SERVICE_NAME );
     }