directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r654176 - in /directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap: LdapServerTest.java SettingAlternativeHandlersTest.java
Date Wed, 07 May 2008 17:18:24 GMT
Author: akarasulu
Date: Wed May  7 10:18:22 2008
New Revision: 654176

URL: http://svn.apache.org/viewvc?rev=654176&view=rev
Log:
removing test that was starting server which does not need to be the case

Added:
    directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
      - copied, changed from r653971, directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java
Removed:
    directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java

Copied: directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
(from r653971, 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/SettingAlternativeHandlersTest.java?p2=directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java&p1=directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java&r1=653971&r2=654176&rev=654176&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/SettingAlternativeHandlersTest.java
Wed May  7 10:18:22 2008
@@ -21,7 +21,6 @@
 
 
 import junit.framework.TestCase;
-import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.ldap.handlers.AbandonHandler;
 import org.apache.directory.server.ldap.handlers.AddHandler;
@@ -32,7 +31,6 @@
 import org.apache.directory.server.ldap.handlers.ModifyHandler;
 import org.apache.directory.server.ldap.handlers.SearchHandler;
 import org.apache.directory.server.ldap.handlers.UnbindHandler;
-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.AbandonRequest;
@@ -44,39 +42,23 @@
 import org.apache.directory.shared.ldap.message.ModifyRequest;
 import org.apache.directory.shared.ldap.message.SearchRequest;
 import org.apache.directory.shared.ldap.message.UnbindRequest;
-import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.SimpleByteBufferAllocator;
-import org.apache.mina.util.AvailablePortFinder;
 
 
 /**
- * Tests the .
- * FIXME: This test case doesn't test enough now.
+ * This test is simply used to test that handlers can be set properly.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class LdapServerTest extends TestCase
+public class SettingAlternativeHandlersTest extends TestCase
 {
     LdapServer ldapServer;
-    DirectoryService directoryService;
-    SocketAcceptor tcpAcceptor;
 
 
     public void setUp() throws Exception
     {
-        directoryService = new DefaultDirectoryService();
-        directoryService.startup();
-
-        ByteBuffer.setAllocator( new SimpleByteBufferAllocator() );
-        ByteBuffer.setUseDirectBuffers( false );
-        tcpAcceptor = new SocketAcceptor( null );
-
         ldapServer = new LdapServer();
-        ldapServer.setSocketAcceptor( tcpAcceptor );
-        ldapServer.setDirectoryService( directoryService );
-        ldapServer.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
         
         if ( getName().equals( "testAlternativeConfiguration" ) )
         {
@@ -90,15 +72,6 @@
             ldapServer.setSearchHandler( new BogusSearchHandler() );
             ldapServer.setUnbindHandler( new BogusUnbindHandler() );
         }
-
-        ldapServer.start();
-    }
-
-
-    public void tearDown() throws Exception
-    {
-        ldapServer.stop();
-        directoryService.shutdown();
     }
 
 
@@ -111,7 +84,6 @@
      */
     public void testDefaultOperation() throws LdapNamingException
     {
-        assertNotNull( ldapServer.getCodecFactory() );
         assertEquals( ldapServer.getName(), LdapServer.SERVICE_NAME );
     }
 
@@ -134,10 +106,10 @@
         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 );
     }
 
+    
     public static class BogusAbandonHandler extends AbandonHandler
     {
         public void abandonMessageReceived( IoSession session, AbandonRequest request )
@@ -146,6 +118,7 @@
         }
     }
 
+    
     public static class BogusUnbindHandler extends UnbindHandler
     {
         public void unbindMessageReceived( IoSession session, UnbindRequest request )



Mime
View raw message