directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r896599 [26/30] - in /directory/apacheds/trunk: ./ avl-partition/ avl-partition/src/ avl-partition/src/main/ avl-partition/src/main/java/ avl-partition/src/main/java/org/ avl-partition/src/main/java/org/apache/ avl-partition/src/main/java/o...
Date Wed, 06 Jan 2010 18:27:19 GMT
Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java Wed Jan  6 18:26:43 2010
@@ -20,51 +20,36 @@
 package org.apache.directory.server.operations.search;
 
 
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.core.integ.annotations.Factory;
-import org.apache.directory.server.xdbm.Index;
-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.integ.SiRunner;
 import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
-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 java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.annotations.SaslMechanism;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 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.bind.plain.PlainMechanismHandler;
 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.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;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
 
 /**
  * A set of tests to make sure the negation operator is working 
@@ -73,144 +58,99 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.CLASS )
-@Factory ( IndexedNegationSearchIT.Factory.class )
+@RunWith ( FrameworkRunner.class ) 
 @ApplyLdifs( {
-    "dn: ou=test,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: organizationalUnit\n" +
-    "ou: test\n\n" +
-
-    "dn: uid=test1,ou=test,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: account\n" +
-    "uid: test1\n" +
-    "ou: test1\n\n" +
-
-    "dn: uid=test2,ou=test,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: account\n" +
-    "uid: test2\n" +
-    "ou: test2\n\n" +
-
-    "dn: uid=testNoOU,ou=test,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: account\n" +
-    "uid: testNoOU\n\n" +
-    
-    "dn: ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: organizationalUnit\n" +
-    "ou: actors\n\n" +
-
-    "dn: uid=jblack,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: jblack\n" +
-    "ou: comedy\n" +
-    "ou: adventure\n" +
-    "cn: Jack Black\n" +
-    "sn: Black\n\n" +
-
-    "dn: uid=bpitt,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: bpitt\n" +
-    "ou: drama\n" +
-    "ou: adventure\n" +
-    "cn: Brad Pitt\n" +
-    "sn: Pitt\n\n" +
-
-    "dn: uid=gcloony,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: gcloony\n" +
-    "ou: drama\n" +
-    "cn: Goerge Cloony\n" +
-    "sn: Cloony\n\n" +
-
-    "dn: uid=jnewbie,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: jnewbie\n" +
-    "cn: Joe Newbie\n" +
-    "sn: Newbie\n\n" 
+    "dn: ou=test,ou=system", 
+    "objectClass: top", 
+    "objectClass: organizationalUnit", 
+    "ou: test", 
+
+    "dn: uid=test1,ou=test,ou=system", 
+    "objectClass: top", 
+    "objectClass: account", 
+    "uid: test1", 
+    "ou: test1", 
+
+    "dn: uid=test2,ou=test,ou=system", 
+    "objectClass: top", 
+    "objectClass: account", 
+    "uid: test2", 
+    "ou: test2", 
+
+    "dn: uid=testNoOU,ou=test,ou=system", 
+    "objectClass: top", 
+    "objectClass: account", 
+    "uid: testNoOU", 
+    
+    "dn: ou=actors,ou=system", 
+    "objectClass: top", 
+    "objectClass: organizationalUnit", 
+    "ou: actors\n", 
+
+    "dn: uid=jblack,ou=actors,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "objectClass: organizationalPerson", 
+    "objectClass: uidObject", 
+    "uid: jblack", 
+    "ou: comedy", 
+    "ou: adventure", 
+    "cn: Jack Black", 
+    "sn: Black", 
+
+    "dn: uid=bpitt,ou=actors,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "objectClass: organizationalPerson", 
+    "objectClass: uidObject", 
+    "uid: bpitt", 
+    "ou: drama", 
+    "ou: adventure", 
+    "cn: Brad Pitt", 
+    "sn: Pitt", 
+
+    "dn: uid=gcloony,ou=actors,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "objectClass: organizationalPerson", 
+    "objectClass: uidObject", 
+    "uid: gcloony", 
+    "ou: drama", 
+    "cn: Goerge Cloony", 
+    "sn: Cloony", 
+
+    "dn: uid=jnewbie,ou=actors,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "objectClass: organizationalPerson", 
+    "objectClass: uidObject", 
+    "uid: jnewbie", 
+    "cn: Joe Newbie", 
+    "sn: Newbie" 
 
     }
 )
-public class IndexedNegationSearchIT 
-{
-    public static LdapServer ldapServer;
-
-    
-    public static class Factory implements LdapServerFactory
+@CreateLdapServer ( 
+    transports = 
     {
-        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;
-        }
-    }
-    
+        @CreateTransport( protocol = "LDAP" )
+    },
+    saslMechanisms = 
+    {
+        @SaslMechanism( name=SupportedSaslMechanisms.PLAIN, implClass=PlainMechanismHandler.class ),
+        @SaslMechanism( name=SupportedSaslMechanisms.CRAM_MD5, implClass=CramMd5MechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.DIGEST_MD5, implClass=DigestMd5MechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.GSSAPI, implClass=GssapiMechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.NTLM, implClass=NtlmMechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.GSS_SPNEGO, implClass=NtlmMechanismHandler.class)
+    },
+    extendedOpHandlers = 
+    {
+        StartTlsHandler.class,
+        StoredProcedureExtendedOperationHandler.class
+    })
+public class IndexedNegationSearchIT extends AbstractLdapTestUnit
+{
 
     /**
      * Tests to make sure a negated search for OU of "test1" returns

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java Wed Jan  6 18:26:43 2010
@@ -20,30 +20,27 @@
 package org.apache.directory.server.operations.search;
 
 
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 import java.util.HashSet;
 import java.util.Set;
 
 import javax.naming.NamingEnumeration;
+import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.core.integ.annotations.Factory;
-import org.apache.directory.server.integ.SiRunner;
-import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
-
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.naming.directory.DirContext;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
 
 /**
  * A set of tests to make sure the negation operator is working 
@@ -54,62 +51,63 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 519077 $
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.SUITE )
-@Factory ( IndexedNegationSearchIT.Factory.class )
+@RunWith ( FrameworkRunner.class ) 
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" )
+    })
 @ApplyLdifs( {
-    "dn: ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: organizationalUnit\n" +
-    "ou: actors\n\n" +
-
-    "dn: uid=jblack,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: jblack\n" +
-    "ou: comedy\n" +
-    "ou: adventure\n" +
-    "cn: Jack Black\n" +
-    "sn: Black\n\n" +
-
-    "dn: uid=bpitt,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: bpitt\n" +
-    "ou: drama\n" +
-    "ou: adventure\n" +
-    "cn: Brad Pitt\n" +
-    "sn: Pitt\n\n" +
-
-    "dn: uid=gcloony,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: gcloony\n" +
-    "ou: drama\n" +
-    "cn: Goerge Cloony\n" +
-    "sn: Cloony\n\n" +
-
-    "dn: uid=jnewbie,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: jnewbie\n" +
-    "cn: Joe Newbie\n" +
-    "sn: Newbie\n\n" 
+    "dn: ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: organizationalUnit",
+    "ou: actors",
+
+    "dn: uid=jblack,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: jblack",
+    "ou: comedy",
+    "ou: adventure",
+    "cn: Jack Black",
+    "sn: Black",
+
+    "dn: uid=bpitt,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: bpitt",
+    "ou: drama",
+    "ou: adventure",
+    "cn: Brad Pitt",
+    "sn: Pitt",
+
+    "dn: uid=gcloony,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: gcloony",
+    "ou: drama",
+    "cn: Goerge Cloony",
+    "sn: Cloony",
+
+    "dn: uid=jnewbie,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: jnewbie",
+    "cn: Joe Newbie",
+    "sn: Newbie" 
 
     }
 )
-public class NegationSearchIT 
+public class NegationSearchIT extends AbstractLdapTestUnit 
 {
-    public static LdapServer ldapServer;
-
     
     /**
      * Tests to make sure a negated search for actors without ou

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java Wed Jan  6 18:26:43 2010
@@ -20,6 +20,10 @@
 package org.apache.directory.server.operations.search;
 
  
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -33,11 +37,11 @@
 import javax.naming.ldap.LdapContext;
 import javax.naming.ldap.PagedResultsResponseControl;
 
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.integ.SiRunner;
-
-import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
-
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.shared.ldap.message.control.PagedSearchControl;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -45,9 +49,6 @@
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
 
 /**
  * Test the PagedSearchControl. The following tables covers all the
@@ -87,8 +88,8 @@
  * |test   | SL | RL | PL | Nb of responses     | nb | X |<br>
  * +-------+----+----+----+---------------------+----+---+<br>
  * |test18 | 0  | 0  | 3  | 4 ( 3 + 3 + 3 + 1 ) | 10 |   |<br>
- * |test19  | 0  | 0  | 5  | 2 ( 5 + 5 )         | 10 |   |<br>
- * |test20  | 3  | 0  | 5  | 1 ( 3 )             | 3  | Y |<br>
+ * |test19 | 0  | 0  | 5  | 2 ( 5 + 5 )         | 10 |   |<br>
+ * |test20 | 3  | 0  | 5  | 1 ( 3 )             | 3  | Y |<br>
  * |test21 | 0  | 3  | 5  | 1 ( 3 )             | 3  | Y |<br>
  * |test22 | 5  | 0  | 3  | 2 ( 3 + 2 )         | 5  | Y |<br>
  * |test23 | 0  | 9  | 5  | 2 ( 5 + 4 )         | 9  | Y |<br>
@@ -108,88 +109,90 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 545029 $
  */
-@RunWith ( SiRunner.class )
+@RunWith ( FrameworkRunner.class )
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" )
+    })
 @ApplyLdifs( {
     // Add 10 new entries
-    "dn: dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: domain\n" +
-    "dc: users\n" +
-    "\n" +
-    "dn: cn=user0,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user0\n" +
-    "sn: user 0\n" +
-    "\n" +
-    "dn: cn=user1,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user1\n" +
-    "sn: user 1\n" +
-    "\n" +
-    "dn: cn=user2,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user2\n" +
-    "sn: user 2\n" +
-    "\n" +
-    "dn: cn=user3,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user3\n" +
-    "sn: user 3\n" +
-    "\n" +
-    "dn: cn=user4,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user4\n" +
-    "sn: user 4\n" +
-    "\n" +
-    "dn: cn=user5,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user5\n" +
-    "sn: user 5\n" +
-    "\n" +
-    "dn: cn=user6,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user6\n" +
-    "sn: user 6\n" +
-    "\n" +
-    "dn: cn=user7,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user7\n" +
-    "sn: user 7\n" +
-    "\n" +
-    "dn: cn=user8,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user8\n" +
-    "sn: user 8\n" +
-    "\n" +
-    "dn: cn=user9,dc=users,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user9\n" +
-    "sn: user 9\n" +
-    "\n" +
+    "dn: dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: domain", 
+    "dc: users", 
+    //
+    "dn: cn=user0,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user0", 
+    "sn: user 0", 
+    //
+    "dn: cn=user1,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user1", 
+    "sn: user 1", 
+    //
+    "dn: cn=user2,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user2", 
+    "sn: user 2", 
+    //
+    "dn: cn=user3,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user3", 
+    "sn: user 3", 
+    //
+    "dn: cn=user4,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user4", 
+    "sn: user 4", 
+    //
+    "dn: cn=user5,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user5", 
+    "sn: user 5", 
+    //
+    "dn: cn=user6,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user6", 
+    "sn: user 6", 
+    //
+    "dn: cn=user7,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user7", 
+    "sn: user 7", 
+    //
+    "dn: cn=user8,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user8", 
+    "sn: user 8", 
+    // 
+    "dn: cn=user9,dc=users,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user9", 
+    "sn: user 9", 
+    "", 
     // Add another user for non admin tests
-    "dn: cn=user,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "cn: user\n" +
-    "userPassword: secret\n" +
-    "sn: user\n" +
-    "\n"
+    "dn: cn=user,ou=system", 
+    "objectClass: top", 
+    "objectClass: person", 
+    "cn: user", 
+    "userPassword: secret", 
+    "sn: user"
     }
 )
-public class PagedSearchIT
+public class PagedSearchIT extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     /**
      * Create the searchControls with a paged size
      */

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java Wed Jan  6 18:26:43 2010
@@ -20,14 +20,19 @@
 package org.apache.directory.server.operations.search;
 
 
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.util.ArrayList;
 import java.util.EventObject;
 import java.util.List;
 
 import javax.naming.NamingEnumeration;
-import javax.naming.directory.Attribute;
+import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchResult;
@@ -40,30 +45,24 @@
 import javax.naming.ldap.HasControls;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.event.EventService;
 import org.apache.directory.server.core.event.RegistrationEntry;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
-
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.codec.search.controls.ChangeType;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeControlCodec;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeControlDecoder;
 import org.apache.directory.shared.ldap.message.control.PersistentSearchControl;
-
+import org.apache.directory.shared.ldap.util.AttributeUtils;
+import org.junit.After;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
 
 /**
  * Test case which tests the correct operation of the persistent search control.
@@ -71,19 +70,23 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.SUITE )
+@RunWith ( FrameworkRunner.class ) 
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" )
+    })
 @ApplyLdifs( {
     // Entry # 2
-    "dn: cn=Tori Amos,ou=system\n" +
-    "objectClass: person\n" +
-    "objectClass: top\n" +
-    "cn: Tori Amos\n" +
-    "description: an American singer-songwriter\n" +
-    "sn: Amos\n\n"
+    "dn: cn=Tori Amos,ou=system",
+    "objectClass: person",
+    "objectClass: top",
+    "cn: Tori Amos",
+    "description: an American singer-songwriter",
+    "sn: Amos"
     }
 )
-public class PersistentSearchIT
+public class PersistentSearchIT extends AbstractLdapTestUnit
 {
     private static final Logger LOG = LoggerFactory.getLogger( PersistentSearchIT.class );
     
@@ -91,21 +94,17 @@
     private static final String PERSON_DESCRIPTION = "an American singer-songwriter";
     private static final String RDN = "cn=Tori Amos";
 
-    public static LdapServer ldapServer;
-    
 
     /**
      * Creation of required attributes of a person entry.
      */
-    protected Attributes getPersonAttributes( String sn, String cn )
+    private Attributes getPersonAttributes( String sn, String cn ) throws NamingException
     {
-        Attributes attributes = new BasicAttributes( true );
-        Attribute attribute = new BasicAttribute( "objectClass" );
-        attribute.add( "top" );
-        attribute.add( "person" );
-        attributes.put( attribute );
-        attributes.put( "cn", cn );
-        attributes.put( "sn", sn );
+        Attributes attributes = AttributeUtils.createAttributes( 
+            "objectClass: top",
+            "objectClass: person",
+            "cn", cn,
+            "sn", sn );
 
         return attributes;
     }
@@ -117,13 +116,13 @@
     Thread t;
     
 
-    public void setUpListenerReturnECs() throws Exception
+    private void setUpListenerReturnECs() throws Exception
     {
         setUpListener( true, new PersistentSearchControl(), false );
     }
     
     
-    public void setUpListener( boolean returnECs, PersistentSearchControl control, boolean ignoreEmptyRegistryCheck ) 
+    private void setUpListener( boolean returnECs, PersistentSearchControl control, boolean ignoreEmptyRegistryCheck ) 
         throws Exception
     {
         ctx = ( EventDirContext ) getWiredContext( ldapServer).lookup( BASE );
@@ -145,12 +144,13 @@
         {
             Thread.sleep( 100 );
         }
+        
         // Now we wait until the listener is registered (timing dependent crap)
         Thread.sleep( 250 );
     }
     
     
-    public void setUpListener() throws Exception
+    private void setUpListener() throws Exception
     {
         ctx = ( EventDirContext ) getWiredContext( ldapServer).lookup( BASE );
         eventService = ldapServer.getDirectoryService().getEventService();
@@ -166,11 +166,13 @@
         {
             Thread.sleep( 100 );
         }
+        
         // Now we wait until the listener is registered (timing dependent crap)
         Thread.sleep( 250 );
     }
     
     
+    @After
     public void tearDownListener() throws Exception
     {
         listener.close();
@@ -186,6 +188,7 @@
     private void waitForThreadToDie( Thread t ) throws Exception
     {
         long start = System.currentTimeMillis();
+        
         while ( t.isAlive() )
         {
             Thread.sleep( 200 );
@@ -209,7 +212,6 @@
         waitForThreadToDie( t );
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
-        tearDownListener();
     }
 
 
@@ -224,7 +226,6 @@
         waitForThreadToDie( t );
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
-        tearDownListener();
     }
 
 
@@ -239,7 +240,6 @@
         waitForThreadToDie( t );
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
-        tearDownListener();
     }
 
 
@@ -254,7 +254,6 @@
         waitForThreadToDie( t );
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
-        tearDownListener();
     }
 
 
@@ -272,7 +271,6 @@
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
-        tearDownListener();
     }
 
 
@@ -289,8 +287,7 @@
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODDN );
-        assertEquals( ( RDN + ",ou=system" ), listener.result.control.getPreviousDn().getUpName() );
-        tearDownListener();
+        assertEquals( ( RDN + ",ou=system" ), listener.result.control.getPreviousDn().getName() );
     }
 
 
@@ -307,7 +304,6 @@
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.DELETE );
-        tearDownListener();
     }
 
 
@@ -324,7 +320,6 @@
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
-        tearDownListener();
     }
 
 
@@ -361,8 +356,6 @@
         assertNotNull( listener.result );
         assertEquals( RDN, listener.result.getName() );
         assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
-        
-        tearDownListener();
     }
 
 
@@ -595,6 +588,7 @@
                     LOG.debug( "PSearchListener search request got an item." );
                     Control[] controls = null;
                     SearchResult sresult = list.next();
+                    
                     if ( sresult instanceof HasControls )
                     {
                         controls = ( ( HasControls ) sresult ).getControls();
@@ -611,9 +605,11 @@
                             }
                         }
                     }
+                    
                     result = new PSearchNotification( sresult, ecControl );
                     break;
                 }
+                
                 LOG.debug( "PSearchListener broke out of while loop." );
             }
             catch ( Exception e )

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java Wed Jan  6 18:26:43 2010
@@ -20,6 +20,15 @@
 package org.apache.directory.server.operations.search;
 
  
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContextThrowOnRefferal;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.StringReader;
 import java.util.HashMap;
 import java.util.Map;
@@ -34,27 +43,18 @@
 import javax.naming.ldap.LdapContext;
 import javax.naming.ldap.ManageReferralControl;
 
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.integ.SiRunner;
-
-import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContextThrowOnRefferal;
-import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
-
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 
 /**
  * Tests to make sure the server is operating correctly when handling referrals.
@@ -62,64 +62,67 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 545029 $
  */
-@RunWith ( SiRunner.class )
+@RunWith ( FrameworkRunner.class )
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" )
+    })
 @ApplyLdifs( {
     // Add new ref for ou=RemoteUsers
-    "dn: ou=RemoteUsers,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: referral\n" +
-    "objectClass: extensibleObject\n" +
-    "ou: RemoteUsers\n" +
-    "ref: ldap://fermi:10389/ou=users,ou=system\n" +
-    "ref: ldap://hertz:10389/ou=users,dc=example,dc=com\n" +
-    "ref: ldap://maxwell:10389/ou=users,ou=system\n\n" +
-    
-    "dn: c=France,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: country\n" +
-    "c: France\n\n" +
-    
-    "dn: c=USA,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: country\n" +
-    "c: USA\n\n" +
-    
-    "dn: l=Paris,c=france,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: locality\n" +
-    "l: Paris\n\n" +
-    
-    "dn: l=Jacksonville,c=usa,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: locality\n" +
-    "l: Jacksonville\n\n" +
-    
-    "dn: cn=emmanuel lecharny,l=paris,c=france,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: residentialPerson\n" +
-    "cn: emmanuel lecharny\n" +
-    "sn: elecharny\n" +
-    "l: Paris\n\n" +
-    
-    "dn: cn=alex karasulu,l=jacksonville,c=usa,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: residentialPerson\n" +
-    "cn: alex karasulu\n" +
-    "sn: karasulu\n" +
-    "l: Jacksonville\n\n" +
-    
-    "dn: ou=Countries,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: organizationalUnit\n" +
-    "ou: Countries\n\n"
+    "dn: ou=RemoteUsers,ou=system",
+    "objectClass: top",
+    "objectClass: referral",
+    "objectClass: extensibleObject",
+    "ou: RemoteUsers",
+    "ref: ldap://fermi:10389/ou=users,ou=system",
+    "ref: ldap://hertz:10389/ou=users,dc=example,dc=com",
+    "ref: ldap://maxwell:10389/ou=users,ou=system",
+    
+    "dn: c=France,ou=system",
+    "objectClass: top",
+    "objectClass: country",
+    "c: France",
+    
+    "dn: c=USA,ou=system",
+    "objectClass: top",
+    "objectClass: country",
+    "c: USA",
+    
+    "dn: l=Paris,c=france,ou=system",
+    "objectClass: top",
+    "objectClass: locality",
+    "l: Paris",
+    
+    "dn: l=Jacksonville,c=usa,ou=system",
+    "objectClass: top",
+    "objectClass: locality",
+    "l: Jacksonville",
+    
+    "dn: cn=emmanuel lecharny,l=paris,c=france,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: residentialPerson",
+    "cn: emmanuel lecharny",
+    "sn: elecharny",
+    "l: Paris",
+    
+    "dn: cn=alex karasulu,l=jacksonville,c=usa,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: residentialPerson",
+    "cn: alex karasulu",
+    "sn: karasulu",
+    "l: Jacksonville",
+    
+    "dn: ou=Countries,ou=system",
+    "objectClass: top",
+    "objectClass: organizationalUnit",
+    "ou: Countries"
     }
 )
-public class ReferralSearchIT
+public class ReferralSearchIT extends AbstractLdapTestUnit
 {
-    public static LdapServer ldapServer;
-
     
     @Before
     public void setupReferrals() throws Exception
@@ -144,7 +147,7 @@
         {
             LdifEntry entry = reader.next();
             ldapServer.getDirectoryService().getAdminSession().add( 
-                new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries(), entry.getEntry() ) ); 
+                new DefaultServerEntry( ldapServer.getDirectoryService().getSchemaManager(), entry.getEntry() ) ); 
         }
     }
     

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java Wed Jan  6 18:26:43 2010
@@ -20,6 +20,13 @@
 package org.apache.directory.server.operations.search;
 
 
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
@@ -27,22 +34,12 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.integ.SiRunner;
-import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
-
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
 
 /**
  * Test case with different search operations on the cn=schema entry. 
@@ -51,124 +48,120 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 569048 $
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.SUITE )
+@RunWith ( FrameworkRunner.class ) 
 @ApplyLdifs( {
     
     // Bogus AD schema (not real)
     
-    "dn: cn=active-directory, ou=schema\n" +
-    "objectclass: metaSchema\n" +
-    "objectclass: top\n" +
-    "cn: active-directory\n" +
-    "m-dependencies: core\n\n" +
-    
-    "dn: ou=attributeTypes, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: attributeTypes\n\n" +
-    
-    "dn: m-oid=1.1, ou=attributeTypes, cn=active-directory, ou=schema\n" +
-    "objectclass: metaAttributeType\n" +
-    "objectclass: metaTop\n" +
-    "objectclass: top\n" +
-    "m-oid: 1.1\n" +
-    "m-name: sAMAccountName\n" +
-    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.15\n\n" +
-    
-    "dn: m-oid=1.2, ou=attributeTypes, cn=active-directory, ou=schema\n" +
-    "objectclass: metaAttributeType\n" +
-    "objectclass: metaTop\n" +
-    "objectclass: top\n" +
-    "m-oid: 1.2\n" +
-    "m-name: pwdLastSet\n" +
-    "m-equality: integerMatch\n" +
-    "m-ordering: integerMatch\n" +
-    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.27\n\n" +
-
-    "dn: m-oid=1.4, ou=attributeTypes, cn=active-directory, ou=schema\n" +
-    "objectclass: metaAttributeType\n" +
-    "objectclass: metaTop\n" +
-    "objectclass: top\n" +
-    "m-oid: 1.4\n" +
-    "m-name: useraccountcontrol\n" +
-    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.27\n\n" +
-
-    "dn: m-oid=1.5, ou=attributeTypes, cn=active-directory, ou=schema\n" +
-    "objectclass: metaAttributeType\n" +
-    "objectclass: metaTop\n" +
-    "objectclass: top\n" +
-    "m-oid: 1.5\n" +
-    "m-name: SourceAD\n" +
-    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.15\n" +
-    "m-length: 0\n\n" +
-
-    "dn: ou=comparators, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: comparators\n\n" +
-
-    "dn: ou=ditContentRules, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: ditContentRules\n\n" +
-
-    "dn: ou=ditStructureRules, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: ditStructureRules\n\n" +
-
-    "dn: ou=matchingRules, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: matchingRules\n\n" +
-    
-    "dn: ou=nameForms, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: nameForms\n\n" +
-
-    "dn: ou=normalizers, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: normalizers\n\n" +
-
-    "dn: ou=objectClasses, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: objectClasses\n\n" +
-
-    "dn: m-oid=1.3, ou=objectClasses, cn=active-directory, ou=schema\n" +
-    "objectclass: metaObjectClass\n" +
-    "objectclass: metaTop\n" +
-    "objectclass: top\n" +
-    "m-oid: 1.3\n" +
-    "m-name: personActiveDirectory\n" +
-    "m-supObjectClass: person\n" +
-    "m-must: pwdLastSet\n" +
-    "m-must: sAMAccountName\n" +
-    "m-must: useraccountcontrol\n" +
-    "m-must: SourceAD\n\n" +
-
-    "dn: ou=syntaxCheckers, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: syntaxCheckers\n\n" +
-
-    "dn: ou=syntaxes, cn=active-directory, ou=schema\n" +
-    "objectclass: organizationalUnit\n" +
-    "objectclass: top\n" +
-    "ou: syntaxes\n\n"
+    "dn: cn=active-directory, ou=schema",
+    "objectclass: metaSchema",
+    "objectclass: top",
+    "cn: active-directory",
+    "m-dependencies: core",
+    
+    "dn: ou=attributeTypes, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: attributeTypes",
+    
+    "dn: m-oid=1.1, ou=attributeTypes, cn=active-directory, ou=schema",
+    "objectclass: metaAttributeType",
+    "objectclass: metaTop",
+    "objectclass: top",
+    "m-oid: 1.1",
+    "m-name: sAMAccountName",
+    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.15",
+    
+    "dn: m-oid=1.2, ou=attributeTypes, cn=active-directory, ou=schema",
+    "objectclass: metaAttributeType",
+    "objectclass: metaTop",
+    "objectclass: top",
+    "m-oid: 1.2",
+    "m-name: pwdLastSet",
+    "m-equality: integerMatch",
+    "m-ordering: integerMatch",
+    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.27",
+
+    "dn: m-oid=1.4, ou=attributeTypes, cn=active-directory, ou=schema",
+    "objectclass: metaAttributeType",
+    "objectclass: metaTop",
+    "objectclass: top",
+    "m-oid: 1.4",
+    "m-name: useraccountcontrol",
+    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.27",
+
+    "dn: m-oid=1.5, ou=attributeTypes, cn=active-directory, ou=schema",
+    "objectclass: metaAttributeType",
+    "objectclass: metaTop",
+    "objectclass: top",
+    "m-oid: 1.5",
+    "m-name: SourceAD",
+    "m-syntax: 1.3.6.1.4.1.1466.115.121.1.15",
+    "m-length: 0",
+
+    "dn: ou=comparators, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: comparators",
+
+    "dn: ou=ditContentRules, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: ditContentRules",
+
+    "dn: ou=ditStructureRules, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: ditStructureRules",
+
+    "dn: ou=matchingRules, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: matchingRules",
+    
+    "dn: ou=nameForms, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: nameForms",
+
+    "dn: ou=normalizers, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: normalizers",
+
+    "dn: ou=objectClasses, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: objectClasses",
+
+    "dn: m-oid=1.3, ou=objectClasses, cn=active-directory, ou=schema",
+    "objectclass: metaObjectClass",
+    "objectclass: metaTop",
+    "objectclass: top",
+    "m-oid: 1.3",
+    "m-name: personActiveDirectory",
+    "m-supObjectClass: person",
+    "m-must: pwdLastSet",
+    "m-must: sAMAccountName",
+    "m-must: useraccountcontrol",
+    "m-must: SourceAD",
+
+    "dn: ou=syntaxCheckers, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: syntaxCheckers",
+
+    "dn: ou=syntaxes, cn=active-directory, ou=schema",
+    "objectclass: organizationalUnit",
+    "objectclass: top",
+    "ou: syntaxes"
     }
 )
-public class SchemaSearchIT 
+public class SchemaSearchIT extends AbstractLdapTestUnit 
 {
     private static final String DN = "cn=schema";
     private static final String FILTER = "(objectclass=subschema)";
 
-    
-    public static LdapServer ldapServer;
-    
 
     protected void checkForAttributes( Attributes attrs, String[] attrNames )
     {

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java Wed Jan  6 18:26:43 2010
@@ -54,11 +54,12 @@
 import netscape.ldap.LDAPMessage;
 import netscape.ldap.LDAPSearchListener;
 
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
-import org.apache.directory.server.integ.SiRunner;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.control.SubentriesControl;
@@ -75,107 +76,111 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 682556 $
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.CLASS )
+@RunWith ( FrameworkRunner.class ) 
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" )
+    })
 @ApplyLdifs( {
     
     // Entry # 0
-    "dn: cn=Kate Bush,ou=system\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: inetOrgPerson\n" +
-    "objectClass: strongAuthenticationUser\n" +
-    "objectClass: top\n" +
-    "userCertificate:: NFZOXw==\n" +
-    "cn: Kate Bush\n" +
-    "description: this is a person\n" +
-    "sn: Bush\n" +
-    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX\n" +
-    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw\n" +
-    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2\n" +
-    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA\n" +
-    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E\n" +
-    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8\n" +
-    " AigC14//Z\n\n" +
+    "dn: cn=Kate Bush,ou=system",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: inetOrgPerson",
+    "objectClass: strongAuthenticationUser",
+    "objectClass: top",
+    "userCertificate:: NFZOXw==",
+    "cn: Kate Bush",
+    "description: this is a person",
+    "sn: Bush",
+    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX",
+    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw",
+    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2",
+    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA",
+    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E",
+    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8",
+    " AigC14//Z",
     
     // Entry # 2
-    "dn: cn=Tori Amos,ou=system\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: inetOrgPerson\n" +
-    "objectClass: strongAuthenticationUser\n" +
-    "objectClass: top\n" +
-    "userCertificate:: NFZOXw==\n" +
-    "cn: Tori Amos\n" +
-    "description: an American singer-songwriter\n" +
-    "sn: Amos\n" +
-    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX\n" +
-    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw\n" +
-    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2\n" +
-    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA\n" +
-    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E\n" +
-    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8\n" +
-    " AigC14//Z\n\n" + 
+    "dn: cn=Tori Amos,ou=system",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: inetOrgPerson",
+    "objectClass: strongAuthenticationUser",
+    "objectClass: top",
+    "userCertificate:: NFZOXw==",
+    "cn: Tori Amos",
+    "description: an American singer-songwriter",
+    "sn: Amos",
+    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX",
+    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw",
+    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2",
+    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA",
+    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E",
+    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8",
+    " AigC14//Z", 
 
     // Entry # 3
-    "dn: cn=Rolling-Stones,ou=system\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: inetOrgPerson\n" +
-    "objectClass: strongAuthenticationUser\n" +
-    "objectClass: top\n" +
-    "userCertificate:: NFZOXw==\n" +
-    "cn: Rolling-Stones\n" +
-    "description: an English singer-songwriter\n" +
-    "sn: Jagger\n" +
-    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX\n" +
-    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw\n" +
-    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2\n" +
-    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA\n" +
-    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E\n" +
-    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8\n" +
-    " AigC14//Z\n\n" + 
+    "dn: cn=Rolling-Stones,ou=system",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: inetOrgPerson",
+    "objectClass: strongAuthenticationUser",
+    "objectClass: top",
+    "userCertificate:: NFZOXw==",
+    "cn: Rolling-Stones",
+    "description: an English singer-songwriter",
+    "sn: Jagger",
+    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX",
+    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw",
+    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2",
+    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA",
+    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E",
+    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8",
+    " AigC14//Z", 
 
     // Entry # 4
-    "dn: cn=Heather Nova,ou=system\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: inetOrgPerson\n" +
-    "objectClass: strongAuthenticationUser\n" +
-    "objectClass: top\n" +
-    "userCertificate:: NFZOXw==\n" +
-    "cn: Heather Nova\n" +
-    "sn: Nova\n" +
-    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX\n" +
-    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw\n" +
-    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2\n" +
-    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA\n" +
-    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E\n" +
-    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8\n" +
-    " AigC14//Z\n\n" +
+    "dn: cn=Heather Nova,ou=system",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: inetOrgPerson",
+    "objectClass: strongAuthenticationUser",
+    "objectClass: top",
+    "userCertificate:: NFZOXw==",
+    "cn: Heather Nova",
+    "sn: Nova",
+    "jpegPhoto:: /9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAAAAgAAAAAAAD//gAX",
+    " Q3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw",
+    " 5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2",
+    " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA",
+    " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E",
+    " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8",
+    " AigC14//Z",
     
     // Entry #5
-    "dn: cn=Janis Joplin,ou=system\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: inetOrgPerson\n" +
-    "objectClass: top\n" +
-    "objectClass: strongAuthenticationUser\n" +
-    "cn: Janis Joplin\n" +
-    "sn: Joplin\n" +
-    "userCertificate:: \n\n" +
+    "dn: cn=Janis Joplin,ou=system",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: inetOrgPerson",
+    "objectClass: top",
+    "objectClass: strongAuthenticationUser",
+    "cn: Janis Joplin",
+    "sn: Joplin",
+    "userCertificate:: ",
     
     // Entry #6
-    "dn: cn=Kim Wilde,ou=system\n" +
-    "objectClass: person\n" +
-    "objectClass: top\n" +
-    "cn: Kim Wilde\n" +
-    "sn: Wilde\n" +
-    "description: an American singer-songwriter+sexy blond\n\n"
+    "dn: cn=Kim Wilde,ou=system",
+    "objectClass: person",
+    "objectClass: top",
+    "cn: Kim Wilde",
+    "sn: Wilde",
+    "description: an American singer-songwriter+sexy blond"
     
     }
 )
-public class SearchIT 
+public class SearchIT extends AbstractLdapTestUnit 
 {
     private static final String BASE = "ou=system";
     
@@ -1709,7 +1714,6 @@
         }
         catch ( LDAPException e )
         {
-            e.printStackTrace();
             fail( "Should not have caught exception." );
         }
         finally

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java Wed Jan  6 18:26:43 2010
@@ -20,39 +20,40 @@
 package org.apache.directory.server.operations.search;
 
 
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.SizeLimitExceededException;
+import javax.naming.TimeLimitExceededException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.ApplyLdifs;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.Interceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
-import org.apache.directory.server.integ.SiRunner;
-import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-
 import org.apache.directory.server.ldap.LdapServer;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import javax.naming.NamingEnumeration;
-import javax.naming.SizeLimitExceededException;
-import javax.naming.TimeLimitExceededException;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-
-import java.util.HashSet;
-import java.util.Set;
-
 
 /**
  * A set of tests to make sure the negation operator is working 
@@ -61,65 +62,67 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.SUITE )
+@RunWith ( FrameworkRunner.class ) 
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" )
+    })
 @ApplyLdifs( {
-    "dn: ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: organizationalUnit\n" +
-    "ou: actors\n\n" +
-
-    "dn: uid=jblack,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: jblack\n" +
-    "ou: comedy\n" +
-    "ou: adventure\n" +
-    "cn: Jack Black\n" +
-    "userPassword: secret\n" +
-    "sn: Black\n\n" +
-
-    "dn: uid=bpitt,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: bpitt\n" +
-    "ou: drama\n" +
-    "ou: adventure\n" +
-    "userPassword: secret\n" +
-    "cn: Brad Pitt\n" +
-    "sn: Pitt\n\n" +
-
-    "dn: uid=gcloony,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: gcloony\n" +
-    "ou: drama\n" +
-    "userPassword: secret\n" +
-    "cn: Goerge Cloony\n" +
-    "sn: Cloony\n\n" +
-
-    "dn: uid=jnewbie,ou=actors,ou=system\n" +
-    "objectClass: top\n" +
-    "objectClass: person\n" +
-    "objectClass: organizationalPerson\n" +
-    "objectClass: uidObject\n" +
-    "uid: jnewbie\n" +
-    "userPassword: secret\n" +
-    "cn: Joe Newbie\n" +
-    "sn: Newbie\n\n" 
+    "dn: ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: organizationalUnit",
+    "ou: actors",
+
+    "dn: uid=jblack,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: jblack",
+    "ou: comedy",
+    "ou: adventure",
+    "cn: Jack Black",
+    "userPassword: secret",
+    "sn: Black",
+
+    "dn: uid=bpitt,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: bpitt",
+    "ou: drama",
+    "ou: adventure",
+    "userPassword: secret",
+    "cn: Brad Pitt",
+    "sn: Pitt",
+
+    "dn: uid=gcloony,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: gcloony",
+    "ou: drama",
+    "userPassword: secret",
+    "cn: Goerge Cloony",
+    "sn: Cloony",
+
+    "dn: uid=jnewbie,ou=actors,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: organizationalPerson",
+    "objectClass: uidObject",
+    "uid: jnewbie",
+    "userPassword: secret",
+    "cn: Joe Newbie",
+    "sn: Newbie" 
     }
 )
-public class SearchLimitsIT 
+public class SearchLimitsIT extends AbstractLdapTestUnit 
 {
-    public static LdapServer ldapServer;
 
-    
     /**
      * An {@link Interceptor} that fakes a specified amount of delay to each 
      * search iteration so we can make sure search time limits are adhered to.

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java?rev=896599&r1=896598&r2=896599&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java Wed Jan  6 18:26:43 2010
@@ -20,46 +20,32 @@
 package org.apache.directory.server.ssl;
 
 
-import org.apache.directory.server.core.DefaultDirectoryService;
-import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.server.core.integ.Level;
-import org.apache.directory.server.core.integ.annotations.CleanupLevel;
-import org.apache.directory.server.core.integ.annotations.Factory;
-import org.apache.directory.server.core.security.TlsKeyGenerator;
-import org.apache.directory.server.integ.LdapServerFactory;
-import org.apache.directory.server.integ.SiRunner;
-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 static org.junit.Assert.assertNotNull;
+
+import java.util.Hashtable;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.annotations.SaslMechanism;
+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.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.bind.plain.PlainMechanismHandler;
 import org.apache.directory.server.ldap.handlers.extended.StoredProcedureExtendedOperationHandler;
-import org.apache.directory.server.protocol.shared.transport.TcpTransport;
+import org.apache.directory.server.operations.bind.BogusNtlmProvider;
 import org.apache.directory.shared.ldap.constants.SupportedSaslMechanisms;
-import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.mina.util.AvailablePortFinder;
+import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
-import javax.naming.directory.ModificationItem;
-
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
 
 
 /**
@@ -69,71 +55,39 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev: 642496 $
  */
-@RunWith ( SiRunner.class ) 
-@CleanupLevel ( Level.CLASS )
-@Factory ( LdapsIT.Factory.class )
-public class LdapsIT
+@RunWith ( FrameworkRunner.class ) 
+@CreateDS( allowAnonAccess=true, name="LdapsIT-class")
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" ),
+        @CreateTransport( protocol = "LDAPS" )
+    },
+    saslHost="localhost",
+    saslMechanisms = 
+    {
+        @SaslMechanism( name=SupportedSaslMechanisms.PLAIN, implClass=PlainMechanismHandler.class ),
+        @SaslMechanism( name=SupportedSaslMechanisms.CRAM_MD5, implClass=CramMd5MechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.DIGEST_MD5, implClass=DigestMd5MechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.GSSAPI, implClass=GssapiMechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.NTLM, implClass=NtlmMechanismHandler.class),
+        @SaslMechanism( name=SupportedSaslMechanisms.GSS_SPNEGO, implClass=NtlmMechanismHandler.class)
+    },
+    extendedOpHandlers = 
+    {
+        StoredProcedureExtendedOperationHandler.class
+    },
+    ntlmProvider=BogusNtlmProvider.class
+    )
+public class LdapsIT extends AbstractLdapTestUnit
 {
     private static final String RDN = "cn=The Person";
-
-    
-    public static LdapServer ldapServer;
-
-    
-    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 );
-
-            // 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 );
-            TcpTransport tcpTransport = new TcpTransport( port );
-            int portSSL = port + 1;
-            TcpTransport tcpTransportSsl = new TcpTransport( portSSL );
-            tcpTransportSsl.enableSSL( true );
-            ldapServer.setTransports( tcpTransport, tcpTransportSsl );
-            ldapServer.setEnabled( true );
-            ldapServer.setConfidentialityRequired( true );
-            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 an entry for a person.
+     * Create a secure connection on ou=system.
      */
-    public DirContext getSecureConnection() throws Exception
+    private DirContext getSecureConnectionSystem() throws Exception
     {
         Hashtable<String, String> env = new Hashtable<String, String>();
         env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
@@ -152,72 +106,18 @@
      * @throws NamingException cannot create person
      */
     @Test
-    public void testLdapS() throws Exception
+    public void testLdaps() throws Exception
     {
         // Create a person
-        Attributes attributes = new BasicAttributes( true );
-        Attribute attribute = new BasicAttribute( "objectClass" );
-        attribute.add( "top" );
-        attribute.add( "person" );
-        attributes.put( attribute );
-        attributes.put( "cn", "The Person" );
-        attributes.put( "sn", "Person" );
-        attributes.put( "description", "this is a person" );
-        DirContext ctx = getSecureConnection();
+        Attributes attributes = AttributeUtils.createAttributes( 
+            "objectClass: top",
+            "objectClass: person",
+            "cn: The Person",
+            "sn: Person",
+            "description: this is a person" );
+        DirContext ctx = getSecureConnectionSystem();
         DirContext person = ctx.createSubcontext( RDN, attributes );
 
         assertNotNull( person );
     }
-
-    /**
-     * Test for DIRSERVER-1373.
-     */
-    @Test
-    public void testUpdateCertificate() throws Exception
-    {
-        // create a secure connection
-        Hashtable<String, String> env = new Hashtable<String, String>();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldaps://localhost:" + ldapServer.getPortSSL() );
-        env.put( "java.naming.ldap.factory.socket", SSLSocketFactory.class.getName() );
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        InitialDirContext ctx = new InitialDirContext( env );
-
-        // create a new certificate
-        String newIssuerDN = "cn=new_issuer_dn";
-        String newSubjectDN = "cn=new_subject_dn";
-        ServerEntry entry = ldapServer.getDirectoryService().getAdminSession().lookup(
-            new LdapDN( "uid=admin,ou=system" ) );
-        TlsKeyGenerator.addKeyPair( entry, newIssuerDN, newSubjectDN, "RSA" );
-
-        // now update the certificate (over the wire)
-        ModificationItem[] mods = new ModificationItem[3];
-        mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
-            TlsKeyGenerator.PRIVATE_KEY_AT, entry.get( TlsKeyGenerator.PRIVATE_KEY_AT ).getBytes() ) );
-        mods[1] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
-            TlsKeyGenerator.PUBLIC_KEY_AT, entry.get( TlsKeyGenerator.PUBLIC_KEY_AT ).getBytes() ) );
-        mods[2] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
-            TlsKeyGenerator.USER_CERTIFICATE_AT, entry.get( TlsKeyGenerator.USER_CERTIFICATE_AT ).getBytes() ) );
-        ctx.modifyAttributes( "uid=admin,ou=system", mods );
-        ctx.close();
-
-        ldapServer.reloadSslContext();
-        
-        // create a secure connection
-        ctx = new InitialDirContext( env );
-
-        // check the received certificate, it must contain the updated server certificate
-        X509Certificate[] lastReceivedServerCertificates = BogusTrustManagerFactory.lastReceivedServerCertificates;
-        assertNotNull( lastReceivedServerCertificates );
-        assertEquals( 1, lastReceivedServerCertificates.length );
-        String issuerDN = lastReceivedServerCertificates[0].getIssuerDN().getName();
-        String subjectDN = lastReceivedServerCertificates[0].getSubjectDN().getName();
-        // converting the values to lowercase is required cause the certificate is
-        // having attribute names in capital letters e.c the above newIssuerDN will be present as CN=new_issuer_dn
-        assertEquals( "Expected the new certificate with the new issuer", newIssuerDN.toLowerCase(), issuerDN.toLowerCase() );
-        assertEquals( "Expected the new certificate with the new subject", newSubjectDN.toLowerCase(), subjectDN.toLowerCase() );
-    }
-
 }



Mime
View raw message