directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r499186 - /directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/jndi/SearchContextITest.java
Date Tue, 23 Jan 2007 23:59:38 GMT
Author: elecharny
Date: Tue Jan 23 15:59:35 2007
New Revision: 499186

URL: http://svn.apache.org/viewvc?view=rev&rev=499186
Log:
Added a test where we do a search and requesting for attribute 1.1 (no attributes returned)

Modified:
    directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/jndi/SearchContextITest.java

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/jndi/SearchContextITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/jndi/SearchContextITest.java?view=diff&rev=499186&r1=499185&r2=499186
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/jndi/SearchContextITest.java
(original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/jndi/SearchContextITest.java
Tue Jan 23 15:59:35 2007
@@ -202,6 +202,30 @@
         assertTrue( map.containsKey( "ou=subtest,ou=testing01,ou=system" ) );
     }
 
+    public void testSearchSubTreeLevelNoAttributes() throws NamingException
+    {
+        SearchControls controls = new SearchControls();
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        controls.setDerefLinkFlag( false );
+        controls.setReturningAttributes( new String[]{ "1.1" } );
+        
+        sysRoot.addToEnvironment( DerefAliasesEnum.JNDI_DEREF_ALIAS_PROP, DerefAliasesEnum.NEVER_DEREF_ALIASES
);
+
+        HashMap<String, Attributes> map = new HashMap<String, Attributes>();
+        NamingEnumeration list = sysRoot.search( "", "(ou=testing02)", controls );
+        
+        while ( list.hasMore() )
+        {
+            SearchResult result = ( SearchResult ) list.next();
+            map.put( result.getName(), result.getAttributes() );
+        }
+
+        assertEquals( "Expected number of results returned was incorrect", 1, map.size()
);
+        assertTrue( map.containsKey( "ou=testing02,ou=system" ) );
+        Attributes attrs = map.get( "ou=testing02,ou=system" );
+        
+        assertEquals( 0, attrs.size() );
+    }
 
     public void testSearchSubstringSubTreeLevel() throws NamingException
     {



Mime
View raw message