directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1309845 - in /directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree: AvlTreeCursorTest.java AvlTreeMapNoDupsCursorTest.java AvlTreeMarshallerTest.java
Date Thu, 05 Apr 2012 13:29:36 GMT
Author: elecharny
Date: Thu Apr  5 13:29:36 2012
New Revision: 1309845

URL: http://svn.apache.org/viewvc?rev=1309845&view=rev
Log:
Added some cursor.close() calls

Modified:
    directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
    directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java
    directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java

Modified: directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java?rev=1309845&r1=1309844&r2=1309845&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeCursorTest.java
Thu Apr  5 13:29:36 2012
@@ -185,6 +185,8 @@ public class AvlTreeCursorTest
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
         assertEquals( 7, ( int ) cursor.get() );
+        
+        cursor.close();
     }
 
 
@@ -383,6 +385,7 @@ public class AvlTreeCursorTest
         cursor.before( 2 );
         assertFalse( cursor.previous() );
         assertFalse( cursor.available() );
+        cursor.close();
     }
 
     class IntegerComparator implements Comparator<Integer>

Modified: directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java?rev=1309845&r1=1309844&r2=1309845&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsCursorTest.java
Thu Apr  5 13:29:36 2012
@@ -30,6 +30,7 @@ import java.util.Comparator;
 
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -64,6 +65,13 @@ public class AvlTreeMapNoDupsCursorTest
 
         cursor = new AvlSingletonOrOrderedSetCursor<Integer, Integer>( tree );
     }
+    
+    
+    @After
+    public void cleanup() throws Exception
+    {
+        cursor.close();
+    }
 
 
     @Test
@@ -105,9 +113,6 @@ public class AvlTreeMapNoDupsCursorTest
 
         cursor.after( new Tuple<Integer, SingletonOrOrderedSet<Integer>>( 3,
null ) );
         assertFalse( cursor.available() );
-
-        cursor.close();
-        assertTrue( cursor.isClosed() );
     }
 
 
@@ -480,5 +485,6 @@ public class AvlTreeMapNoDupsCursorTest
         assertEquals( 10, valCursor.get().intValue() );
 
         assertFalse( valCursor.next() );
+        valCursor.close();
     }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java?rev=1309845&r1=1309844&r2=1309845&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/test/java/org/apache/directory/server/core/avltree/AvlTreeMarshallerTest.java
Thu Apr  5 13:29:36 2012
@@ -299,6 +299,8 @@ public class AvlTreeMarshallerTest
             assertEquals( ii, ( int ) cursor.get() );
             cursor.next();
         }
+        
+        cursor.close();
     }
 
 
@@ -336,6 +338,8 @@ public class AvlTreeMarshallerTest
         // this marshaller fails to preserve last node reference
         assertNotNull( deserialized.getLast() );
         assertEquals( 99, ( int ) deserialized.getLast().getKey() );
+        
+        cursor.close();
     }
 
 
@@ -370,6 +374,8 @@ public class AvlTreeMarshallerTest
             assertEquals( ii, ( int ) cursor.get().intValue );
             cursor.next();
         }
+        
+        cursor.close();
     }
 
     static class Bar implements Serializable



Mime
View raw message