Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 87610 invoked from network); 13 Feb 2007 18:27:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2007 18:27:10 -0000 Received: (qmail 68587 invoked by uid 500); 13 Feb 2007 18:27:15 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 68560 invoked by uid 500); 13 Feb 2007 18:27:15 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 68533 invoked by uid 99); 13 Feb 2007 18:27:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 10:27:15 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 10:27:07 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 3C1571A981D; Tue, 13 Feb 2007 10:26:47 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070213182647.3C1571A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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://")); + } + } }