You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by el...@apache.org on 2013/04/29 08:05:33 UTC
svn commit: r1476900 -
/labs/mavibot/trunk/mavibot/src/test/java/org/apache/mavibot/btree/BTreeConfigurationTest.java
Author: elecharny
Date: Mon Apr 29 06:05:33 2013
New Revision: 1476900
URL: http://svn.apache.org/r1476900
Log:
Fixed a test error when it was ran more than once. We were trying to delete the mavibot file, when the created file was mavibot.db
Modified:
labs/mavibot/trunk/mavibot/src/test/java/org/apache/mavibot/btree/BTreeConfigurationTest.java
Modified: labs/mavibot/trunk/mavibot/src/test/java/org/apache/mavibot/btree/BTreeConfigurationTest.java
URL: http://svn.apache.org/viewvc/labs/mavibot/trunk/mavibot/src/test/java/org/apache/mavibot/btree/BTreeConfigurationTest.java?rev=1476900&r1=1476899&r2=1476900&view=diff
==============================================================================
--- labs/mavibot/trunk/mavibot/src/test/java/org/apache/mavibot/btree/BTreeConfigurationTest.java (original)
+++ labs/mavibot/trunk/mavibot/src/test/java/org/apache/mavibot/btree/BTreeConfigurationTest.java Mon Apr 29 06:05:33 2013
@@ -118,26 +118,47 @@ public class BTreeConfigurationTest
config.setPageSize( 32 );
config.setSerializers( new IntSerializer(), new StringSerializer() );
- // Create the BTree
- BTree<Integer, String> btree = new BTree<Integer, String>( config );
-
- // Inject the values
- for ( int value : sortedValues )
+ try
{
- String strValue = "V" + value;
+ // Create the BTree
+ BTree<Integer, String> btree = new BTree<Integer, String>( config );
- btree.insert( value, strValue );
- }
+ // Inject the values
+ for ( int value : sortedValues )
+ {
+ String strValue = "V" + value;
- // Check that the tree contains all the values
- for ( int key : sortedValues )
- {
- String value = btree.get( key );
+ btree.insert( value, strValue );
+ }
+
+ // Check that the tree contains all the values
+ for ( int key : sortedValues )
+ {
+ String value = btree.get( key );
+
+ assertNotNull( value );
+ }
- assertNotNull( value );
+ btree.close();
}
+ finally
+ {
+ // Erase the mavibot file now
+ File mavibotFile = new File( "", "mavibot" );
+
+ if ( mavibotFile.exists() )
+ {
+ mavibotFile.delete();
+ }
- btree.close();
+ // Erase the journal too
+ File mavibotJournal = new File( "", "mavibot.log" );
+
+ if ( mavibotJournal.exists() )
+ {
+ mavibotJournal.delete();
+ }
+ }
}
@@ -200,7 +221,7 @@ public class BTreeConfigurationTest
finally
{
// Erase the mavibot file now
- File mavibotFile = new File( parent, "mavibot" );
+ File mavibotFile = new File( parent, "mavibot.db" );
if ( mavibotFile.exists() )
{
@@ -208,7 +229,7 @@ public class BTreeConfigurationTest
}
// Erase the journal too
- File mavibotJournal = new File( parent, "mavibot.log" );
+ File mavibotJournal = new File( parent, "mavibot.db.log" );
if ( mavibotJournal.exists() )
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org