directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r917192 - /directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
Date Sun, 28 Feb 2010 15:47:47 GMT
Author: kayyagari
Date: Sun Feb 28 15:47:47 2010
New Revision: 917192

URL: http://svn.apache.org/viewvc?rev=917192&view=rev
Log:
committing the test case attached to DIRSERVER-1340

Modified:
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java?rev=917192&r1=917191&r2=917192&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
(original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SchemaServiceIT.java
Sun Feb 28 15:47:47 2010
@@ -21,6 +21,7 @@
 
 
 import static org.apache.directory.server.core.integ.IntegrationUtils.getRootContext;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getSchemaContext;
 import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
@@ -905,4 +906,34 @@
         assertTrue( ocs.contains( "organizationalPerson" ) );
         assertTrue( ocs.contains( "inetOrgPerson" ) );
     }
+    
+    
+    
+    /**
+     * Search all the entries with a 'metaTop' ObjectClass, or an ObjectClass
+     * inheriting from 'metaTop' 
+     *
+     * @throws NamingException on error
+     */
+    @Test
+    public void testSearchForMetaTop() throws Exception
+    {
+        LdapContext schemaRoot = getSchemaContext( service );
+        
+        SearchControls controls = new SearchControls();
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        NamingEnumeration<SearchResult> results = schemaRoot.search( "", "(objectClass=top)",
controls );
+        assertTrue( "Expected some results", results.hasMore() );
+        
+        controls = new SearchControls();
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        results = schemaRoot.search( "", "(objectClass=metaAttributeType)", controls );
+        assertTrue( "Expected some results", results.hasMore() );
+        
+        controls = new SearchControls();
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        results = schemaRoot.search( "", "(objectClass=metaTop)", controls );
+        assertTrue( "Expected some results", results.hasMore() );
+    }
+    
 }



Mime
View raw message