Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 15990 invoked from network); 2 Jan 2010 18:45:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jan 2010 18:45:19 -0000 Received: (qmail 20084 invoked by uid 500); 2 Jan 2010 18:45:19 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 20027 invoked by uid 500); 2 Jan 2010 18:45:18 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 20018 invoked by uid 99); 2 Jan 2010 18:45:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jan 2010 18:45:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jan 2010 18:45:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C499E23889EC; Sat, 2 Jan 2010 18:44:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r895258 - /directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java Date: Sat, 02 Jan 2010 18:44:56 -0000 To: commits@directory.apache.org From: kayyagari@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100102184457.C499E23889EC@eris.apache.org> Author: kayyagari Date: Sat Jan 2 18:44:54 2010 New Revision: 895258 URL: http://svn.apache.org/viewvc?rev=895258&view=rev Log: o fixed failing tests after migrating to the new testing framework o removed (now)useless factory Modified: directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java Modified: directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java?rev=895258&r1=895257&r2=895258&view=diff ============================================================================== --- directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java (original) +++ directory/apacheds/branches/apacheds-schema/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java Sat Jan 2 18:44:54 2010 @@ -35,14 +35,16 @@ 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.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.integ.AbstractLdapTestUnit; import org.apache.directory.server.core.integ.FrameworkRunner; import org.apache.directory.server.core.integ.IntegrationUtils; -import org.apache.directory.server.core.integ.annotations.ApplyLdifs; -import org.apache.directory.server.core.integ.annotations.Factory; 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; @@ -53,6 +55,7 @@ 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; @@ -72,7 +75,6 @@ * @version $Rev$, $Date$ */ @RunWith ( FrameworkRunner.class ) -@Factory ( IndexedNegationSearchIT.Factory.class ) @ApplyLdifs( { "dn: ou=test,ou=system", "objectClass: top", @@ -144,67 +146,27 @@ } ) +@CreateLdapServer ( + transports = + { + @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 { - 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> indexedAttrs = new HashSet>(); - indexedAttrs.add( new JdbmIndex( SchemaConstants.OBJECT_CLASS_AT ) ); - indexedAttrs.add( new JdbmIndex( 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 mechanismHandlerMap = new HashMap(); - 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; - } - } - /** * Tests to make sure a negated search for OU of "test1" returns