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 04:23:01 UTC
svn commit: r584360 - in /directory:
apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/
apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/
installers/branches/bigbang/...
Author: akarasulu
Date: Fri Oct 12 19:22:58 2007
New Revision: 584360
URL: http://svn.apache.org/viewvc?rev=584360&view=rev
Log:
fixing some compilation errors and some problems with tests
Modified:
directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/SocketAcceptor.java
directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java
directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Modified: directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/SocketAcceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/SocketAcceptor.java?rev=584360&r1=584359&r2=584360&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/SocketAcceptor.java (original)
+++ directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/SocketAcceptor.java Fri Oct 12 19:22:58 2007
@@ -31,7 +31,7 @@
import org.apache.mina.filter.executor.ExecutorFilter;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
* @org.apache.xbean.XBean
*/
public class SocketAcceptor extends org.apache.mina.transport.socket.nio.SocketAcceptor
@@ -39,7 +39,7 @@
private static final int DEFAULT_THREADS = 10;
- public SocketAcceptor( Executor logicExecutor)
+ public SocketAcceptor( Executor logicExecutor )
{
super( Runtime.getRuntime().availableProcessors(), getIOExecutor());
if ( logicExecutor == null )
Modified: directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java?rev=584360&r1=584359&r2=584360&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java Fri Oct 12 19:22:58 2007
@@ -22,7 +22,6 @@
import junit.framework.AssertionFailedError;
import org.apache.commons.io.FileUtils;
-import org.apache.directory.server.configuration.ApacheDS;
import org.apache.directory.server.jndi.ServerContextFactory;
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.DefaultDirectoryService;
@@ -86,7 +85,9 @@
protected static final String USER = "uid=admin,ou=system";
protected static final String PASSWORD = "secret";
protected static final String BASE = "dc=example,dc=com";
- protected static ApacheDS apacheDS;
+
+ protected static DirectoryService directoryService;
+ protected static LdapServer ldapServer;
/**
@@ -204,15 +205,15 @@
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
- DirectoryService directoryService = new DefaultDirectoryService();
+ directoryService = new DefaultDirectoryService();
doDelete( directoryService.getWorkingDirectory() );
+ directoryService.setShutdownHookEnabled( false );
+ directoryService.startup();
port = AvailablePortFinder.getNextAvailable( 1024 );
SocketAcceptor socketAcceptor = new SocketAcceptor( null );
- LdapServer ldapServer = new LdapServer( socketAcceptor, directoryService );
+ ldapServer = new LdapServer( socketAcceptor, directoryService );
ldapServer.setIpPort( port );
- directoryService.setShutdownHookEnabled( false );
- apacheDS = new ApacheDS( directoryService, ldapServer, null );
- apacheDS.startup();
+ ldapServer.start();
Hashtable<String, Object> env = new Hashtable<String, Object>();
env.put( DirectoryService.JNDI_KEY, directoryService );
@@ -226,6 +227,30 @@
/**
+ * Sets the system context root to null.
+ *
+ * @see junit.framework.TestCase#tearDown()
+ * @throws Exception if there are problems shutting down the server
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception
+ {
+ try
+ {
+ ldapServer.stop();
+ directoryService.shutdown();
+ }
+ catch ( Exception e )
+ {
+ LOG.error( "Encountered exception while trying to shutdown.", e );
+ }
+
+ root = null;
+ doDelete( directoryService.getWorkingDirectory() );
+ }
+
+
+ /**
* Deletes the Eve working directory.
* @param wkdir the working directory to delete
* @throws IOException if the directory cannot be deleted
@@ -302,29 +327,6 @@
rootDSE = new InitialLdapContext( envTest, null );
assertNotNull( rootDSE );
- }
-
-
- /**
- * Sets the system context root to null.
- *
- * @see junit.framework.TestCase#tearDown()
- * @throws Exception if there are problems shutting down the server
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception
- {
- try
- {
- apacheDS.shutdown();
- }
- catch ( Exception e )
- {
- LOG.error( "Encountered exception while trying to shutdown.", e );
- }
-
- root = null;
- doDelete( apacheDS.getDirectoryService().getWorkingDirectory() );
}
Modified: directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=584360&r1=584359&r2=584360&view=diff
==============================================================================
--- directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java (original)
+++ directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java Fri Oct 12 19:22:58 2007
@@ -23,16 +23,16 @@
import org.apache.directory.daemon.DaemonApplication;
import org.apache.directory.daemon.InstallationLayout;
import org.apache.directory.server.configuration.ApacheDS;
-import org.apache.directory.server.jndi.ServerContextFactory;
+import org.apache.directory.server.core.DefaultDirectoryService;
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.protocol.shared.SocketAcceptor;
import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
-import javax.naming.Context;
-import javax.naming.directory.InitialDirContext;
import java.io.File;
-import java.util.Hashtable;
/**
@@ -63,7 +63,15 @@
else
{
LOG.info( "server: using default settings ..." );
- apacheDS = new ApacheDS();
+ DirectoryService directoryService = new DefaultDirectoryService();
+ directoryService.startup();
+ SocketAcceptor socketAcceptor = new SocketAcceptor( null );
+ LdapServer ldapServer = new LdapServer( socketAcceptor, directoryService );
+ ldapServer.start();
+ LdapServer ldapsServer = new LdapServer( socketAcceptor, directoryService );
+ ldapsServer.setEnableLdaps( true );
+ ldapsServer.start();
+ apacheDS = new ApacheDS( directoryService, ldapServer, ldapsServer );
}
if ( install != null )