directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r896037 - /directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java
Date Tue, 05 Jan 2010 13:43:15 GMT
Author: kayyagari
Date: Tue Jan  5 13:43:14 2010
New Revision: 896037

URL: http://svn.apache.org/viewvc?rev=896037&view=rev
Log:
o fixed the failing tests
o removed useless factory code

Modified:
    directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java

Modified: directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java?rev=896037&r1=896036&r2=896037&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java
(original)
+++ directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java
Tue Jan  5 13:43:14 2010
@@ -26,11 +26,6 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
@@ -43,30 +38,10 @@
 
 import org.apache.directory.server.annotations.CreateLdapServer;
 import org.apache.directory.server.annotations.CreateTransport;
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.annotations.ApplyLdifs;
-import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
-import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
-import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.server.integ.LdapServerFactory;
-import org.apache.directory.server.ldap.LdapServer;
-import org.apache.directory.server.ldap.handlers.bind.MechanismHandler;
-import org.apache.directory.server.ldap.handlers.bind.SimpleMechanismHandler;
-import org.apache.directory.server.ldap.handlers.bind.cramMD5.CramMd5MechanismHandler;
-import org.apache.directory.server.ldap.handlers.bind.digestMD5.DigestMd5MechanismHandler;
-import org.apache.directory.server.ldap.handlers.bind.gssapi.GssapiMechanismHandler;
-import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
-import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
-import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
-import org.apache.directory.server.protocol.shared.transport.TcpTransport;
-import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.mina.util.AvailablePortFinder;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -78,7 +53,7 @@
  * no values (deletion) causes an error").
  */
 @RunWith ( FrameworkRunner.class ) 
-//@CreateDS( name="ModifyReplaceIT-class" )
+@CreateDS( enableChangeLog=false, name="ModifyReplaceIT-class" )
 @CreateLdapServer ( 
     transports = 
     {
@@ -108,65 +83,6 @@
     private static final String BASE = "ou=system";
 
     
-    public static class Factory implements LdapServerFactory
-    {
-        public LdapServer newInstance() throws Exception
-        {
-            DirectoryService service = new DefaultDirectoryService();
-            IntegrationUtils.doDelete( service.getWorkingDirectory() );
-            service.getChangeLog().setEnabled( true );
-            service.setShutdownHookEnabled( false );
-
-            JdbmPartition system = new JdbmPartition();
-            system.setId( "system" );
-
-            // @TODO need to make this configurable for the system partition
-            system.setCacheSize( 500 );
-
-            system.setSuffix( "ou=system" );
-
-            // Add indexed attributes for system partition
-            Set<Index<?,ServerEntry>> indexedAttrs = new HashSet<Index<?,ServerEntry>>();
-            indexedAttrs.add( new JdbmIndex<String,ServerEntry>( SchemaConstants.OBJECT_CLASS_AT
) );
-            indexedAttrs.add( new JdbmIndex<String,ServerEntry>( SchemaConstants.OU_AT
) );
-            system.setIndexedAttributes( indexedAttrs );
-            service.setSystemPartition( system );
-
-            // change the working directory to something that is unique
-            // on the system and somewhere either under target directory
-            // or somewhere in a temp area of the machine.
-
-            LdapServer ldapServer = new LdapServer();
-            ldapServer.setDirectoryService( service );
-            int port = AvailablePortFinder.getNextAvailable( 1024 );
-            ldapServer.setTransports( new TcpTransport( port ) );
-            ldapServer.addExtendedOperationHandler( new StartTlsHandler() );
-            ldapServer.addExtendedOperationHandler( new StoredProcedureExtendedOperationHandler()
);
-
-            // Setup SASL Mechanisms
-            
-            Map<String, MechanismHandler> mechanismHandlerMap = new HashMap<String,MechanismHandler>();
-            mechanismHandlerMap.put( SupportedSaslMechanisms.PLAIN, new SimpleMechanismHandler()
);
-
-            CramMd5MechanismHandler cramMd5MechanismHandler = new CramMd5MechanismHandler();
-            mechanismHandlerMap.put( SupportedSaslMechanisms.CRAM_MD5, cramMd5MechanismHandler
);
-
-            DigestMd5MechanismHandler digestMd5MechanismHandler = new DigestMd5MechanismHandler();
-            mechanismHandlerMap.put( SupportedSaslMechanisms.DIGEST_MD5, digestMd5MechanismHandler
);
-
-            GssapiMechanismHandler gssapiMechanismHandler = new GssapiMechanismHandler();
-            mechanismHandlerMap.put( SupportedSaslMechanisms.GSSAPI, gssapiMechanismHandler
);
-
-            NtlmMechanismHandler ntlmMechanismHandler = new NtlmMechanismHandler();
-            mechanismHandlerMap.put( SupportedSaslMechanisms.NTLM, ntlmMechanismHandler );
-            mechanismHandlerMap.put( SupportedSaslMechanisms.GSS_SPNEGO, ntlmMechanismHandler
);
-
-            ldapServer.setSaslMechanismHandlers( mechanismHandlerMap );
-
-            return ldapServer;
-        }
-    }
-    
     /**
      * Create a person entry and try to remove a not present attribute
      */
@@ -198,8 +114,6 @@
             Attribute desc = sr.getAttributes().get( "description" );
             assertNull( desc );
         }
-
-        sysRoot.destroySubcontext( rdn );
     }
     
     
@@ -236,8 +150,6 @@
             assertTrue( desc.contains( "added description") );
             assertEquals( 1, desc.size() );
         }
-
-        sysRoot.destroySubcontext( rdn );
     }
     
     
@@ -270,8 +182,6 @@
             assertNotNull( cn );
             assertTrue( cn.contains( "Kate Bush" ) );
         }
-
-        sysRoot.destroySubcontext( rdn );
     }
 
 
@@ -305,8 +215,6 @@
             assertNotNull( cn );
             assertTrue( cn.contains( "Kate Bush" ) );
         }
-
-        sysRoot.destroySubcontext( rdn );
     }
 
 



Mime
View raw message