jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From casta...@apache.org
Subject svn commit: r1185218 - /incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
Date Mon, 17 Oct 2011 14:40:54 GMT
Author: castagna
Date: Mon Oct 17 14:40:54 2011
New Revision: 1185218

URL: http://svn.apache.org/viewvc?rev=1185218&view=rev
Log:
Reverted changes.

Modified:
    incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java

Modified: incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java?rev=1185218&r1=1185217&r2=1185218&view=diff
==============================================================================
--- incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
(original)
+++ incubator/jena/Jena2/TDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
Mon Oct 17 14:40:54 2011
@@ -18,40 +18,36 @@
 
 package com.hp.hpl.jena.tdb.transaction ;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.util.Iterator;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.openjena.atlas.iterator.Iter;
-import org.openjena.atlas.lib.FileOps;
-import org.openjena.atlas.lib.Pair;
-
-import com.hp.hpl.jena.sparql.core.Quad;
-import com.hp.hpl.jena.sparql.sse.SSE;
-import com.hp.hpl.jena.tdb.ConfigTest;
-import com.hp.hpl.jena.tdb.DatasetGraphTxn;
-import com.hp.hpl.jena.tdb.ReadWrite;
-import com.hp.hpl.jena.tdb.StoreConnection;
-import com.hp.hpl.jena.tdb.TDB;
-import com.hp.hpl.jena.tdb.TDBFactory;
-import com.hp.hpl.jena.tdb.base.block.FileMode;
-import com.hp.hpl.jena.tdb.base.file.FileFactory;
-import com.hp.hpl.jena.tdb.base.file.Location;
-import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile;
-import com.hp.hpl.jena.tdb.store.DatasetGraphTDB;
-import com.hp.hpl.jena.tdb.sys.Names;
-import com.hp.hpl.jena.tdb.sys.SystemTDB;
-import com.hp.hpl.jena.tdb.sys.TDBMaker;
+import java.io.File ;
+import java.nio.ByteBuffer ;
+import java.util.Iterator ;
+
+import org.junit.After ;
+import org.junit.Before ;
+import org.junit.Test ;
+import org.openjena.atlas.junit.BaseTest ;
+import org.openjena.atlas.lib.FileOps ;
+import org.openjena.atlas.lib.Pair ;
+
+import com.hp.hpl.jena.sparql.core.Quad ;
+import com.hp.hpl.jena.sparql.sse.SSE ;
+import com.hp.hpl.jena.tdb.ConfigTest ;
+import com.hp.hpl.jena.tdb.DatasetGraphTxn ;
+import com.hp.hpl.jena.tdb.ReadWrite ;
+import com.hp.hpl.jena.tdb.StoreConnection ;
+import com.hp.hpl.jena.tdb.TDB ;
+import com.hp.hpl.jena.tdb.TDBFactory ;
+import com.hp.hpl.jena.tdb.base.block.FileMode ;
+import com.hp.hpl.jena.tdb.base.file.FileFactory ;
+import com.hp.hpl.jena.tdb.base.file.Location ;
+import com.hp.hpl.jena.tdb.base.objectfile.ObjectFile ;
+import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
+import com.hp.hpl.jena.tdb.sys.Names ;
+import com.hp.hpl.jena.tdb.sys.SystemTDB ;
+import com.hp.hpl.jena.tdb.sys.TDBMaker ;
 
 /** Test of re-attaching to a pre-existing database */  
-public class TestTransRestart {
+public class TestTransRestart extends BaseTest {
     static { 
         // Only if run directly, not in test suite.
         if ( false )
@@ -111,10 +107,8 @@ public class TestTransRestart {
     }
     
     @Test
-    public void Txn() {
-        assertTrue(FileOps.exists(path));
-//        assertEquals (1L, countQuads()) ;
-//        assertEquals (3, countRDFNodes()) ;
+    public void testTxn() {
+        assertEquals (3, countRDFNodes()) ;
 
         StoreConnection sc = StoreConnection.make(location) ; 
         DatasetGraphTxn dsg = sc.begin(ReadWrite.WRITE) ;
@@ -127,11 +121,8 @@ public class TestTransRestart {
     }
     
     @Test
-    public void Plain() {
-        assertTrue(FileOps.exists(path));
-//        assertEquals (1L, countQuads()) ;
-//        assertEquals (3, countRDFNodes()) ;
-
+    public void testPlain() {
+        assertEquals (3, countRDFNodes()) ;
         DatasetGraphTDB dsg = TDBFactory.createDatasetGraph(location) ;
         assertTrue(dsg.contains(quad1)) ;
         dsg.add(quad2) ;
@@ -154,12 +145,4 @@ public class TestTransRestart {
         return count ;
     }
     
-    private long countQuads() {
-        DatasetGraphTDB dsg = TDBFactory.createDatasetGraph(location) ;
-        long count = Iter.count(dsg.find()) ;
-        dsg.close() ;
-        TDBMaker.releaseDataset(dsg) ;
-        return count ;
-    }
-    
 }



Mime
View raw message