directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
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 GMT
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 );



Mime
View raw message