directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1221733 - in /directory/apacheds/branches/apacheds-txns: core-integ/src/test/java/org/apache/directory/server/core/authz/ core-integ/src/test/java/org/apache/directory/server/core/collective/ core-integ/src/test/java/org/apache/directory/s...
Date Wed, 21 Dec 2011 14:01:12 GMT
Author: elecharny
Date: Wed Dec 21 14:01:11 2011
New Revision: 1221733

URL: http://svn.apache.org/viewvc?rev=1221733&view=rev
Log:
Call close() for every cursor we get doing a search

Modified:
    directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
    directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
    directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
    directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
    directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
    directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
    directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
    directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchRequestReturningAttributesTest.java
    directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java
    directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java
    directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java

Modified: directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/authz/SearchAuthorizationIT.java
Wed Dec 21 14:01:11 2011
@@ -320,6 +320,8 @@ public class SearchAuthorizationIT exten
             counter++;
         }
 
+        cursor.close();
+
         recursivelyDelete( base );
 
         return counter == resultSetSz;
@@ -962,16 +964,16 @@ public class SearchAuthorizationIT exten
     {
         LdapConnection userCtx = getConnectionAs( new Dn( "uid=" + uid + ",ou=users,ou=system"
), password );
         Entry result = null;
-        EntryCursor list = null;
+        EntryCursor cursor = null;
 
-        list = userCtx.search( dn.getName(), "(objectClass=*)", SearchScope.OBJECT, "*" );
+        cursor = userCtx.search( dn.getName(), "(objectClass=*)", SearchScope.OBJECT, "*"
);
         
-        if ( list.next() )
+        if ( cursor.next() )
         {
-            result = list.get();
+            result = cursor.get();
         }
 
-        list.close();
+        cursor.close();
 
         return result;
     }

Modified: directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/collective/CollectiveAttributeServiceIT.java
Wed Dec 21 14:01:11 2011
@@ -143,6 +143,8 @@ public class CollectiveAttributeServiceI
 
             resultMap.put( entry.getDn().getName(), entry );
         }
+        
+        cursor.close();
 
         return resultMap;
     }
@@ -160,6 +162,8 @@ public class CollectiveAttributeServiceI
             resultMap.put( entry.getDn().getName(), entry );
         }
 
+        cursor.close();
+
         return resultMap;
     }
 
@@ -178,6 +182,8 @@ public class CollectiveAttributeServiceI
             resultMap.put( entry.getDn().getName(), entry );
         }
 
+        cursor.close();
+
         return resultMap;
     }
 
@@ -345,6 +351,8 @@ public class CollectiveAttributeServiceI
             break;
         }
         
+        cursor.close();
+
         assertTrue( found );
     }
 
@@ -384,6 +392,8 @@ public class CollectiveAttributeServiceI
             assertTrue( entry.contains( "c-ou", "configuration" ) );
         }
 
+        responses.close();
+
         // ------------------------------------------------------------------
         // test an entry that should show the collective attribute c-ou,
         // but restrict returned attributes to c-ou and c-st

Modified: directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/exception/ExceptionServiceIT.java
Wed Dec 21 14:01:11 2011
@@ -113,9 +113,19 @@ public class ExceptionServiceIT extends 
     @Test
     public void testFailSearchNoSuchObject() throws Exception
     {
-        EntryCursor cursor = getAdminConnection( getService() ).search( "ou=blah", "(objectClass=*)",
-            SearchScope.ONELEVEL, "*" );
-        assertFalse( cursor.next() );
+        EntryCursor cursor = null;
+
+        try
+        {
+            cursor = getAdminConnection( getService() ).search( "ou=blah", "(objectClass=*)",
+                SearchScope.ONELEVEL, "*" );
+            assertFalse( cursor.next() );
+        	cursor.close();
+        }
+        catch( Exception e )
+        {
+            cursor.close( e );
+        }
     }
 
 
@@ -128,10 +138,19 @@ public class ExceptionServiceIT extends 
     @Test
     public void testSearchControl() throws Exception
     {
-        EntryCursor cursor = getAdminConnection( getService() ).search( "ou=users,ou=system",
"(objectClass=*)",
-            SearchScope.ONELEVEL, "*" );
-
-        assertFalse( cursor.next() );
+    	EntryCursor cursor = null;
+    	
+    	try
+    	{
+    		cursor = getAdminConnection( getService() ).search( "ou=users,ou=system", "(objectClass=*)",
SearchScope.ONELEVEL, "*" );
+
+    		assertFalse( cursor.next() );
+    		cursor.close();
+    	}
+    	catch ( Exception e )
+    	{
+    		cursor.close( e );
+    	}
     }
 
 

Modified: directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operational/OperationalAttributeServiceIT.java
Wed Dec 21 14:01:11 2011
@@ -190,24 +190,27 @@ public class OperationalAttributeService
     @Test
     public void testSystemContextRoot() throws Exception
     {
-        EntryCursor responses = connection
-            .search( "ou=system", "(objectClass=*)", SearchScope.OBJECT, "*" );
+        EntryCursor responses = connection.search( "ou=system", "(objectClass=*)", SearchScope.OBJECT,
"*" );
         responses.next();
         Entry entry = responses.get();
 
         // test to make sure op attribute do not occur - this is the control
         assertNull( entry.get( "creatorsName" ) );
         assertNull( entry.get( "createTimestamp" ) );
+        
+        responses.close();
 
         // now we ask for all the op attributes and check to get them
         responses = connection.search( "ou=system", "(objectClass=*)", SearchScope.OBJECT,
"creatorsName",
             "createTimestamp" );
         responses.next();
         entry = responses.get();
+        
+        responses.close();
 
         assertNotNull( entry.get( "creatorsName" ) );
         assertNotNull( entry.get( "createTimestamp" ) );
-
+        
         // We should not have any other operational Attribute
         assertNull( entry.get( "entryUuid" ) );
     }

Modified: directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/operations/search/SearchWithIndicesIT.java
Wed Dec 21 14:01:11 2011
@@ -131,6 +131,8 @@ public class SearchWithIndicesIT extends
         {
             results.add( cursor.get().getDn().getName() );
         }
+        
+        cursor.close();
 
         return results;
     }

Modified: directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-integ/src/test/java/org/apache/directory/server/core/subtree/SubentryServiceIT.java
Wed Dec 21 14:01:11 2011
@@ -321,6 +321,8 @@ public class SubentryServiceIT extends A
 
             results.put( entry.getDn().getName(), entry );
         }
+        
+        responses.close();
 
         return results;
     }

Modified: directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
(original)
+++ directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/LdapConnectionTest.java
Wed Dec 21 14:01:11 2011
@@ -197,6 +197,7 @@ public class LdapConnectionTest extends 
             Entry result = cursor.get();
             map.put( result.getDn().getName(), result );
         }
+        
         cursor.close();
 
         assertEquals( 2, map.size() );

Modified: directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchRequestReturningAttributesTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchRequestReturningAttributesTest.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchRequestReturningAttributesTest.java
(original)
+++ directory/apacheds/branches/apacheds-txns/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/search/SearchRequestReturningAttributesTest.java
Wed Dec 21 14:01:11 2011
@@ -101,6 +101,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -136,6 +137,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -167,6 +169,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -200,6 +203,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -269,6 +273,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -301,6 +306,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -333,6 +339,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -365,6 +372,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -396,6 +404,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -424,6 +433,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -453,6 +463,7 @@ public class SearchRequestReturningAttri
             assertNotNull( entry );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );
@@ -492,6 +503,7 @@ public class SearchRequestReturningAttri
             assertNotNull( response );
             count++;
         }
+        
         cursor.close();
 
         assertEquals( 1, count );

Modified: directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddAliasIT.java
Wed Dec 21 14:01:11 2011
@@ -226,6 +226,8 @@ public class AddAliasIT extends Abstract
             {
                 System.out.println( cursor.get().getDn() );
             }
+            
+            cursor.close();
         }
         finally
         {

Modified: directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java
Wed Dec 21 14:01:11 2011
@@ -107,6 +107,7 @@ public class AddingEntriesWithSpecialCha
 
         assertTrue( "entry found", entryFound );
 
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }
@@ -145,6 +146,7 @@ public class AddingEntriesWithSpecialCha
 
         assertTrue( "entry found", entryFound );
 
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }
@@ -179,6 +181,7 @@ public class AddingEntriesWithSpecialCha
 
         assertTrue( "entry found", entryFound );
 
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }
@@ -212,6 +215,8 @@ public class AddingEntriesWithSpecialCha
         }
 
         assertTrue( "no entry found", entryFound );
+
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }
@@ -250,6 +255,7 @@ public class AddingEntriesWithSpecialCha
 
         assertTrue( "entry found", entryFound );
 
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }
@@ -288,6 +294,7 @@ public class AddingEntriesWithSpecialCha
 
         assertTrue( "entry found", entryFound );
 
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }
@@ -326,6 +333,7 @@ public class AddingEntriesWithSpecialCha
 
         assertTrue( "entry found", entryFound );
 
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }
@@ -363,6 +371,7 @@ public class AddingEntriesWithSpecialCha
 
         assertTrue( "entry found", entryFound );
 
+        cursor.close();
         connection.delete( dn );
         connection.close();
     }

Modified: directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=1221733&r1=1221732&r2=1221733&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
(original)
+++ directory/apacheds/branches/apacheds-txns/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
Wed Dec 21 14:01:11 2011
@@ -1633,6 +1633,8 @@ public class SearchIT extends AbstractLd
                     asyncCnx.abandon( 1002 );
                 }
             }
+            
+            cursor.close();
 
             assertEquals( 10, count );
         }
@@ -1664,6 +1666,8 @@ public class SearchIT extends AbstractLd
         SearchResult entry = result.next();
 
         assertEquals( "Kim Wilde", entry.getAttributes().get( "cn" ).get() );
+        
+        result.close();
     }
 
 
@@ -1688,6 +1692,8 @@ public class SearchIT extends AbstractLd
         }
 
         assertEquals( sizeLimit, i );
+        
+        cursor.close();
         connection.close();
     }
 
@@ -1722,6 +1728,8 @@ public class SearchIT extends AbstractLd
         }
 
         assertTrue( newCount < count );
+        
+        cursor.close();
         connection.close();
     }
 



Mime
View raw message