directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r642078 - /directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmBrowserBugTest.java
Date Fri, 28 Mar 2008 03:37:53 GMT
Author: akarasulu
Date: Thu Mar 27 20:37:53 2008
New Revision: 642078

URL: http://svn.apache.org/viewvc?rev=642078&view=rev
Log:
properly cleanup

Modified:
    directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmBrowserBugTest.java

Modified: directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmBrowserBugTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmBrowserBugTest.java?rev=642078&r1=642077&r2=642078&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmBrowserBugTest.java
(original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmBrowserBugTest.java
Thu Mar 27 20:37:53 2008
@@ -25,9 +25,11 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.Ignore;
+import org.junit.After;
 
 import java.util.Comparator;
 import java.io.File;
+import java.io.IOException;
 
 import jdbm.RecordManager;
 import jdbm.btree.BTree;
@@ -52,6 +54,8 @@
     BTree bt;
     private static final String TEST_OUTPUT_PATH = "test.output.path";
     private static final Logger LOG = LoggerFactory.getLogger( JdbmBrowserBugTest.class.getSimpleName()
);
+    private File dbFile = null;
+    private RecordManager recman = null;
 
     @Before
     public void createTree() throws Exception
@@ -70,10 +74,24 @@
             tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
         }
 
-        File dbFile = File.createTempFile( getClass().getSimpleName(), "db", tmpDir );
+        dbFile = File.createTempFile( getClass().getSimpleName(), "db", tmpDir );
         RecordManager recman = new BaseRecordManager( dbFile.getAbsolutePath() );
         bt = BTree.createInstance( recman, new IntegerComparator(), new IntegerSerializer(),
new IntegerSerializer() );
         LOG.debug( "created new BTree" );
+    }
+
+
+    @After
+    public void cleanup() throws IOException
+    {
+        recman.close();
+        recman = null;
+        bt = null;
+        if ( dbFile.exists() )
+        {
+            dbFile.delete();
+        }
+        dbFile = null;
     }
 
 



Mime
View raw message