directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1551489 - /directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java
Date Tue, 17 Dec 2013 08:55:03 GMT
Author: elecharny
Date: Tue Dec 17 08:55:02 2013
New Revision: 1551489

URL: http://svn.apache.org/r1551489
Log:
Closing all the BTrees

Modified:
    directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java

Modified: directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java
URL: http://svn.apache.org/viewvc/directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java?rev=1551489&r1=1551488&r2=1551489&view=diff
==============================================================================
--- directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java
(original)
+++ directory/mavibot/trunk/mavibot/src/test/java/org/apache/directory/mavibot/btree/InMemoryBTreeDuplicateKeyTest.java
Tue Dec 17 08:55:02 2013
@@ -66,7 +66,6 @@ public class InMemoryBTreeDuplicateKeyTe
         assertEquals( null, t.getValue() );
 
         cursor.close();
-        
         btree.close();
     }
 
@@ -195,6 +194,7 @@ public class InMemoryBTreeDuplicateKeyTe
         assertFalse( btree.contains( null, 0 ) );
         assertFalse( btree.contains( 0, null ) );
         assertFalse( btree.contains( null, null ) );
+        
         btree.close();
     }
 
@@ -230,6 +230,7 @@ public class InMemoryBTreeDuplicateKeyTe
 
         t = btree.delete( 1, 2 );
         assertNull( t );
+        
         btree.close();
     }
 
@@ -246,6 +247,7 @@ public class InMemoryBTreeDuplicateKeyTe
         BTree<String, String> btree = new InMemoryBTree<String, String>( config
);
 
         int i = 7;
+        
         for ( char ch = 'a'; ch <= 'z'; ch++ )
         {
             for ( int k = 0; k < i; k++ )
@@ -290,6 +292,7 @@ public class InMemoryBTreeDuplicateKeyTe
         }
 
         assertEquals( ( 'a' - 1 ), ch );
+        
         cursor.close();
         btree.close();
     }
@@ -379,6 +382,7 @@ public class InMemoryBTreeDuplicateKeyTe
         }
         
         assertEquals( 25, i );
+        
         btree.close();
     }
 
@@ -418,8 +422,14 @@ public class InMemoryBTreeDuplicateKeyTe
         assertFalse( cursor.hasNext() );
         
         // make sure it throws NoSuchElementException
-        cursor.next();
-        btree.close();
+        try
+        {
+            cursor.next();
+        }
+        finally
+        {
+            btree.close();
+        }
     }
 
 
@@ -517,9 +527,16 @@ public class InMemoryBTreeDuplicateKeyTe
         cursor = btree.browse();
         cursor.beforeFirst();
         assertFalse( cursor.hasPrev() );
+        
         // make sure it throws NoSuchElementException
-        cursor.prev();
-        btree.close();
+        try
+        {
+            cursor.prev();
+        }
+        finally
+        {
+            btree.close();
+        }
     }
 
 
@@ -598,6 +615,7 @@ public class InMemoryBTreeDuplicateKeyTe
         
         assertEquals( Integer.valueOf( 0 ), tuple.getKey() );
         assertEquals( Integer.valueOf( 0 ), tuple.getValue() );
+        
         cursor.close();
         btree.close();
     }
@@ -638,8 +656,8 @@ public class InMemoryBTreeDuplicateKeyTe
         tuple = cursor.next();
         assertEquals( Integer.valueOf( 4 ), tuple.getKey() );
         assertEquals( Integer.valueOf( 4 ), tuple.getValue() );
+        
         cursor.close();
-
         btree.close();
     }
 



Mime
View raw message