Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/journal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16247/src/test/com/bigdata/journal Modified Files: TestTxRunState.java TestDiskJournal.java AbstractMROWTestCase.java AbstractBufferStrategyTestCase.java ProxyTestCase.java AbstractBTreeWithJournalTestCase.java TestCommitHistory.java ComparisonTestDriver.java AbstractRestartSafeTestCase.java TestMappedJournal.java TestConflictResolution.java TestDirectJournal.java AbstractTestCase.java TestTx.java TestAll.java TestReadOnlyTx.java BenchmarkJournalWriteRate.java TestNamedIndices.java StressTestConcurrent.java TestTxJournalProtocol.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: AbstractBTreeWithJournalTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/AbstractBTreeWithJournalTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractBTreeWithJournalTestCase.java 21 Feb 2007 20:17:20 -0000 1.1 --- AbstractBTreeWithJournalTestCase.java 22 Feb 2007 16:59:34 -0000 1.2 *************** *** 81,84 **** --- 81,100 ---- properties.setProperty(Options.BUFFER_MODE, getBufferMode().toString() ); + /* + * Use a temporary file for the test. Such files are always deleted when + * the journal is closed or the VM exits. + * + * Note: Your unit test must close the store for delete to work. + */ + 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"); + + // // Note: also deletes the file before it is used. + // properties.setProperty(Options.FILE, AbstractTestCase + // .getTestJournalFile(getName(), properties)); + } *************** *** 101,107 **** public BTree getBTree(int branchingFactor) { ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); BTree btree = new BTree(journal, branchingFactor, --- 117,121 ---- public BTree getBTree(int branchingFactor) { ! Journal journal = new Journal(getProperties()); BTree btree = new BTree(journal, branchingFactor, *************** *** 112,124 **** } ! /* ! * @todo try large branching factors, but limit the total #of keys inserted ! * or the running time will be too long (I am using an expontential #of keys ! * by default). ! * ! * Note: For sequential keys, m=128 causes the journal to exceed its initial ! * extent. */ ! int[] branchingFactors = new int[]{3,4,5,10};//,20,64};//,128};//,512}; /** --- 126,137 ---- } ! /** ! * The branching factors that will be used in the stress tests. The larger ! * the branching factor, the longer the run for these tests. The very small ! * branching factors (3, 4) test the btree code more fully since they will ! * exercise the fence posts on the invariants for nodes and leaves on pretty ! * much each mutation. */ ! int[] branchingFactors = new int[]{3,4};//,5,10,20,64};//,128};//,512}; /** *************** *** 132,143 **** int m = branchingFactors[i]; ! doSplitWithIncreasingKeySequence( getBTree(m), m, m ); ! doSplitWithIncreasingKeySequence( getBTree(m), m, m*m ); ! doSplitWithIncreasingKeySequence( getBTree(m), m, m*m*m ); ! doSplitWithIncreasingKeySequence( getBTree(m), m, m*m*m*m ); } --- 145,188 ---- int m = branchingFactors[i]; ! { ! ! BTree btree = getBTree(m); ! ! doSplitWithIncreasingKeySequence( btree, m, m ); ! ! btree.getStore().closeAndDelete(); ! ! } ! { ! BTree btree = getBTree(m); ! ! doSplitWithIncreasingKeySequence( btree, m, m*m ); ! ! btree.getStore().closeAndDelete(); ! ! } ! ! { ! BTree btree = getBTree(m); ! ! doSplitWithIncreasingKeySequence( btree, m, m*m*m ); ! ! btree.getStore().closeAndDelete(); ! ! } ! ! { + BTree btree = getBTree(m); + + doSplitWithIncreasingKeySequence( btree, m, m*m*m*m ); + + btree.getStore().closeAndDelete(); + + } + } *************** *** 153,164 **** int m = branchingFactors[i]; ! doSplitWithDecreasingKeySequence( getBTree(m), m, m ); ! doSplitWithDecreasingKeySequence( getBTree(m), m, m*m ); ! doSplitWithDecreasingKeySequence( getBTree(m), m, m*m*m ); ! doSplitWithDecreasingKeySequence( getBTree(m), m, m*m*m*m ); } --- 198,241 ---- int m = branchingFactors[i]; + + { + + BTree btree = getBTree(m); + + doSplitWithDecreasingKeySequence( btree, m, m ); + + btree.getStore().closeAndDelete(); + + } ! { ! ! BTree btree = getBTree(m); ! ! doSplitWithDecreasingKeySequence( btree, m, m*m ); ! ! btree.getStore().closeAndDelete(); ! ! } ! { ! BTree btree = getBTree(m); ! ! doSplitWithDecreasingKeySequence( btree, m, m*m*m ); ! ! btree.getStore().closeAndDelete(); ! ! } ! ! { ! BTree btree = getBTree(m); ! ! doSplitWithDecreasingKeySequence( btree, m, m*m*m*m ); ! ! btree.getStore().closeAndDelete(); ! ! } } *************** *** 176,189 **** int m = branchingFactors[i]; ! doSplitWithRandomDenseKeySequence( getBTree(m), m, m ); ! doSplitWithRandomDenseKeySequence( getBTree(m), m, m*m ); ! doSplitWithRandomDenseKeySequence( getBTree(m), m, m*m*m ); ! // This case overflows the default journal extent. ! // doSplitWithRandomKeySequence( getBTree(m), m, m*m*m*m ); ! } } --- 253,287 ---- int m = branchingFactors[i]; ! { ! BTree btree = getBTree(m); ! ! doSplitWithRandomDenseKeySequence( btree, m, m ); ! ! btree.getStore().closeAndDelete(); ! ! } ! ! { ! ! BTree btree = getBTree(m); ! ! doSplitWithRandomDenseKeySequence( btree, m, m*m ); ! ! btree.getStore().closeAndDelete(); ! ! } ! { ! BTree btree = getBTree(m); ! doSplitWithRandomDenseKeySequence( btree, m, m * m * m); ! ! btree.getStore().closeAndDelete(); ! ! } ! ! } } Index: TestConflictResolution.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestConflictResolution.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestConflictResolution.java 19 Feb 2007 19:00:18 -0000 1.3 --- TestConflictResolution.java 22 Feb 2007 16:59:34 -0000 1.4 *************** *** 127,133 **** public void test_writeWriteConflict_correctDetection() { ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 127,131 ---- public void test_writeWriteConflict_correctDetection() { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 185,189 **** } ! journal.close(); } --- 183,187 ---- } ! journal.closeAndDelete(); } *************** *** 201,207 **** public void test_writeWriteConflict_conflictIsResolved() { ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 199,203 ---- public void test_writeWriteConflict_conflictIsResolved() { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 260,264 **** assertEquals(v1c,(byte[])journal.getIndex(name).lookup(k1)); ! journal.close(); } --- 256,260 ---- assertEquals(v1c,(byte[])journal.getIndex(name).lookup(k1)); ! journal.closeAndDelete(); } Index: TestTxRunState.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTxRunState.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestTxRunState.java 19 Feb 2007 19:00:18 -0000 1.3 --- TestTxRunState.java 22 Feb 2007 16:59:34 -0000 1.4 *************** *** 89,133 **** public void test_runStateMachine_activeAbort() throws IOException { ! final Properties properties = getProperties(); ! try { ! ! Journal journal = new Journal(properties); ! long ts0 = 0; ! ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0); ! assertEquals(ts0,tx0.getStartTimestamp()); ! ! assertTrue( tx0.isActive() ); ! assertFalse( tx0.isPrepared() ); ! assertFalse( tx0.isAborted() ); ! assertFalse( tx0.isCommitted() ); ! assertFalse( tx0.isComplete() ); ! ! assertTrue(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! ! tx0.abort(); ! assertFalse( tx0.isActive() ); ! assertFalse( tx0.isPrepared() ); ! assertTrue( tx0.isAborted() ); ! assertFalse( tx0.isCommitted() ); ! assertTrue( tx0.isComplete() ); ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.close(); ! } finally { ! deleteTestJournalFile(); ! ! } } --- 89,123 ---- public void test_runStateMachine_activeAbort() throws IOException { ! Journal journal = new Journal(getProperties()); ! long ts0 = 0; ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal, ts0, false); ! assertEquals(ts0, tx0.getStartTimestamp()); ! assertTrue(tx0.isActive()); ! assertFalse(tx0.isPrepared()); ! assertFalse(tx0.isAborted()); ! assertFalse(tx0.isCommitted()); ! assertFalse(tx0.isComplete()); ! assertTrue(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! tx0.abort(); ! assertFalse(tx0.isActive()); ! assertFalse(tx0.isPrepared()); ! assertTrue(tx0.isAborted()); ! assertFalse(tx0.isCommitted()); ! assertTrue(tx0.isComplete()); ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! ! journal.closeAndDelete(); } *************** *** 138,146 **** public void test_runStateMachine_activePrepareAbort() throws IOException { ! final Properties properties = getProperties(); ! ! try { ! ! Journal journal = new Journal(properties); long ts0 = 0; --- 128,132 ---- public void test_runStateMachine_activePrepareAbort() throws IOException { ! Journal journal = new Journal(getProperties()); long ts0 = 0; *************** *** 149,153 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0); assertEquals(ts0,tx0.getStartTimestamp()); --- 135,139 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0, false); assertEquals(ts0,tx0.getStartTimestamp()); *************** *** 183,193 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.close(); ! ! } finally { ! ! deleteTestJournalFile(); ! ! } } --- 169,173 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.closeAndDelete(); } *************** *** 198,206 **** public void test_runStateMachine_activePrepareCommit() throws IOException { ! final Properties properties = getProperties(); ! ! try { ! ! Journal journal = new Journal(properties); long ts0 = 0; --- 178,182 ---- public void test_runStateMachine_activePrepareCommit() throws IOException { ! Journal journal = new Journal(getProperties()); long ts0 = 0; *************** *** 209,213 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0); assertEquals(ts0,tx0.getStartTimestamp()); --- 185,189 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0, false); assertEquals(ts0,tx0.getStartTimestamp()); *************** *** 243,253 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.close(); ! ! } finally { ! ! deleteTestJournalFile(); ! ! } } --- 219,223 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.closeAndDelete(); } *************** *** 258,322 **** * not change the transaction run state. */ ! public void test_runStateMachine_activeAbortAbort_correctRejection() throws IOException { ! ! final Properties properties = getProperties(); ! ! try { ! ! Journal journal = new Journal(properties); ! long ts0 = 0; ! ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0); ! assertEquals(ts0,tx0.getStartTimestamp()); ! ! assertTrue( tx0.isActive() ); ! assertFalse( tx0.isPrepared() ); ! assertFalse( tx0.isAborted() ); ! assertFalse( tx0.isCommitted() ); ! assertFalse( tx0.isComplete() ); ! ! assertTrue(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! ! tx0.abort(); ! assertFalse( tx0.isActive() ); ! assertFalse( tx0.isPrepared() ); ! assertTrue( tx0.isAborted() ); ! assertFalse( tx0.isCommitted() ); ! assertTrue( tx0.isComplete() ); ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! try { ! tx0.abort(); ! fail("Expecting: "+IllegalStateException.class); ! } ! catch( IllegalStateException ex ) { ! System.err.println("Ignoring expected exception: "+ex); ! } ! assertFalse( tx0.isActive() ); ! assertFalse( tx0.isPrepared() ); ! assertTrue( tx0.isAborted() ); ! assertFalse( tx0.isCommitted() ); ! assertTrue( tx0.isComplete() ); ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.close(); ! } finally { ! deleteTestJournalFile(); ! } } --- 228,282 ---- * not change the transaction run state. */ ! public void test_runStateMachine_activeAbortAbort_correctRejection() ! throws IOException { ! Journal journal = new Journal(getProperties()); ! long ts0 = 0; ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal, ts0, false); ! assertEquals(ts0, tx0.getStartTimestamp()); ! assertTrue(tx0.isActive()); ! assertFalse(tx0.isPrepared()); ! assertFalse(tx0.isAborted()); ! assertFalse(tx0.isCommitted()); ! assertFalse(tx0.isComplete()); ! assertTrue(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! tx0.abort(); ! assertFalse(tx0.isActive()); ! assertFalse(tx0.isPrepared()); ! assertTrue(tx0.isAborted()); ! assertFalse(tx0.isCommitted()); ! assertTrue(tx0.isComplete()); ! assertFalse(journal.activeTx.containsKey(ts0)); ! assertFalse(journal.preparedTx.containsKey(ts0)); ! try { ! tx0.abort(); ! fail("Expecting: " + IllegalStateException.class); ! } catch (IllegalStateException ex) { ! System.err.println("Ignoring expected exception: " + ex); } + assertFalse(tx0.isActive()); + assertFalse(tx0.isPrepared()); + assertTrue(tx0.isAborted()); + assertFalse(tx0.isCommitted()); + assertTrue(tx0.isComplete()); + + assertFalse(journal.activeTx.containsKey(ts0)); + assertFalse(journal.preparedTx.containsKey(ts0)); + + journal.closeAndDelete(); + } *************** *** 328,336 **** public void test_runStateMachine_activePreparePrepare_correctRejection() throws IOException { ! final Properties properties = getProperties(); ! ! try { ! ! Journal journal = new Journal(properties); long ts0 = 0; --- 288,292 ---- public void test_runStateMachine_activePreparePrepare_correctRejection() throws IOException { ! Journal journal = new Journal(getProperties()); long ts0 = 0; *************** *** 339,343 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0); assertEquals(ts0,tx0.getStartTimestamp()); --- 295,299 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0,false); assertEquals(ts0,tx0.getStartTimestamp()); *************** *** 379,389 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.close(); ! ! } finally { ! ! deleteTestJournalFile(); ! ! } } --- 335,339 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.closeAndDelete(); } *************** *** 396,404 **** public void test_runStateMachine_activeCommit_correctRejection() throws IOException { ! final Properties properties = getProperties(); ! ! try { ! ! Journal journal = new Journal(properties); long ts0 = 0; --- 346,350 ---- public void test_runStateMachine_activeCommit_correctRejection() throws IOException { ! Journal journal = new Journal(getProperties()); long ts0 = 0; *************** *** 407,411 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0); assertEquals(ts0,tx0.getStartTimestamp()); --- 353,357 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! ITx tx0 = new Tx(journal,ts0,false); assertEquals(ts0,tx0.getStartTimestamp()); *************** *** 436,446 **** assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.close(); ! ! } finally { ! ! deleteTestJournalFile(); ! ! } } --- 382,386 ---- assertFalse(journal.preparedTx.containsKey(ts0)); ! journal.closeAndDelete(); } *************** *** 455,461 **** throws IOException { ! final Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 395,399 ---- throws IOException { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 531,535 **** assertNull(journal.getTx(tmp.getStartTimestamp())); ! journal.close(); } --- 469,473 ---- assertNull(journal.getTx(tmp.getStartTimestamp())); ! journal.closeAndDelete(); } Index: ProxyTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/ProxyTestCase.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProxyTestCase.java 26 Oct 2006 19:41:37 -0000 1.2 --- ProxyTestCase.java 22 Feb 2007 16:59:34 -0000 1.3 *************** *** 176,207 **** return getOurDelegate().getProperties(); } - - // public IObjectManager getObjectManager() { - // return getOurDelegate().getObjectManager(); - // } - // - // public void dropStore() { - // getOurDelegate().dropStore(); - // } - // - // public boolean isStoreOpen() { - // return getOurDelegate().isStoreOpen(); - // } - // - // public IObjectManager reopenStore() { - // return getOurDelegate().reopenStore(); - // } - // - // public IObjectManager openStore() { - // return getOurDelegate().openStore(); - // } - // - // public void closeStore() { - // getOurDelegate().closeStore(); - // } - // - // public IGeneric addGeneric() { - // return getObjectManager().makeObject(); - // } } --- 176,182 ---- return getOurDelegate().getProperties(); } + public Journal reopenStore(Journal store) { + return getOurDelegate().reopenStore(store); + } } Index: TestNamedIndices.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestNamedIndices.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestNamedIndices.java 8 Feb 2007 21:32:09 -0000 1.1 --- TestNamedIndices.java 22 Feb 2007 16:59:34 -0000 1.2 *************** *** 48,53 **** package com.bigdata.journal; - import java.util.Properties; - import com.bigdata.objndx.BTree; import com.bigdata.objndx.SimpleEntry; --- 48,51 ---- *************** *** 90,98 **** public void test_registerAndUse() { ! Properties properties = getProperties(); ! ! properties.setProperty(Options.DELETE_ON_CLOSE, "false"); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 88,92 ---- public void test_registerAndUse() { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 116,127 **** journal.commit(); - journal.close(); - if (journal.isStable()) { ! /* * re-open the journal and test restart safety. */ ! journal = new Journal(properties); btree = (BTree) journal.getIndex(name); --- 110,119 ---- journal.commit(); if (journal.isStable()) { ! /* * re-open the journal and test restart safety. */ ! journal = reopenStore(journal); btree = (BTree) journal.getIndex(name); *************** *** 131,138 **** assertEquals(v0, btree.lookup(k0)); - journal.close(); - } } --- 123,130 ---- assertEquals(v0, btree.lookup(k0)); } + journal.closeAndDelete(); + } Index: TestDiskJournal.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestDiskJournal.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestDiskJournal.java 21 Feb 2007 20:17:20 -0000 1.7 --- TestDiskJournal.java 22 Feb 2007 16:59:34 -0000 1.8 *************** *** 114,120 **** properties.setProperty(Options.BUFFER_MODE, BufferMode.Disk.toString()); ! properties.setProperty(Options.SEGMENT, "0"); ! properties.setProperty(Options.FILE,getTestJournalFile(properties)); return properties; --- 114,120 ---- properties.setProperty(Options.BUFFER_MODE, BufferMode.Disk.toString()); ! // properties.setProperty(Options.SEGMENT, "0"); ! // properties.setProperty(Options.FILE,getTestJournalFile(properties)); return properties; *************** *** 129,158 **** */ public void test_create_disk01() throws IOException { ! final Properties properties = getProperties(); ! try { ! ! Journal journal = new Journal(properties); ! ! DiskOnlyStrategy bufferStrategy = (DiskOnlyStrategy) journal._bufferStrategy; ! ! assertTrue("isStable",bufferStrategy.isStable()); ! assertFalse("isFullyBuffered",bufferStrategy.isFullyBuffered()); ! assertEquals(Options.FILE, properties.getProperty(Options.FILE), bufferStrategy.file.toString()); ! assertEquals(Options.INITIAL_EXTENT, Options.DEFAULT_INITIAL_EXTENT, ! bufferStrategy.getInitialExtent()); ! assertEquals(Options.MAXIMUM_EXTENT, Options.DEFAULT_MAXIMUM_EXTENT, ! bufferStrategy.getMaximumExtent()); ! assertNotNull("raf", bufferStrategy.raf); ! assertEquals(Options.BUFFER_MODE, BufferMode.Disk, bufferStrategy.getBufferMode()); ! journal.close(); ! ! } finally { ! ! deleteTestJournalFile(); ! ! } } --- 129,152 ---- */ public void test_create_disk01() throws IOException { ! final Properties properties = getProperties(); ! Journal journal = new Journal(properties); ! DiskOnlyStrategy bufferStrategy = (DiskOnlyStrategy) journal._bufferStrategy; ! ! assertTrue("isStable", bufferStrategy.isStable()); ! assertFalse("isFullyBuffered", bufferStrategy.isFullyBuffered()); ! // assertEquals(Options.FILE, properties.getProperty(Options.FILE), ! // bufferStrategy.file.toString()); ! assertEquals(Options.INITIAL_EXTENT, Options.DEFAULT_INITIAL_EXTENT, ! bufferStrategy.getInitialExtent()); ! assertEquals(Options.MAXIMUM_EXTENT, Options.DEFAULT_MAXIMUM_EXTENT, ! bufferStrategy.getMaximumExtent()); ! assertNotNull("raf", bufferStrategy.raf); ! assertEquals(Options.BUFFER_MODE, BufferMode.Disk, bufferStrategy ! .getBufferMode()); ! ! journal.closeAndDelete(); } Index: AbstractTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/AbstractTestCase.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AbstractTestCase.java 21 Feb 2007 20:17:20 -0000 1.18 --- AbstractTestCase.java 22 Feb 2007 16:59:34 -0000 1.19 *************** *** 49,57 **** import java.io.File; - import java.io.IOException; import java.nio.ByteBuffer; import java.util.Properties; import java.util.Random; import junit.framework.TestCase; import junit.framework.TestCase2; --- 49,58 ---- import java.io.File; import java.nio.ByteBuffer; import java.util.Properties; import java.util.Random; + import com.bigdata.rawstore.IRawStore; + import junit.framework.TestCase; import junit.framework.TestCase2; *************** *** 106,109 **** --- 107,163 ---- + ":END:====================\n"); + deleteTestFile(); + + } + + public void tearDown() throws Exception { + + super.tearDown(); + + deleteTestFile(); + + } + + /** + * Note: your unit must close the store for delete to work. + */ + protected void deleteTestFile() { + + if(m_properties==null) return; // never requested. + + String val; + + val = (String) m_properties.getProperty(Options.FILE); + + if(val!= null) { + + File file = new File(val); + + if(file.exists()) { + + val = (String) m_properties.getProperty(Options.DELETE_ON_EXIT); + + if(val==null) { + + val = (String) m_properties.getProperty(Options.DELETE_ON_CLOSE); + + } + + if(Boolean.parseBoolean(val)) { + + System.err.println("Attempting to delete file: "+file); + + if(!file.delete()) { + + log.warn("Could not delete file: "+file); + + } + + } + + } + + } + } *************** *** 139,159 **** m_properties = super.getProperties(); ! } ! /* ! * Wrap up the cached properties so that they are not modifable by the ! * caller (no side effects between calls). ! */ ! Properties properties = new Properties( m_properties ); ! /* ! * The test files are always deleted when the journal is closed ! * normally. ! */ ! properties.setProperty(Options.DELETE_ON_CLOSE,"true"); ! return properties; } --- 193,250 ---- m_properties = super.getProperties(); + // m_properties = new Properties( m_properties ); + + /* + * Wrap up the cached properties so that they are not modifable by the + * caller (no side effects between calls). + */ ! /* ! * Use a temporary file for the test. Such files are always deleted when ! * the journal is closed or the VM exits. ! */ ! m_properties.setProperty(Options.CREATE_TEMP_FILE,"true"); ! // m_properties.setProperty(Options.DELETE_ON_CLOSE,"true"); ! m_properties.setProperty(Options.DELETE_ON_EXIT,"true"); ! ! m_properties.setProperty(Options.SEGMENT, "0"); ! ! } ! return m_properties; ! } ! ! /** ! * Re-open the same backing store. ! * ! * @param store ! * the existing store. ! * ! * @return A new store. ! * ! * @exception Throwable ! * if the existing store is not closed, e.g., from failure to ! * obtain a file lock, etc. ! */ ! protected Journal reopenStore(Journal store) { ! // close the store. ! store.close(); ! Properties properties = (Properties)getProperties().clone(); ! ! // Turn this off now since we want to re-open the same store. ! properties.setProperty(Options.CREATE_TEMP_FILE,"false"); ! ! // The backing file that we need to re-open. ! File file = store.getFile(); ! ! assertNotNull(file); ! ! // Set the file property explictly. ! properties.setProperty(Options.FILE,file.toString()); ! ! return new Journal( properties ); } *************** *** 192,307 **** /** ! * <p> ! * Return the name of a journal file to be used for a unit test. The file is ! * created using the temporary file creation mechanism, but it is then ! * deleted. Ideally the returned filename is unique for the scope of the ! * test and will not be reported by the journal as a "pre-existing" file. ! * </p> ! * <p> ! * Note: This method is not advised for performance tests in which the disk ! * allocation matters since the file is allocated in a directory choosen by ! * the OS. ! * </p> ! * ! * @param properties ! * The configured properties. This is used to extract metadata ! * about the journal test configuration that is included in the ! * generated filename. Therefore this method should be invoked ! * after you have set the properties, or at least the ! * {@link Options#BUFFER_MODE}. ! * ! * @return The unique filename. ! * ! * @see {@link #getProperties()}, which sets the "deleteOnClose" flag for ! * unit tests. ! */ ! protected String getTestJournalFile(Properties properties) { ! ! return getTestJournalFile(getName(),properties); ! ! } ! ! static public String getTestJournalFile(String name,Properties properties) { ! ! // Used to name the file. ! String bufferMode = properties.getProperty(Options.BUFFER_MODE); ! ! // Used to name the file. ! if( bufferMode == null ) bufferMode = "default"; ! ! try { ! ! // Create the temp. file. ! File tmp = File.createTempFile("test-" + bufferMode + "-" ! + name + "-", ".jnl"); ! ! // Delete the file otherwise the Journal will attempt to open it. ! if (!tmp.delete()) { ! ! throw new RuntimeException("Unable to remove empty test file: " ! + tmp); ! ! } ! ! // make sure that the file is eventually removed. ! tmp.deleteOnExit(); ! ! return tmp.toString(); ! ! } catch (IOException ex) { ! ! throw new RuntimeException(ex); ! ! } ! ! } ! ! /** ! * Version of {@link #deleteTestJournalFile(String)} that obtains the name ! * of the journal file from the {@link Options#FILE} property (if any) on ! * {@link #getProperties()}. ! */ ! protected void deleteTestJournalFile() { ! ! String filename = getProperties().getProperty(Options.FILE); ! ! if( filename != null ) { ! ! deleteTestJournalFile(filename); ! ! } ! ! } ! ! /** ! * Delete the test file (if any). Note that test files are NOT created when ! * testing the {@link BufferMode#Transient} journal. A warning message that ! * the file could not be deleted generally means that you forgot to close ! * the journal in your test. ! * ! * @param filename ! * The filename (optional). ! */ ! protected void deleteTestJournalFile(String filename) { ! ! if( filename == null ) return; ! ! try { ! ! File file = new File(filename); ! ! if ( file.exists() && ! file.delete()) { ! ! System.err.println("Warning: could not delete: " + file.getAbsolutePath()); ! ! } ! ! } catch (Throwable t) { ! ! System.err.println("Warning: " + t); ! ! } ! ! } /** --- 283,398 ---- /** ! // * <p> ! // * Return the name of a journal file to be used for a unit test. The file is ! // * created using the temporary file creation mechanism, but it is then ! // * deleted. Ideally the returned filename is unique for the scope of the ! // * test and will not be reported by the journal as a "pre-existing" file. ! // * </p> ! // * <p> ! // * Note: This method is not advised for performance tests in which the disk ! // * allocation matters since the file is allocated in a directory choosen by ! // * the OS. ! // * </p> ! // * ! // * @param properties ! // * The configured properties. This is used to extract metadata ! // * about the journal test configuration that is included in the ! // * generated filename. Therefore this method should be invoked ! // * after you have set the properties, or at least the ! // * {@link Options#BUFFER_MODE}. ! // * ! // * @return The unique filename. ! // * ! // * @see {@link #getProperties()}, which sets the "deleteOnClose" flag for ! // * unit tests. ! // */ ! // protected String getTestJournalFile(Properties properties) { ! // ! // return getTestJournalFile(getName(),properties); ! // ! // } ! // ! // static public String getTestJournalFile(String name,Properties properties) { ! // ! // // Used to name the file. ! // String bufferMode = properties.getProperty(Options.BUFFER_MODE); ! // ! // // Used to name the file. ! // if( bufferMode == null ) bufferMode = "default"; ! // ! // try { ! // ! // // Create the temp. file. ! // File tmp = File.createTempFile("test-" + bufferMode + "-" ! // + name + "-", ".jnl"); ! // ! // // Delete the file otherwise the Journal will attempt to open it. ! // if (!tmp.delete()) { ! // ! // throw new RuntimeException("Unable to remove empty test file: " ! // + tmp); ! // ! // } ! // ! // // make sure that the file is eventually removed. ! // tmp.deleteOnExit(); ! // ! // return tmp.toString(); ! // ! // } catch (IOException ex) { ! // ! // throw new RuntimeException(ex); ! // ! // } ! // ! // } ! // ! // /** ! // * Version of {@link #deleteTestJournalFile(String)} that obtains the name ! // * of the journal file from the {@link Options#FILE} property (if any) on ! // * {@link #getProperties()}. ! // */ ! // protected void deleteTestJournalFile() { ! // ! // String filename = getProperties().getProperty(Options.FILE); ! // ! // if( filename != null ) { ! // ! // deleteTestJournalFile(filename); ! // ! // } ! // ! // } ! // ! // /** ! // * Delete the test file (if any). Note that test files are NOT created when ! // * testing the {@link BufferMode#Transient} journal. A warning message that ! // * the file could not be deleted generally means that you forgot to close ! // * the journal in your test. ! // * ! // * @param filename ! // * The filename (optional). ! // */ ! // protected void deleteTestJournalFile(String filename) { ! // ! // if( filename == null ) return; ! // ! // try { ! // ! // File file = new File(filename); ! // ! // if ( file.exists() && ! file.delete()) { ! // ! // System.err.println("Warning: could not delete: " + file.getAbsolutePath()); ! // ! // } ! // ! // } catch (Throwable t) { ! // ! // System.err.println("Warning: " + t); ! // ! // } ! // ! // } /** Index: AbstractMROWTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/AbstractMROWTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractMROWTestCase.java 21 Feb 2007 20:17:20 -0000 1.1 --- AbstractMROWTestCase.java 22 Feb 2007 16:59:34 -0000 1.2 *************** *** 281,284 **** --- 281,286 ---- + elapsed + "ms (" + nok * 1000 / elapsed + " reads per second); nwritten=" + nwritten); + + store.closeAndDelete(); } *************** *** 531,542 **** properties.setProperty(Options.SEGMENT, "0"); ! ! File file = File.createTempFile("bigdata", ".jnl"); ! ! file.deleteOnExit(); ! ! if(!file.delete()) fail("Could not remove temp file before test"); ! ! properties.setProperty(Options.FILE, file.toString()); Journal journal = new Journal(properties); --- 533,538 ---- properties.setProperty(Options.SEGMENT, "0"); ! ! properties.setProperty(Options.CREATE_TEMP_FILE,"true"); Journal journal = new Journal(properties); *************** *** 547,550 **** --- 543,552 ---- journal.shutdown(); + if(journal.getFile()!=null) { + + journal.getFile().delete(); + + } + } Index: AbstractBufferStrategyTestCase.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/AbstractBufferStrategyTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractBufferStrategyTestCase.java 21 Feb 2007 20:17:20 -0000 1.3 --- AbstractBufferStrategyTestCase.java 22 Feb 2007 16:59:34 -0000 1.4 *************** *** 89,97 **** .toString()); properties.setProperty(Options.SEGMENT, "0"); ! // Note: also deletes the file before it is used. ! properties.setProperty(Options.FILE, AbstractTestCase ! .getTestJournalFile(getName(), properties)); } --- 89,105 ---- .toString()); + /* + * Use a temporary file for the test. Such files are always deleted when + * the journal is closed or the VM exits. + */ + 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"); ! // // Note: also deletes the file before it is used. ! // properties.setProperty(Options.FILE, AbstractTestCase ! // .getTestJournalFile(getName(), properties)); } *************** *** 177,181 **** } ! store.close(); } --- 185,189 ---- } ! store.closeAndDelete(); } *************** *** 216,220 **** assertEquals("userExtent",userExtent, bufferStrategy.getUserExtent()); ! store.close(); } --- 224,228 ---- assertEquals("userExtent",userExtent, bufferStrategy.getUserExtent()); ! store.closeAndDelete(); } *************** *** 303,307 **** assertEquals(b2, bufferStrategy.read(addr2)); ! store.close(); } --- 311,315 ---- assertEquals(b2, bufferStrategy.read(addr2)); ! store.closeAndDelete(); } Index: ComparisonTestDriver.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/ComparisonTestDriver.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ComparisonTestDriver.java 21 Feb 2007 20:17:20 -0000 1.1 --- ComparisonTestDriver.java 22 Feb 2007 16:59:34 -0000 1.2 *************** *** 161,175 **** String name = sb.toString(); - /* - * Create a temporary file for the journal. Note that you must delete - * the temporary file before starting the journal since it is empty and - * just a placeholder for a unique filename. - */ - File file = File.createTempFile("bigdata", ".jnl"); - - file.deleteOnExit(); - - properties.setProperty(Options.FILE, file.toString()); - return new Condition(name,properties); --- 161,164 ---- *************** *** 257,262 **** // force delete of the files on close of the journal under test. ! properties.setProperty(Options.DELETE_ON_CLOSE,"true"); ! properties.setProperty(Options.SEGMENT, "0"); --- 246,251 ---- // force delete of the files on close of the journal under test. ! properties.setProperty(Options.CREATE_TEMP_FILE,"true"); ! // properties.setProperty(Options.DELETE_ON_CLOSE,"true"); properties.setProperty(Options.SEGMENT, "0"); *************** *** 306,316 **** Condition condition = itr.next(); - File file = new File(condition.properties - .getProperty(Options.FILE)); - - if (!file.delete()) - throw new AssertionError( - "Could not remove temp file before test"); - IComparisonTest test = (IComparisonTest) cl.newInstance(); --- 295,298 ---- Index: TestTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTx.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TestTx.java 21 Feb 2007 20:17:20 -0000 1.18 --- TestTx.java 22 Feb 2007 16:59:34 -0000 1.19 *************** *** 92,98 **** public void test_noIndicesRegistered() { ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); journal.commit(); --- 92,96 ---- public void test_noIndicesRegistered() { ! Journal journal = new Journal(getProperties()); journal.commit(); *************** *** 107,111 **** assertTrue(journal.commit(tx)!=0L); ! journal.close(); } --- 105,109 ---- assertTrue(journal.commit(tx)!=0L); ! journal.closeAndDelete(); } *************** *** 118,124 **** public void test_indexNotVisibleUnlessCommitted() { ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 116,120 ---- public void test_indexNotVisibleUnlessCommitted() { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 149,153 **** journal.abort(tx2); ! journal.close(); } --- 145,193 ---- journal.abort(tx2); ! journal.closeAndDelete(); ! ! } ! ! /** ! * Test verifies that you always get the same object back when you ask for ! * an isolated named index. This is important both to conserve resources ! * and since the write set is in the isolated index -- you lose it and it ! * is gone. ! */ ! public void test_sameIndexObject() { ! ! Journal journal = new Journal(getProperties()); ! ! final String name = "abc"; ! ! { ! ! journal.registerIndex(name, new UnisolatedBTree(journal)); ! ! journal.commit(); ! ! } ! ! final long tx1 = journal.newTx(); ! ! final IIndex ndx1 = journal.getIndex(name,tx1); ! ! assertNotNull(ndx1); ! ! final long tx2 = journal.newTx(); ! ! final IIndex ndx2 = journal.getIndex(name,tx2); ! ! assertTrue(tx1 != tx2); ! ! assertTrue(ndx1 != ndx2); ! ! assertNotNull(ndx2); ! ! assertTrue( ndx1 == journal.getIndex(name,tx1)); ! ! assertTrue( ndx2 == journal.getIndex(name,tx2)); ! ! journal.closeAndDelete(); } *************** *** 161,167 **** public void test_readIsolation() { ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); final String name = "abc"; --- 201,205 ---- public void test_readIsolation() { ! Journal journal = new Journal(getProperties()); final String name = "abc"; *************** *** 257,261 **** journal.abort(tx2); ! journal.close(); } --- 295,299 ---- journal.abort(tx2); ! journal.closeAndDelete(); } *************** *** 271,277 **** public void test_writeIsolation() { ! Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); final String name = "abc"; --- 309,313 ---- public void test_writeIsolation() { ! Journal journal = new Journal(getProperties()); final String name = "abc"; *************** *** 375,379 **** } ! journal.close(); } --- 411,415 ---- } ! journal.closeAndDelete(); } *************** *** 393,399 **** public void test_delete001() { ! final Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 429,433 ---- public void test_delete001() { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 469,473 **** assertTrue(journal.getIndex(name).contains(id0)); ! journal.close(); } --- 503,507 ---- assertTrue(journal.getIndex(name).contains(id0)); ! journal.closeAndDelete(); } *************** *** 484,490 **** public void test_delete002() { ! final Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 518,522 ---- public void test_delete002() { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 577,581 **** assertFalse(journal.getIndex(name).contains(id0)); ! journal.close(); } --- 609,613 ---- assertFalse(journal.getIndex(name).contains(id0)); ! journal.closeAndDelete(); } *************** *** 593,599 **** public void test_delete003() { ! final Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); String name = "abc"; --- 625,629 ---- public void test_delete003() { ! Journal journal = new Journal(getProperties()); String name = "abc"; *************** *** 665,669 **** assertEquals(v1, (byte[])journal.getIndex(name).lookup(id0)); ! journal.close(); } --- 695,699 ---- assertEquals(v1, (byte[])journal.getIndex(name).lookup(id0)); ! journal.closeAndDelete(); } *************** *** 1124,1130 **** public void test_commit_noConflict01() { ! final Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); final String name = "abc"; --- 1154,1158 ---- public void test_commit_noConflict01() { ! Journal journal = new Journal(getProperties()); final String name = "abc"; *************** *** 1204,1208 **** id1)); ! journal.close(); } --- 1232,1236 ---- id1)); ! journal.closeAndDelete(); } *************** *** 1214,1220 **** public void test_deletePreExistingVersion_noConflict() { ! final Properties properties = getProperties(); ! ! Journal journal = new Journal(properties); final String name = "abc"; --- 1242,1246 ---- public void test_deletePreExistingVersion_noConflict() { ! Journal journal = new Journal(getProperties()); final String name = "abc"; *************** *** 1269,1273 **** assertFalse(journal.getIndex(name).contains(id0)); ! journal.close(); } --- 1295,1299 ---- assertFalse(journal.getIndex(name).contains(id0)); ! journal.closeAndDelete(); } Index: TestMappedJournal.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestMappedJournal.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TestMappedJournal.java 21 Feb 2007 20:17:20 -0000 1.8 --- TestMappedJournal.java 22 Feb 2007 16:59:34 -0000 1.9 *************** *** 115,121 **** properties.setProperty(Options.BUFFER_MODE, BufferMode.Mapped.toString()); ! properties.setProperty(Options.SEGMENT, "0"); ! properties.setProperty(Options.FILE,getTestJournalFile(properties)); return properties; --- 115,121 ---- properties.setProperty(Options.BUFFER_MODE, BufferMode.Mapped.toString()); ! // properties.setProperty(Options.SEGMENT, "0"); ! // properties.setProperty(Options.FILE,getTestJournalFile(properties)); return properties; *************** *** 132,164 **** final Properties properties = getProperties(); - - try { - - Journal journal = new Journal(properties); ! MappedBufferStrategy bufferStrategy = (MappedBufferStrategy) journal._bufferStrategy; ! ! assertTrue("isStable",bufferStrategy.isStable()); ! assertFalse("isFullyBuffered",bufferStrategy.isFullyBuffered()); ! assertEquals(Options.FILE, properties.getProperty(Options.FILE), bufferStrategy.file.toString()); ! assertEquals(Options.INITIAL_EXTENT, Options.DEFAULT_INITIAL_EXTENT, ! bufferStrategy.getInitialExtent()); ! assertEquals(Options.MAXIMUM_EXTENT, Options.DEFAULT_MAXIMUM_EXTENT, ! bufferStrategy.getMaximumExtent()); ! assertNotNull("raf", bufferStrategy.raf); ! assertEquals("bufferMode", BufferMode.Mapped, bufferStrategy.getBufferMode()); ! assertNotNull("directBuffer", bufferStrategy.directBuffer); ! assertNotNull("mappedBuffer", bufferStrategy.mappedBuffer); ! assertTrue( "userExtent", bufferStrategy.getExtent() > bufferStrategy.getUserExtent()); ! assertEquals( "bufferCapacity", bufferStrategy.getUserExtent(), bufferStrategy.directBuffer ! .capacity()); ! ! journal.close(); ! } finally { ! ! deleteTestJournalFile(); ! ! } } --- 132,159 ---- final Properties properties = getProperties(); ! Journal journal = new Journal(properties); ! MappedBufferStrategy bufferStrategy = (MappedBufferStrategy) journal._bufferStrategy; ! ! assertTrue("isStable", bufferStrategy.isStable()); ! assertFalse("isFullyBuffered", bufferStrategy.isFullyBuffered()); ! // assertEquals(Options.FILE, properties.getProperty(Options.FILE), ! // bufferStrategy.file.toString()); ! assertEquals(Options.INITIAL_EXTENT, Options.DEFAULT_INITIAL_EXTENT, ! bufferStrategy.getInitialExtent()); ! assertEquals(Options.MAXIMUM_EXTENT, Options.DEFAULT_MAXIMUM_EXTENT, ! bufferStrategy.getMaximumExtent()); ! assertNotNull("raf", bufferStrategy.raf); ! assertEquals("bufferMode", BufferMode.Mapped, bufferStrategy ! .getBufferMode()); ! assertNotNull("directBuffer", bufferStrategy.directBuffer); ! assertNotNull("mappedBuffer", bufferStrategy.mappedBuffer); ! assertTrue("userExtent", bufferStrategy.getExtent() > bufferStrategy ! .getUserExtent()); ! assertEquals("bufferCapacity", bufferStrategy.getUserExtent(), ! bufferStrategy.directBuffer.capacity()); ! ! journal.closeAndDelete(); } Index: TestTxJournalProtocol.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTxJournalProtocol.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestTxJournalProtocol.java 17 Feb 2007 21:34:13 -0000 1.1 --- TestTxJournalProtocol.java 22 Feb 2007 16:59:34 -0000 1.2 *************** *** 75,112 **** */ public void test_duplicateTransactionIdentifiers01() throws IOException { ! ! final Properties properties = getProperties(); try { ! Journal journal = new Journal(properties); ! Tx tx0 = new Tx(journal,0); ! try { ! // Try to create another transaction with the same identifier. ! new Tx(journal,0); ! ! fail( "Expecting: "+IllegalStateException.class); ! ! } ! ! catch( IllegalStateException ex ) { ! ! System.err.println("Ignoring expected exception: "+ex); ! ! } ! ! tx0.abort(); ! ! journal.close(); ! } finally { ! deleteTestJournalFile(); - } - } --- 75,102 ---- */ ... [truncated message content] |