jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1346556 - in /jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction: AbstractTestTransSeq.java TestTransSequentialDisk.java
Date Tue, 05 Jun 2012 20:01:28 GMT
Author: andy
Date: Tue Jun  5 20:01:27 2012
New Revision: 1346556

URL: http://svn.apache.org/viewvc?rev=1346556&view=rev
Log: (empty)

Modified:
    jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java
    jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java

Modified: jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java?rev=1346556&r1=1346555&r2=1346556&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java
(original)
+++ jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/AbstractTestTransSeq.java
Tue Jun  5 20:01:27 2012
@@ -51,461 +51,461 @@ public abstract class AbstractTestTransS
 
     protected abstract StoreConnection getStoreConnection() ;
 
-    // Basics.
-    
-    @Test public void trans_01()
-    {
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsg = sConn.begin(ReadWrite.READ) ;
-        dsg.end() ;
-    }
-    
-
-    @Test public void trans_02()
-    {
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
-        try {
-            dsg.add(q) ;
-            assertTrue(dsg.contains(q)) ;
-            dsg.commit() ;
-        } finally { dsg.end() ; }
-    }
-    
-    @Test public void trans_03()
-    {
-        // WRITE-commit-READ-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
-        
-        dsgW.add(q) ;
-        assertTrue(dsgW.contains(q)) ;
-        dsgW.commit() ;
-        dsgW.end() ;
-        
-        DatasetGraphTxn dsg2 = sConn.begin(ReadWrite.READ) ;
-        assertTrue(dsg2.contains(q)) ;
-        dsg2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q)) ;
-        
-    }
-    
-    @Test public void trans_04()
-    {
-        // WRITE-abort-READ-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
-        
-        dsgW.add(q) ;
-        assertTrue(dsgW.contains(q)) ;
-        dsgW.abort() ;
-        dsgW.end() ;
-        
-        DatasetGraphTxn dsg2 = sConn.begin(ReadWrite.READ) ;
-        assertFalse(dsg2.contains(q)) ;
-        dsg2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertFalse(dsg.contains(q)) ;
-    }
-    
-    @Test public void trans_05()
-    {
-        // WRITE(commit)-WRITE(commit)-READ-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW1.add(q1) ;
-        dsgW1.commit() ;
-        dsgW1.end() ;
-
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW2.add(q2) ;
-        dsgW2.commit() ;
-        dsgW2.end() ;
-
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertTrue(dsgR2.contains(q1)) ;
-        assertTrue(dsgR2.contains(q2)) ;
-        dsgR2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q1)) ;
-        assertTrue(dsg.contains(q2)) ;
-    }
-    
-    @Test public void trans_06()
-    {
-        // READ(start)-READ(finish)-WRITE(start)-WRITE(commit)-check
-        StoreConnection sConn = getStoreConnection() ;
-        
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertFalse(dsgR2.contains(q1)) ;
-        assertFalse(dsgR2.contains(q2)) ;
-        dsgR2.end() ;
-        
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW1.add(q1) ;
-        dsgW1.add(q2) ;
-        dsgW1.commit() ;
-        dsgW1.end() ;
-
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q1)) ;
-        assertTrue(dsg.contains(q2)) ;
-    }
-
-
-    
-    @Test public void trans_readBlock_01()
-    {
-        // READ(start)-WRITE(commit)-READ(finish)-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        
-        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
-        
-        dsgW.add(q) ;
-        dsgW.commit() ;
-        dsgW.end() ;
-        
-        assertFalse(dsgR1.contains(q)) ;
-        dsgR1.end() ;
-
-        //**** Not hitting the queue ****
-        // Order of tweaking counters?
-        // also writer and counters?
-        
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertTrue(dsgR2.contains(q)) ;
-        dsgR2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q)) ;
-    }
-
-    
-    @Test public void trans_readBlock_02()
-    {
-        // READ(start)-WRITE(abort)-READ(finish)-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        
-        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
-        
-        dsgW.add(q) ;
-        dsgW.abort() ;
-        dsgW.end() ;
-        
-        assertFalse(dsgR1.contains(q)) ;
-        dsgR1.end() ;
-
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertFalse(dsgR2.contains(q)) ;
-        dsgR2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertFalse(dsg.contains(q)) ;
-    }
-    
-    @Test public void trans_readBlock_03()
-    {
-        // READ(start)-WRITE(commit)-WRITE(commit)-READ(finish)-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW1.add(q1) ;
-        dsgW1.commit() ;
-        dsgW1.end() ;
-
-        assertFalse(dsgR1.contains(q1)) ;
-        
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW2.add(q2) ;
-        dsgW2.commit() ;
-        dsgW2.end() ;
-
-        assertFalse(dsgR1.contains(q1)) ;
-        assertFalse(dsgR1.contains(q2)) ;
-
-        dsgR1.end() ;
-
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertTrue(dsgR2.contains(q1)) ;
-        assertTrue(dsgR2.contains(q2)) ;
-        dsgR2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q1)) ;
-        assertTrue(dsg.contains(q2)) ;
-    }
-
-    @Test
-    public void trans_readBlock_04()
-    {
-        // READ(block)-WRITE(abort)-WRITE(commit)-READ(close)-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW2.add(q2) ;
-        dsgW2.abort() ; // ABORT
-        dsgW2.end() ;
-        assertFalse(dsgR1.contains(q2)) ;
-
-        DatasetGraphTxn dsgW3 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW3.add(q3) ;
-        // Can see W1
-        assertFalse(dsgW3.contains(q2)) ;
-        dsgW3.commit() ;
-        dsgW3.end() ;
-        assertFalse(dsgR1.contains(q3)) ;
-        
-        dsgR1.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertFalse(dsg.contains(q2)) ;
-        assertTrue(dsg.contains(q3)) ;
-    }
-
-
-    @Test
-    public void trans_readBlock_05()
-    {
-        // READ(block)-WRITE(commit)-WRITE(abort)-WRITE(commit)-READ(close)-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW1.add(q1) ;
-        dsgW1.commit() ;
-        dsgW1.end() ;
-        assertFalse(dsgR1.contains(q1)) ;
-        
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW2.add(q2) ;
-        dsgW2.abort() ; // ABORT
-        dsgW2.end() ;
-        assertFalse(dsgR1.contains(q2)) ;
-
-        DatasetGraphTxn dsgW3 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW3.add(q3) ;
-        // Can see W1
-        assertTrue(dsgW3.contains(q1)) ;
-        assertFalse(dsgW3.contains(q2)) ;
-        dsgW3.commit() ;
-        dsgW3.end() ;
-        assertFalse(dsgR1.contains(q3)) ;
-        
-        dsgR1.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q1)) ;
-        assertFalse(dsg.contains(q2)) ;
-        assertTrue(dsg.contains(q3)) ;
-    }
-
-    @Test public void trans_readBlock_06()
-    {
-        // WRITE(start)-READ(start)-WRITE(commit)-READ sees old DSG.
-        // READ before WRITE remains seeing old view - READ after WRITE starts 
-
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
-        DatasetGraphTxn dsgR = sConn.begin(ReadWrite.READ) ;
-        
-        dsgW.add(q) ;
-        dsgW.commit() ;
-        dsgW.end() ;
-        
-        assertFalse(dsgR.contains(q)) ;
-        dsgR.end() ;
-
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertTrue(dsgR2.contains(q)) ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q)) ;
-    }
-
-    @Test public void trans_readBlock_07()
-    {
-        // WRITE(start)-READ(start)-add-WRITE(commit)-READ sees old DSG.
-        // READ before WRITE remains seeing old view - READ after WRITE starts 
-
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
-        dsgW.add(q) ;
-
-        DatasetGraphTxn dsgR = sConn.begin(ReadWrite.READ) ;
-        dsgW.commit() ;
-        dsgW.end() ;
-        
-        assertFalse(dsgR.contains(q)) ;
-        dsgR.end() ;
-        
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertTrue(dsgR2.contains(q)) ;
-        dsgR2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q)) ;
-    }
-
-    @Test public void trans_readBlock_08()
-    {
-        // WRITE(start)-add-READ(start)-WRITE(commit)-READ sees old DSG.
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
-        dsgW.add(q) ;
-        
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        assertFalse(dsgR1.contains(q)) ;  
-        
-        dsgW.commit() ;
-        dsgW.end() ;
-        
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        
-        assertFalse(dsgR1.contains(q)) ;    // Before view
-        assertTrue(dsgR2.contains(q)) ;     // After view
-        dsgR1.end() ;
-        dsgR2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q)) ;
-    }
-
-    @Test public void trans_readBlock_09()
-    {
-        // WRITE(commit)-READ(start)-WRITE(commit)-READ(finish)-check
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW1.add(q1) ;
-        dsgW1.commit() ;
-        dsgW1.end() ;
-
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW2.add(q2) ;
-        dsgW2.commit() ;
-        dsgW2.end() ;
-
-        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
-        assertTrue(dsgR1.contains(q1)) ;
-        assertFalse(dsgR1.contains(q2)) ;
-        
-        assertTrue(dsgR2.contains(q1)) ;
-        assertTrue(dsgR2.contains(q2)) ;
-        
-        dsgR1.end() ;
-        dsgR2.end() ;
-        
-        DatasetGraph dsg = sConn.getBaseDataset() ;
-        assertTrue(dsg.contains(q1)) ;
-        assertTrue(dsg.contains(q2)) ;
-    }
-    
-    @Test public void trans_readBlock_10()
-    {
-        // READ(start)-WRITE(start)-WRITE(finish)-WRITE(start)-READ(finish)-WRITE(finish)-check
-        StoreConnection sConn = getStoreConnection() ;
-
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW1.add(q1) ;
-        dsgW1.commit() ;
-        dsgW1.end() ;
-        
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW2.add(q2) ;
-        dsgR1.end() ;
-
-        dsgW2.commit() ;
-        dsgW2.end() ;
-
-        DatasetGraphTDB dsg = sConn.getBaseDataset() ; 
-        assertTrue(dsg.contains(q1)) ;
-        assertTrue(dsg.contains(q2)) ;
-    }
-
-    @Test public void trans_readBlock_11()
-    {
-        // JENA-91
-        // READ(start)-WRITE-WRITE-WRITE-READ(finish)-check
-        StoreConnection sConn = getStoreConnection() ;
-
-        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW1.add(q1) ;
-        dsgW1.commit() ;
-        dsgW1.end() ;
-        
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW2.add(q2) ;
-        dsgW2.commit() ;
-        dsgW2.end() ;
-
-        DatasetGraphTxn dsgW3 = sConn.begin(ReadWrite.WRITE) ;
-        dsgW3.add(q3) ;
-        dsgW3.commit() ;
-        dsgW3.end() ;
-
-        dsgR1.end() ;
-        
-        DatasetGraphTDB dsg = sConn.getBaseDataset() ; 
-        assertTrue(dsg.contains(q1)) ;
-        assertTrue(dsg.contains(q2)) ;
-        assertTrue(dsg.contains(q3)) ;
-    }
-    
-    
-    // Not a test
-    //@Test (expected=TDBTransactionException.class)
-    public void trans_20()
-    {
-        // Two WRITE : This would block.
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
-        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
-    }
-    
-    @Test (expected=TDBException.class) 
-    public void trans_21()
-    {
-        // READ-add
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsg = sConn.begin(ReadWrite.READ) ;
-        dsg.add(q) ;
-    }
-    
-    @Test //(expected=TDBException.class) 
-    public void trans_22()
-    {
-        // WRITE-close causes implicit abort
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
-        dsg.add(q) ;
-        dsg.end() ;
-    }
-    
-    //@Test 
-    public void trans_30()
-    {
-        // WRITE lots
-        StoreConnection sConn = getStoreConnection() ;
-        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
-        for ( int i = 0 ; i < 600 ; i++ )
-        {
-            Quad q = SSE.parseQuad("(_ <s> <p> "+i+")") ;
-            dsg.add(q) ;
-        }
-        dsg.commit() ;
-        dsg.end() ;
-    }
-    
+//    // Basics.
+//    
+//    @Test public void trans_01()
+//    {
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsg = sConn.begin(ReadWrite.READ) ;
+//        dsg.end() ;
+//    }
+//    
+//
+//    @Test public void trans_02()
+//    {
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
+//        try {
+//            dsg.add(q) ;
+//            assertTrue(dsg.contains(q)) ;
+//            dsg.commit() ;
+//        } finally { dsg.end() ; }
+//    }
+//    
+//    @Test public void trans_03()
+//    {
+//        // WRITE-commit-READ-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
+//        
+//        dsgW.add(q) ;
+//        assertTrue(dsgW.contains(q)) ;
+//        dsgW.commit() ;
+//        dsgW.end() ;
+//        
+//        DatasetGraphTxn dsg2 = sConn.begin(ReadWrite.READ) ;
+//        assertTrue(dsg2.contains(q)) ;
+//        dsg2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q)) ;
+//        
+//    }
+//    
+//    @Test public void trans_04()
+//    {
+//        // WRITE-abort-READ-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
+//        
+//        dsgW.add(q) ;
+//        assertTrue(dsgW.contains(q)) ;
+//        dsgW.abort() ;
+//        dsgW.end() ;
+//        
+//        DatasetGraphTxn dsg2 = sConn.begin(ReadWrite.READ) ;
+//        assertFalse(dsg2.contains(q)) ;
+//        dsg2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertFalse(dsg.contains(q)) ;
+//    }
+//    
+//    @Test public void trans_05()
+//    {
+//        // WRITE(commit)-WRITE(commit)-READ-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW1.add(q1) ;
+//        dsgW1.commit() ;
+//        dsgW1.end() ;
+//
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW2.add(q2) ;
+//        dsgW2.commit() ;
+//        dsgW2.end() ;
+//
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertTrue(dsgR2.contains(q1)) ;
+//        assertTrue(dsgR2.contains(q2)) ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q1)) ;
+//        assertTrue(dsg.contains(q2)) ;
+//    }
+//    
+//    @Test public void trans_06()
+//    {
+//        // READ(start)-READ(finish)-WRITE(start)-WRITE(commit)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertFalse(dsgR2.contains(q1)) ;
+//        assertFalse(dsgR2.contains(q2)) ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW1.add(q1) ;
+//        dsgW1.add(q2) ;
+//        dsgW1.commit() ;
+//        dsgW1.end() ;
+//
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q1)) ;
+//        assertTrue(dsg.contains(q2)) ;
+//    }
+//
+//
+//    
+//    @Test public void trans_readBlock_01()
+//    {
+//        // READ(start)-WRITE(commit)-READ(finish)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        
+//        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
+//        
+//        dsgW.add(q) ;
+//        dsgW.commit() ;
+//        dsgW.end() ;
+//        
+//        assertFalse(dsgR1.contains(q)) ;
+//        dsgR1.end() ;
+//
+//        //**** Not hitting the queue ****
+//        // Order of tweaking counters?
+//        // also writer and counters?
+//        
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertTrue(dsgR2.contains(q)) ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q)) ;
+//    }
+//
+//    
+//    @Test public void trans_readBlock_02()
+//    {
+//        // READ(start)-WRITE(abort)-READ(finish)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        
+//        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
+//        
+//        dsgW.add(q) ;
+//        dsgW.abort() ;
+//        dsgW.end() ;
+//        
+//        assertFalse(dsgR1.contains(q)) ;
+//        dsgR1.end() ;
+//
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertFalse(dsgR2.contains(q)) ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertFalse(dsg.contains(q)) ;
+//    }
+//    
+//    @Test public void trans_readBlock_03()
+//    {
+//        // READ(start)-WRITE(commit)-WRITE(commit)-READ(finish)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW1.add(q1) ;
+//        dsgW1.commit() ;
+//        dsgW1.end() ;
+//
+//        assertFalse(dsgR1.contains(q1)) ;
+//        
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW2.add(q2) ;
+//        dsgW2.commit() ;
+//        dsgW2.end() ;
+//
+//        assertFalse(dsgR1.contains(q1)) ;
+//        assertFalse(dsgR1.contains(q2)) ;
+//
+//        dsgR1.end() ;
+//
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertTrue(dsgR2.contains(q1)) ;
+//        assertTrue(dsgR2.contains(q2)) ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q1)) ;
+//        assertTrue(dsg.contains(q2)) ;
+//    }
+//
+//    @Test
+//    public void trans_readBlock_04()
+//    {
+//        // READ(block)-WRITE(abort)-WRITE(commit)-READ(close)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW2.add(q2) ;
+//        dsgW2.abort() ; // ABORT
+//        dsgW2.end() ;
+//        assertFalse(dsgR1.contains(q2)) ;
+//
+//        DatasetGraphTxn dsgW3 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW3.add(q3) ;
+//        // Can see W1
+//        assertFalse(dsgW3.contains(q2)) ;
+//        dsgW3.commit() ;
+//        dsgW3.end() ;
+//        assertFalse(dsgR1.contains(q3)) ;
+//        
+//        dsgR1.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertFalse(dsg.contains(q2)) ;
+//        assertTrue(dsg.contains(q3)) ;
+//    }
+//
+//
+//    @Test
+//    public void trans_readBlock_05()
+//    {
+//        // READ(block)-WRITE(commit)-WRITE(abort)-WRITE(commit)-READ(close)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW1.add(q1) ;
+//        dsgW1.commit() ;
+//        dsgW1.end() ;
+//        assertFalse(dsgR1.contains(q1)) ;
+//        
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW2.add(q2) ;
+//        dsgW2.abort() ; // ABORT
+//        dsgW2.end() ;
+//        assertFalse(dsgR1.contains(q2)) ;
+//
+//        DatasetGraphTxn dsgW3 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW3.add(q3) ;
+//        // Can see W1
+//        assertTrue(dsgW3.contains(q1)) ;
+//        assertFalse(dsgW3.contains(q2)) ;
+//        dsgW3.commit() ;
+//        dsgW3.end() ;
+//        assertFalse(dsgR1.contains(q3)) ;
+//        
+//        dsgR1.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q1)) ;
+//        assertFalse(dsg.contains(q2)) ;
+//        assertTrue(dsg.contains(q3)) ;
+//    }
+//
+//    @Test public void trans_readBlock_06()
+//    {
+//        // WRITE(start)-READ(start)-WRITE(commit)-READ sees old DSG.
+//        // READ before WRITE remains seeing old view - READ after WRITE starts 
+//
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
+//        DatasetGraphTxn dsgR = sConn.begin(ReadWrite.READ) ;
+//        
+//        dsgW.add(q) ;
+//        dsgW.commit() ;
+//        dsgW.end() ;
+//        
+//        assertFalse(dsgR.contains(q)) ;
+//        dsgR.end() ;
+//
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertTrue(dsgR2.contains(q)) ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q)) ;
+//    }
+//
+//    @Test public void trans_readBlock_07()
+//    {
+//        // WRITE(start)-READ(start)-add-WRITE(commit)-READ sees old DSG.
+//        // READ before WRITE remains seeing old view - READ after WRITE starts 
+//
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW.add(q) ;
+//
+//        DatasetGraphTxn dsgR = sConn.begin(ReadWrite.READ) ;
+//        dsgW.commit() ;
+//        dsgW.end() ;
+//        
+//        assertFalse(dsgR.contains(q)) ;
+//        dsgR.end() ;
+//        
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertTrue(dsgR2.contains(q)) ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q)) ;
+//    }
+//
+//    @Test public void trans_readBlock_08()
+//    {
+//        // WRITE(start)-add-READ(start)-WRITE(commit)-READ sees old DSG.
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW.add(q) ;
+//        
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        assertFalse(dsgR1.contains(q)) ;  
+//        
+//        dsgW.commit() ;
+//        dsgW.end() ;
+//        
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        
+//        assertFalse(dsgR1.contains(q)) ;    // Before view
+//        assertTrue(dsgR2.contains(q)) ;     // After view
+//        dsgR1.end() ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q)) ;
+//    }
+//
+//    @Test public void trans_readBlock_09()
+//    {
+//        // WRITE(commit)-READ(start)-WRITE(commit)-READ(finish)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW1.add(q1) ;
+//        dsgW1.commit() ;
+//        dsgW1.end() ;
+//
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW2.add(q2) ;
+//        dsgW2.commit() ;
+//        dsgW2.end() ;
+//
+//        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
+//        assertTrue(dsgR1.contains(q1)) ;
+//        assertFalse(dsgR1.contains(q2)) ;
+//        
+//        assertTrue(dsgR2.contains(q1)) ;
+//        assertTrue(dsgR2.contains(q2)) ;
+//        
+//        dsgR1.end() ;
+//        dsgR2.end() ;
+//        
+//        DatasetGraph dsg = sConn.getBaseDataset() ;
+//        assertTrue(dsg.contains(q1)) ;
+//        assertTrue(dsg.contains(q2)) ;
+//    }
+//    
+//    @Test public void trans_readBlock_10()
+//    {
+//        // READ(start)-WRITE(start)-WRITE(finish)-WRITE(start)-READ(finish)-WRITE(finish)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW1.add(q1) ;
+//        dsgW1.commit() ;
+//        dsgW1.end() ;
+//        
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW2.add(q2) ;
+//        dsgR1.end() ;
+//
+//        dsgW2.commit() ;
+//        dsgW2.end() ;
+//
+//        DatasetGraphTDB dsg = sConn.getBaseDataset() ; 
+//        assertTrue(dsg.contains(q1)) ;
+//        assertTrue(dsg.contains(q2)) ;
+//    }
+//
+//    @Test public void trans_readBlock_11()
+//    {
+//        // JENA-91
+//        // READ(start)-WRITE-WRITE-WRITE-READ(finish)-check
+//        StoreConnection sConn = getStoreConnection() ;
+//
+//        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW1.add(q1) ;
+//        dsgW1.commit() ;
+//        dsgW1.end() ;
+//        
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW2.add(q2) ;
+//        dsgW2.commit() ;
+//        dsgW2.end() ;
+//
+//        DatasetGraphTxn dsgW3 = sConn.begin(ReadWrite.WRITE) ;
+//        dsgW3.add(q3) ;
+//        dsgW3.commit() ;
+//        dsgW3.end() ;
+//
+//        dsgR1.end() ;
+//        
+//        DatasetGraphTDB dsg = sConn.getBaseDataset() ; 
+//        assertTrue(dsg.contains(q1)) ;
+//        assertTrue(dsg.contains(q2)) ;
+//        assertTrue(dsg.contains(q3)) ;
+//    }
+//    
+//    
+//    // Not a test
+//    //@Test (expected=TDBTransactionException.class)
+//    public void trans_20()
+//    {
+//        // Two WRITE : This would block.
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
+//        DatasetGraphTxn dsgW2 = sConn.begin(ReadWrite.WRITE) ;
+//    }
+//    
+//    @Test (expected=TDBException.class) 
+//    public void trans_21()
+//    {
+//        // READ-add
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsg = sConn.begin(ReadWrite.READ) ;
+//        dsg.add(q) ;
+//    }
+//    
+//    @Test //(expected=TDBException.class) 
+//    public void trans_22()
+//    {
+//        // WRITE-close causes implicit abort
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
+//        dsg.add(q) ;
+//        dsg.end() ;
+//    }
+//    
+//    //@Test 
+//    public void trans_30()
+//    {
+//        // WRITE lots
+//        StoreConnection sConn = getStoreConnection() ;
+//        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
+//        for ( int i = 0 ; i < 600 ; i++ )
+//        {
+//            Quad q = SSE.parseQuad("(_ <s> <p> "+i+")") ;
+//            dsg.add(q) ;
+//        }
+//        dsg.commit() ;
+//        dsg.end() ;
+//    }
+//    
     @Test public void trans_50()
     {
         // Expel.

Modified: jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java?rev=1346556&r1=1346555&r2=1346556&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java
(original)
+++ jena/trunk/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSequentialDisk.java
Tue Jun  5 20:01:27 2012
@@ -18,6 +18,8 @@
 
 package com.hp.hpl.jena.tdb.transaction;
 
+import java.io.File ;
+
 import org.junit.After ;
 import org.junit.Before ;
 import org.openjena.atlas.lib.FileOps ;
@@ -39,6 +41,10 @@ public class TestTransSequentialDisk ext
         DIR = nonDeleteableMMapFiles ? ConfigTest.getTestingDirUnique() : ConfigTest.getTestingDir()
;
 		FileOps.ensureDir(DIR) ;
 		FileOps.clearDirectory(DIR) ;
+		
+        File d = new File(DIR) ;
+        if ( d.list().length > 2 )  // . and ..
+            throw new RuntimeException("not empty") ;
     }
 
     @After public void after() {} 



Mime
View raw message