You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2008/07/25 02:09:33 UTC
svn commit: r679621 -
/directory/apacheds/branches/bigbang/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
Author: elecharny
Date: Thu Jul 24 17:09:32 2008
New Revision: 679621
URL: http://svn.apache.org/viewvc?rev=679621&view=rev
Log:
Modify the code to remove temporary files created during the test
Modified:
directory/apacheds/branches/bigbang/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
Modified: directory/apacheds/branches/bigbang/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java?rev=679621&r1=679620&r2=679621&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java (original)
+++ directory/apacheds/branches/bigbang/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java Thu Jul 24 17:09:32 2008
@@ -65,12 +65,15 @@
public void createTable() throws Exception
{
File tmpDir = null;
+
if ( System.getProperty( TEST_OUTPUT_PATH, null ) != null )
{
tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
+ tmpDir.deleteOnExit();
}
dbFile = File.createTempFile( getClass().getSimpleName(), "db", tmpDir );
+ dbFile.deleteOnExit();
recman = new BaseRecordManager( dbFile.getAbsolutePath() );
// gosh this is a terrible use of a global static variable
@@ -86,13 +89,16 @@
@After
- public void destryTable() throws Exception
+ public void destroyTable() throws Exception
{
table.close();
table = null;
recman.close();
recman = null;
- dbFile.deleteOnExit();
+ String fileToDelete = dbFile.getAbsolutePath();
+ new File( fileToDelete ).delete();
+ new File( fileToDelete + ".db" ).delete();
+ new File( fileToDelete + ".lg" ).delete();
dbFile = null;
}
@@ -100,13 +106,6 @@
@Test( expected=IllegalStateException.class )
public void testUsingNoDuplicates() throws Exception
{
- File tmpDir = null;
- if ( System.getProperty( TEST_OUTPUT_PATH, null ) != null )
- {
- tmpDir = new File( System.getProperty( TEST_OUTPUT_PATH ) );
- }
-
- dbFile = File.createTempFile( getClass().getSimpleName(), "db", tmpDir );
recman = new BaseRecordManager( dbFile.getAbsolutePath() );
// gosh this is a terrible use of a global static variable