Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 94710 invoked from network); 18 Jan 2007 18:43:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jan 2007 18:43:04 -0000 Received: (qmail 93471 invoked by uid 500); 18 Jan 2007 18:43:10 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 93431 invoked by uid 500); 18 Jan 2007 18:43:10 -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 93420 invoked by uid 99); 18 Jan 2007 18:43:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2007 10:43:10 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2007 10:43:03 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id D8B8C1A981A; Thu, 18 Jan 2007 10:41:58 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r497529 - /directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER758ITest.java Date: Thu, 18 Jan 2007 18:41:58 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070118184158.D8B8C1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Thu Jan 18 10:41:58 2007 New Revision: 497529 URL: http://svn.apache.org/viewvc?view=rev&rev=497529 Log: Removed the warnigs (useless code, useless imports) Added javadoc Modified: directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER758ITest.java Modified: directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER758ITest.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER758ITest.java?view=diff&rev=497529&r1=497528&r2=497529 ============================================================================== --- directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER758ITest.java (original) +++ directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/DIRSERVER758ITest.java Thu Jan 18 10:41:58 2007 @@ -20,22 +20,13 @@ package org.apache.directory.server.core.jndi; -import java.util.HashSet; -import java.util.Set; - import org.apache.directory.server.core.unit.AbstractAdminTestCase; import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException; import org.apache.directory.shared.ldap.message.AttributeImpl; import org.apache.directory.shared.ldap.message.AttributesImpl; -import javax.naming.NamingEnumeration; -import javax.naming.NamingException; import javax.naming.directory.Attributes; import javax.naming.directory.Attribute; -import javax.naming.directory.DirContext; -import javax.naming.directory.SearchControls; -import javax.naming.directory.SearchResult; -import javax.naming.ldap.LdapContext; /** @@ -52,43 +43,9 @@ } /** - * Performs a search from a base and - * check that the expected result is found + * Test that we can't add an entry with an attribute type not within + * any of the MUST or MAY of any of its objectClasses */ - private boolean exist( LdapContext ctx, String filter, String expected ) throws NamingException - { - SearchControls controls = new SearchControls(); - controls.setSearchScope( SearchControls.SUBTREE_SCOPE ); - - return exist( ctx, filter, expected, controls ); - } - - /** - * Performs a search from a base and - * check that the expected result is found - */ - private boolean exist( LdapContext ctx, String filter, String expected, - SearchControls controls ) throws NamingException - { - NamingEnumeration ii = ctx.search( "", filter, controls ); - - // collect all results - Set results = new HashSet(); - - while ( ii.hasMore() ) - { - SearchResult result = ( SearchResult ) ii.next(); - results.add( result.getName() ); - } - - if ( results.size() == 1 ) - { - return results.contains( expected ); - } - - return false; - } - public void testAddAttributesNotInObjectClasses() throws Exception { Attributes attrs = new AttributesImpl( true );