Update of /cvsroot/cweb/bigdata/src/test/com/bigdata/journal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10595/src/test/com/bigdata/journal Modified Files: TestTransactionServer.java AbstractTestTxRunState.java TestConflictResolution.java TestTx.java StressTestConcurrent.java Log Message: Refactoring to define service apis (data service, transaction manager service) and some approximate implementations of those services (not supporting service discovery, network protocol, or service robustness). Copied in the UML model so that it will actually get committed to CVS.... Index: TestConflictResolution.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestConflictResolution.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestConflictResolution.java 22 Feb 2007 16:59:34 -0000 1.4 --- TestConflictResolution.java 15 Mar 2007 16:11:09 -0000 1.5 *************** *** 152,158 **** */ ! final long tx1 = journal.newTx(); ! final long tx2 = journal.newTx(); /* --- 152,158 ---- */ ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); ! final long tx2 = journal.newTx(IsolationEnum.ReadWrite); /* *************** *** 227,233 **** */ ! final long tx1 = journal.newTx(); ! final long tx2 = journal.newTx(); /* --- 227,233 ---- */ ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); ! final long tx2 = journal.newTx(IsolationEnum.ReadWrite); /* *************** *** 296,302 **** // */ // ! // final long tx1 = journal.newTx(); // ! // final long tx2 = journal.newTx(); // // /* --- 296,302 ---- // */ // ! // final long tx1 = journal.newTx(IsolationEnum.ReadWrite); // ! // final long tx2 = journal.newTx(IsolationEnum.ReadWrite); // // /* Index: TestTransactionServer.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTransactionServer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestTransactionServer.java 28 Feb 2007 13:59:09 -0000 1.3 --- TestTransactionServer.java 15 Mar 2007 16:11:09 -0000 1.4 *************** *** 49,56 **** import junit.framework.TestCase; /** ! * Test suite for semantics of the {@link TransactionServer}. * * @todo The test suite has to cover the basic API, including correct generation --- 49,58 ---- + import com.bigdata.service.OldTransactionServer; + import junit.framework.TestCase; /** ! * Test suite for semantics of the {@link OldTransactionServer}. * * @todo The test suite has to cover the basic API, including correct generation *************** *** 81,85 **** public void test_ctor() { ! new TransactionServer(); } --- 83,87 ---- public void test_ctor() { ! new OldTransactionServer(); } *************** *** 99,103 **** public void test001() { ! TransactionServer server = new MyTransactionServer(); /* groundState is t0. --- 101,105 ---- public void test001() { ! OldTransactionServer server = new MyTransactionServer(); /* groundState is t0. *************** *** 149,153 **** * @version $Id$ */ ! static class MyTransactionServer extends TransactionServer { public MyTransactionServer() { --- 151,155 ---- * @version $Id$ */ ! static class MyTransactionServer extends OldTransactionServer { public MyTransactionServer() { Index: TestTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/TestTx.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TestTx.java 11 Mar 2007 11:42:34 -0000 1.20 --- TestTx.java 15 Mar 2007 16:11:09 -0000 1.21 *************** *** 96,100 **** journal.commit(); ! final long tx = journal.newTx(); /* --- 96,100 ---- journal.commit(); ! final long tx = journal.newTx(IsolationEnum.ReadWrite); /* *************** *** 124,128 **** // start tx1. ! final long tx1 = journal.newTx(); // the index is not visible in tx1. --- 124,128 ---- // start tx1. ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); // the index is not visible in tx1. *************** *** 133,137 **** // start tx2. ! final long tx2 = journal.newTx(); // the index still is not visible in tx1. --- 133,137 ---- // start tx2. ! final long tx2 = journal.newTx(IsolationEnum.ReadWrite); // the index still is not visible in tx1. *************** *** 169,173 **** } ! final long tx1 = journal.newTx(); final IIndex ndx1 = journal.getIndex(name,tx1); --- 169,173 ---- } ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); final IIndex ndx1 = journal.getIndex(name,tx1); *************** *** 175,179 **** assertNotNull(ndx1); ! final long tx2 = journal.newTx(); final IIndex ndx2 = journal.getIndex(name,tx2); --- 175,179 ---- assertNotNull(ndx1); ! final long tx2 = journal.newTx(IsolationEnum.ReadWrite); final IIndex ndx2 = journal.getIndex(name,tx2); *************** *** 229,233 **** } ! final long tx1 = journal.newTx(); { --- 229,233 ---- } ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); { *************** *** 275,279 **** } ! final long tx2 = journal.newTx(); { --- 275,279 ---- } ! final long tx2 = journal.newTx(IsolationEnum.ReadWrite); { *************** *** 337,343 **** */ ! final long tx1 = journal.newTx(); ! final long tx2 = journal.newTx(); { --- 337,343 ---- */ ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); ! final long tx2 = journal.newTx(IsolationEnum.ReadWrite); { *************** *** 447,453 **** */ ! final long tx0 = journal.newTx(); ! final long tx1 = journal.newTx(); /* --- 447,453 ---- */ ! final long tx0 = journal.newTx(IsolationEnum.ReadWrite); ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); /* *************** *** 536,542 **** */ ! final long tx0 = journal.newTx(); ! final long tx1 = journal.newTx(); /* --- 536,542 ---- */ ! final long tx0 = journal.newTx(IsolationEnum.ReadWrite); ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); /* *************** *** 643,649 **** */ ! final long tx0 = journal.newTx(); ! final long tx1 = journal.newTx(); /* --- 643,649 ---- */ ! final long tx0 = journal.newTx(IsolationEnum.ReadWrite); ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); /* *************** *** 1170,1180 **** * change will not be visible in this scope. */ ! final long tx0 = journal.newTx(); // transaction on which we write and later commit. ! final long tx1 = journal.newTx(); // new transaction - commit will not be visible in this scope. ! final long tx2 = journal.newTx(); final byte[] id1 = new byte[]{1}; --- 1170,1180 ---- * change will not be visible in this scope. */ ! final long tx0 = journal.newTx(IsolationEnum.ReadWrite); // transaction on which we write and later commit. ! final long tx1 = journal.newTx(IsolationEnum.ReadWrite); // new transaction - commit will not be visible in this scope. ! final long tx2 = journal.newTx(IsolationEnum.ReadWrite); final byte[] id1 = new byte[]{1}; *************** *** 1204,1208 **** // new transaction - commit is visible in this scope. ! final long tx3 = journal.newTx(); // data version still not visible in tx0. --- 1204,1208 ---- // new transaction - commit is visible in this scope. ! final long tx3 = journal.newTx(IsolationEnum.ReadWrite); // data version still not visible in tx0. *************** *** 1271,1275 **** // start transaction. ! final long tx0 = journal.newTx(); // data version visible in the transaction. --- 1271,1275 ---- // start transaction. ! final long tx0 = journal.newTx(IsolationEnum.ReadWrite); // data version visible in the transaction. Index: StressTestConcurrent.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/StressTestConcurrent.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** StressTestConcurrent.java 12 Mar 2007 18:06:12 -0000 1.8 --- StressTestConcurrent.java 15 Mar 2007 16:11:09 -0000 1.9 *************** *** 279,283 **** public Long call() throws Exception { ! final long tx = journal.newTx(); final IIndex ndx = journal.getIndex(name,tx); --- 279,283 ---- public Long call() throws Exception { ! final long tx = journal.newTx(IsolationEnum.ReadWrite); final IIndex ndx = journal.getIndex(name,tx); *************** *** 367,371 **** * However, there is still going to be something that was causing * those transactions and their stores to be hanging around -- perhaps ! * the commitService in the Journal which might be holding onto * {@link Future}s? * --- 367,371 ---- * However, there is still going to be something that was causing * those transactions and their stores to be hanging around -- perhaps ! * the writeService in the Journal which might be holding onto * {@link Future}s? * Index: AbstractTestTxRunState.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/test/com/bigdata/journal/AbstractTestTxRunState.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractTestTxRunState.java 28 Feb 2007 13:59:09 -0000 1.1 --- AbstractTestTxRunState.java 15 Mar 2007 16:11:09 -0000 1.2 *************** *** 180,184 **** * been executed. */ ! journal.commitService.shutdown(); assertFalse(tx0.isActive()); --- 180,184 ---- * been executed. */ ! journal.writeService.shutdown(); assertFalse(tx0.isActive()); *************** *** 576,580 **** // } // ! // ITx tx0 = journal.newTx(); // // IIndex ndx = tx0.getIndex(name); --- 576,580 ---- // } // ! // ITx tx0 = journal.newTx(IsolationEnum.ReadWrite); // // IIndex ndx = tx0.getIndex(name); *************** *** 660,664 **** // } // ! // ITx tx0 = journal.newTx(); // // IIndex ndx = tx0.getIndex(name); --- 660,664 ---- // } // ! // ITx tx0 = journal.newTx(IsolationEnum.ReadWrite); // // IIndex ndx = tx0.getIndex(name); |