directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r940268 - /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
Date Sun, 02 May 2010 17:25:34 GMT
Author: seelmann
Date: Sun May  2 17:25:34 2010
New Revision: 940268

URL: http://svn.apache.org/viewvc?rev=940268&view=rev
Log:
Handle nondeterministic order of search continuations.

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=940268&r1=940267&r2=940268&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
Sun May  2 17:25:34 2010
@@ -30,6 +30,8 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.util.HashSet;
+import java.util.Set;
 import java.util.UUID;
 
 import javax.naming.Context;
@@ -521,14 +523,19 @@ public class AddIT extends AbstractLdapT
         controls.setDerefLinkFlag( true );
         controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
         containerCtx.addToEnvironment( "java.naming.ldap.derefAliases", "never" );
+        Set<String> names = new HashSet<String>();
         NamingEnumeration<SearchResult> ne = containerCtx.search( "", "(objectClass=*)",
controls );
         assertTrue( ne.hasMore() );
         SearchResult sr = ne.next();
-        assertEquals( "ou=favorite", sr.getName() );
+        names.add( sr.getName() );
         assertTrue( ne.hasMore() );
         sr = ne.next();
-        assertEquals( "ou=bestFruit", sr.getName() );
-        
+        names.add( sr.getName() );
+        assertFalse( ne.hasMore() );
+        assertEquals( 2, names.size() );
+        assertTrue( names.contains( "ou=favorite" ) );
+        assertTrue( names.contains( "ou=bestFruit" ) );
+
         // search one level with dereferencing turned on
         controls = new SearchControls();
         controls.setDerefLinkFlag( true );



Mime
View raw message