directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r499794 - /directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
Date Thu, 25 Jan 2007 13:44:38 GMT
Author: elecharny
Date: Thu Jan 25 05:44:37 2007
New Revision: 499794

URL: http://svn.apache.org/viewvc?view=rev&rev=499794
Log:
Added two more tests for DIRSERVER-826 (imported Stefan's sample)

Modified:
    directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SearchTest.java

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SearchTest.java?view=diff&rev=499794&r1=499793&r2=499794
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/SearchTest.java
Thu Jan 25 05:44:37 2007
@@ -1014,6 +1014,66 @@
     }
     
     /**
+     * Check if operational attributes are present, if "+" is requested.
+     */
+    public void testSearchOperationalAttributes() throws NamingException
+    {
+        SearchControls ctls = new SearchControls();
+
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+        ctls.setReturningAttributes( new String[]
+            { "+" } );
+
+        NamingEnumeration result = ctx.search( HEATHER_RDN, filter, ctls );
+
+        if ( result.hasMore() )
+        {
+            SearchResult entry = ( SearchResult ) result.next();
+
+            String[] opAttrNames =
+                { "creatorsName", "createTimestamp" };
+
+            checkForAttributes( entry.getAttributes(), opAttrNames );
+        }
+        else
+        {
+            fail( "entry " + HEATHER_RDN + " not found" );
+        }
+
+        result.close();
+    }
+
+    /**
+     * Check if user attributes are present, if "*" is requested.
+     */
+    public void testSearchUserAttributes() throws NamingException
+    {
+        SearchControls ctls = new SearchControls();
+
+        ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
+        ctls.setReturningAttributes( new String[]
+            { "*" } );
+
+        NamingEnumeration result = ctx.search( HEATHER_RDN, filter, ctls );
+
+        if ( result.hasMore() )
+        {
+            SearchResult entry = ( SearchResult ) result.next();
+
+            String[] userAttrNames =
+                { "objectClass", "sn", "cn" };
+
+            checkForAttributes( entry.getAttributes(), userAttrNames );
+        }
+        else
+        {
+            fail( "entry " + HEATHER_RDN + " not found" );
+        }
+
+        result.close();
+    }
+    
+    /**
      * Check if user and operational attributes are present, if both "*" and "+" are requested.
      */
     public void testSearchOperationalAndUserAttributes() throws NamingException



Mime
View raw message