directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r507140 - /directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/ReferralITest.java
Date Tue, 13 Feb 2007 18:26:47 GMT
Author: elecharny
Date: Tue Feb 13 10:26:46 2007
New Revision: 507140

URL: http://svn.apache.org/viewvc?view=rev&rev=507140
Log:
Adding two tests to check DIRSERVER-806

Modified:
    directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/ReferralITest.java

Modified: directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/ReferralITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/ReferralITest.java?view=diff&rev=507140&r1=507139&r2=507140
==============================================================================
--- directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/ReferralITest.java
(original)
+++ directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/ReferralITest.java
Tue Feb 13 10:26:46 2007
@@ -1003,4 +1003,52 @@
 
         assertNull( results.get( "ou=users" ) );
     }
+
+    public void testSimpleContinuationWithDefaultFilter() throws Exception
+    {
+        SearchControls controls = new SearchControls();
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
+
+        try {
+            NamingEnumeration enm = td.refCtx.search("", "(objectClass=*)", controls);
+    
+            while ( enm.hasMore() ) 
+            {
+                enm.next();
+            }
+            
+            fail("No referral exception");
+        } 
+        catch (ReferralException e) 
+        {
+            assertNotNull(e.getReferralInfo());
+            String referralInfo = e.getReferralInfo().toString();
+            assertTrue(referralInfo.startsWith("ldap://"));
+        }
+    }
+
+    public void testSimpleContinuationWithCnFilter() throws Exception
+    {
+        SearchControls controls = new SearchControls();
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        td.refCtx.addToEnvironment( Context.REFERRAL, "throw" );
+
+        try {
+            NamingEnumeration enm = td.refCtx.search("", "(cn=does not exist)", controls);
+    
+            while ( enm.hasMore() ) 
+            {
+                enm.next();
+            }
+            
+            fail("No referral exception");
+        } 
+        catch (ReferralException e) 
+        {
+            assertNotNull(e.getReferralInfo());
+            String referralInfo = e.getReferralInfo().toString();
+            assertTrue(referralInfo.startsWith("ldap://"));
+        }
+    }
 }



Mime
View raw message