From: Bryan T. <tho...@us...> - 2007-02-22 16:59:42
|
Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/scaleup In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16247/src/test/com/bigdata/scaleup Modified Files: TestMetadataIndex.java TestPartitionedJournal.java Log Message: Lots of little changes to get the test suites to use temporary files and to remove them when tests complete. At present, this only helps if the test succeeds. You need to do a try {} finally {} to get the tests to remove their files on failure. Index: TestMetadataIndex.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/scaleup/TestMetadataIndex.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestMetadataIndex.java 17 Feb 2007 21:34:21 -0000 1.6 --- TestMetadataIndex.java 22 Feb 2007 16:59:35 -0000 1.7 *************** *** 74,78 **** import com.bigdata.rawstore.IRawStore; import com.bigdata.rawstore.SimpleMemoryRawStore; - import com.bigdata.scaleup.MetadataIndex.MetadataIndexMetadata; /** --- 74,77 ---- *************** *** 277,280 **** --- 276,281 ---- assertEquals(part1,md.get(key1)); assertEquals(part2,md.get(key2)); + + store.closeAndDelete(); } *************** *** 672,689 **** final Properties properties = new Properties(); - final File journalFile = new File(getName()+".jnl"); - - if(journalFile.exists() && !journalFile.delete() ) { - - fail("Could not delete file: "+journalFile.getAbsoluteFile()); - - } - properties.setProperty(Options.BUFFER_MODE, BufferMode.Disk.toString()); ! properties.setProperty(Options.FILE,journalFile.toString()); properties.setProperty(Options.DELETE_ON_CLOSE,"true"); properties.setProperty(Options.SEGMENT,"0"); --- 673,684 ---- final Properties properties = new Properties(); properties.setProperty(Options.BUFFER_MODE, BufferMode.Disk.toString()); ! properties.setProperty(Options.CREATE_TEMP_FILE,"true"); properties.setProperty(Options.DELETE_ON_CLOSE,"true"); + properties.setProperty(Options.DELETE_ON_EXIT,"true"); + properties.setProperty(Options.SEGMENT,"0"); *************** *** 963,969 **** System.err.println("End of stress test: ntrial="+ntrials+", nops="+nops); - // delete the journal file afterwards. - if(journalFile.exists()) journalFile.delete(); - } --- 958,961 ---- Index: TestPartitionedJournal.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/scaleup/TestPartitionedJournal.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestPartitionedJournal.java 13 Feb 2007 23:01:12 -0000 1.3 --- TestPartitionedJournal.java 22 Feb 2007 16:59:35 -0000 1.4 *************** *** 66,69 **** --- 66,72 ---- /** + * @todo update how we create and get rid of the temporary files created by the + * tests. + * * @todo rather than writing this test suite directly, we mostly want to apply * the existing proxy test suites for {@link Journal}. *************** *** 105,109 **** protected void deleteTestFiles() { ! NameAndExtensionFilter filter = new NameAndExtensionFilter(getName(),PartitionedJournal.JNL); File[] files = filter.getFiles(); --- 108,112 ---- protected void deleteTestFiles() { ! NameAndExtensionFilter filter = new NameAndExtensionFilter(getName(),Options.JNL); File[] files = filter.getFiles(); |