Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 71244 invoked from network); 17 May 2010 09:10:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 May 2010 09:10:42 -0000 Received: (qmail 70162 invoked by uid 500); 17 May 2010 09:10:42 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 70109 invoked by uid 500); 17 May 2010 09:10:41 -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 70102 invoked by uid 99); 17 May 2010 09:10:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 09:10:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 May 2010 09:10:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4603023889BF; Mon, 17 May 2010 09:10:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r945036 - /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java Date: Mon, 17 May 2010 09:10:17 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100517091017.4603023889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Mon May 17 09:10:16 2010 New Revision: 945036 URL: http://svn.apache.org/viewvc?rev=945036&view=rev Log: o Added a connection close after every test o Added some delay after the connection is closed so that the unbind request is correctly sent o Also closing the NamingEnumeration Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java?rev=945036&r1=945035&r2=945036&view=diff ============================================================================== --- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java (original) +++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java Mon May 17 09:10:16 2010 @@ -256,11 +256,11 @@ public class PagedSearchIT extends Abstr while ( true ) { loop++; + NamingEnumeration list = null; try { - NamingEnumeration list = - ctx.search( "dc=users,ou=system", "(cn=*)", controls ); + list = ctx.search( "dc=users,ou=system", "(cn=*)", controls ); while ( list.hasMore() ) { @@ -270,10 +270,17 @@ public class PagedSearchIT extends Abstr } catch ( SizeLimitExceededException e ) { - // e.printStackTrace(); hasSizeLimitException = true; break; } + finally + { + // Close the NamingEnumeration + if ( list != null ) + { + list.close(); + } + } // Now read the next ones javax.naming.ldap.Control[] responseControls = ((LdapContext)ctx).getResponseControls(); @@ -298,6 +305,9 @@ public class PagedSearchIT extends Abstr assertEquals( expectedException, hasSizeLimitException ); assertEquals( expectedLoop, loop ); checkResults( results, expectedNbEntries ); + + // And close the connection + closeConnection( ctx ); } @@ -312,6 +322,26 @@ public class PagedSearchIT extends Abstr /** + * Close a connection, and wait a bit to be sure it's done + */ + private void closeConnection( DirContext ctx ) throws NamingException + { + if ( ctx != null ) + { + ctx.close(); + + try + { + Thread.sleep(10); + } + catch ( Exception e ) + { + } + } + } + + + /** * Admin = yes
* SL = none
* RL = none