jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From casta...@apache.org
Subject svn commit: r1160372 - /incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java
Date Mon, 22 Aug 2011 19:08:22 GMT
Author: castagna
Date: Mon Aug 22 19:08:22 2011
New Revision: 1160372

URL: http://svn.apache.org/viewvc?rev=1160372&view=rev
Log:
JENA-91 - This stills fail. Writing to a named graph in writeData(...) seems to be different,
if we write to the default graph there is no error (only well known warnings which are not
relevant in this case).

Modified:
    incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java

Modified: incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java
URL: http://svn.apache.org/viewvc/incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java?rev=1160372&r1=1160371&r2=1160372&view=diff
==============================================================================
--- incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java
(original)
+++ incubator/jena/Experimental/TxTDB/trunk/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransSystem.java
Mon Aug 22 19:08:22 2011
@@ -37,13 +37,6 @@ import org.slf4j.LoggerFactory ;
 
 import com.hp.hpl.jena.datatypes.xsd.XSDDatatype ;
 import com.hp.hpl.jena.graph.Node ;
-import com.hp.hpl.jena.query.Dataset ;
-import com.hp.hpl.jena.rdf.model.Literal ;
-import com.hp.hpl.jena.rdf.model.Model ;
-import com.hp.hpl.jena.rdf.model.Property ;
-import com.hp.hpl.jena.rdf.model.Resource ;
-import com.hp.hpl.jena.rdf.model.Statement ;
-import com.hp.hpl.jena.rdf.model.StmtIterator ;
 import com.hp.hpl.jena.sparql.core.Quad ;
 import com.hp.hpl.jena.sparql.sse.SSE ;
 import com.hp.hpl.jena.tdb.ConfigTest ;
@@ -173,7 +166,7 @@ public class TestTransSystem
                     int x2 = count("SELECT * { ?s ?p ?o }", dsg) ;
                     if (x1 != x2) log.warn(format("READER: %s Change seen: %d/%d : id=%d:
i=%d",
                                                   dsg.getTransaction().getLabel(), x1, x2,
id, i)) ;
-                    pause(1000) ; // modelRead(dsg) ; // Temporary, see JENA-91
+                    pause(1000) ; // Temporary, see JENA-91
                     log.debug("reader finish " + id + "/" + i) ;
                     dsg.close() ;
                     dsg = null ;
@@ -322,7 +315,6 @@ public class TestTransSystem
             @Override
             protected int change(DatasetGraphTxn dsg, int id, int i)
             {  
-                // writeData(dsg, id, i) ; pause(1000) ; // Temporary, see JENA-91 
                 return changeProc(dsg, id, i) ; 
             }
         } ;
@@ -332,8 +324,8 @@ public class TestTransSystem
             @Override
             protected int change(DatasetGraphTxn dsg, int id, int i)
             { 
-                writeData(dsg, id, i) ; // pause(1000) ; // Temporary, see JENA-91
-                return changeProc(dsg, id, i) ; 
+                writeData(dsg, id, i) ; // Temporary, see JENA-91
+                return changeProc(dsg, id, i) ;
             }
         } ;
 
@@ -378,43 +370,8 @@ public class TestTransSystem
     // Temporary, see JENA-91
     static void writeData(DatasetGraphTxn dsg, int id, int i) 
     {
-        Dataset ds = dsg.toDataset() ;
-        Model m = ds.getNamedModel("testUri") ;
-        m.removeAll() ;
-        Resource r = m.createResource("testUri") ;
-        Property p = m.createProperty("http://mydomain/xmlns/test/resourceId") ;
-        String object = id + "_" + i ;
-        Literal l = m.createLiteral(object) ;
-        m.add(r, p, l) ;
-        m.close() ;
-    }
-    
-    // Temporary, see JENA-91
-    static void modelRead(DatasetGraphTxn dsg) 
-    {
-        Dataset ds = dsg.toDataset() ;
-        Model m = ds.getNamedModel("testUri") ;
-        StmtIterator statements = m.listStatements() ;
-        try 
-        {
-            while (statements.hasNext()) 
-            {
-                Statement statement = statements.next() ;
-                if ("testUri".equals(statement.getSubject().getURI())) 
-                {
-                    String predicate = statement.getPredicate().getURI() ;
-                    if ("http://mydomain/xmlns/test/resourceId".equals(predicate)) 
-                    {
-                        String value = statement.getString() ;
-                    }
-                }
-            }
-        } 
-        finally 
-        {
-            statements.close() ;
-            m.close() ;
-        }
+        // dsg.add( Quad.defaultGraphNodeGenerated, Node.createURI("S"), Node.createURI("P"),
Node.createLiteral(id + "_" + i) ) ; // Temporary, JENA-91
+        dsg.add( Node.createURI("G"), Node.createURI("S"), Node.createURI("P"), Node.createLiteral(id
+ "_" + i) ) ;
     }
     
     static void pause(int maxInternal)



Mime
View raw message