You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/04/30 01:53:09 UTC
svn commit: r1332029 -
/directory/apacheds/branches/index-work/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
Author: elecharny
Date: Sun Apr 29 23:53:09 2012
New Revision: 1332029
URL: http://svn.apache.org/viewvc?rev=1332029&view=rev
Log:
Added a test that search for the rootDSE through a searchRequest
Modified:
directory/apacheds/branches/index-work/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
Modified: directory/apacheds/branches/index-work/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java?rev=1332029&r1=1332028&r2=1332029&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java (original)
+++ directory/apacheds/branches/index-work/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchIT.java Sun Apr 29 23:53:09 2012
@@ -1879,6 +1879,43 @@ public class SearchIT extends AbstractLd
@Test
+ public void testSearchRootDSE() throws Exception
+ {
+ SearchControls controls = new SearchControls();
+ controls.setSearchScope( SearchControls.OBJECT_SCOPE );
+ controls.setDerefLinkFlag( false );
+ controls.setReturningAttributes( new String[]{ "*", "+" } );
+
+ LdapContext nullRootCtx = getRootContext( getService() );
+
+ NamingEnumeration<SearchResult> list = nullRootCtx.search( "", "(objectClass=*)", controls );
+ Attributes rootDse = null;
+
+ while ( list.hasMore() )
+ {
+ SearchResult result = list.next();
+ rootDse = result.getAttributes();
+ }
+
+ list.close();
+
+ assertNotNull( rootDse );
+
+ assertEquals( 10, rootDse.size() );
+ assertNotNull( rootDse.get( "objectClass" ) );
+ assertNotNull( rootDse.get( "entryUUID" ) );
+ assertNotNull( rootDse.get( "namingContexts" ) );
+ assertNotNull( rootDse.get( "subschemaSubentry" ) );
+ assertNotNull( rootDse.get( "supportedControl" ) );
+ assertNotNull( rootDse.get( "supportedExtension" ) );
+ assertNotNull( rootDse.get( "supportedFeatures" ) );
+ assertNotNull( rootDse.get( "supportedLDAPVersion" ) );
+ assertNotNull( rootDse.get( "vendorName" ) );
+ assertNotNull( rootDse.get( "vendorVersion" ) );
+ }
+
+
+ @Test
public void testSearchEmptyDNWithOneLevelScopeAndNoObjectClassPresenceFilter() throws Exception
{
SearchControls controls = new SearchControls();