jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cla...@apache.org
Subject [49/50] [abbrv] jena git commit: Expose test lifecycle (fileDataset)
Date Sat, 16 May 2015 08:59:31 GMT
Expose test lifecycle (fileDataset)


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/8d53fedc
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/8d53fedc
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/8d53fedc

Branch: refs/heads/add-contract-tests
Commit: 8d53fedc0f45c39725054251a9b4cceee57941d9
Parents: 8fd7226
Author: Andy Seaborne <andy@apache.org>
Authored: Fri May 15 13:00:09 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Fri May 15 13:00:09 2015 +0100

----------------------------------------------------------------------
 .../apache/jena/sparql/graph/GraphsTests.java   | 33 +++++++++++---------
 1 file changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/8d53fedc/jena-arq/src/test/java/org/apache/jena/sparql/graph/GraphsTests.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/graph/GraphsTests.java b/jena-arq/src/test/java/org/apache/jena/sparql/graph/GraphsTests.java
index 69cb15c..1060295 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/graph/GraphsTests.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/graph/GraphsTests.java
@@ -50,25 +50,28 @@ public abstract class GraphsTests extends BaseTest
         if ( dataset == null )
         {
             dataset = createDataset() ;
-            // Load default model.
-            // Load graph 1
-            // Load graph 2.
-            dataset.getDefaultModel().getGraph().add(SSE.parseTriple("(<x> <p>
'Default graph')")) ;
-            
-            Model m1 = dataset.getNamedModel(graph1) ;
-            m1.getGraph().add(SSE.parseTriple("(<x> <p> 'Graph 1')")) ;
-            m1.getGraph().add(SSE.parseTriple("(<x> <p> 'ZZZ')")) ;
-            
-            Model m2 = dataset.getNamedModel(graph2) ;
-            m2.getGraph().add(SSE.parseTriple("(<x> <p> 'Graph 2')")) ;
-            m2.getGraph().add(SSE.parseTriple("(<x> <p> 'ZZZ')")) ;
-            
-            calcUnion.add(m1) ;
-            calcUnion.add(m2) ;
+            fillDataset(dataset) ;
         }
         return dataset ;
     }
     
+    protected void fillDataset(Dataset dataset) {
+        // Load default model.
+        // Load graph 1
+        // Load graph 2.
+        dataset.getDefaultModel().getGraph().add(SSE.parseTriple("(<x> <p> 'Default
graph')")) ;
+        
+        Model m1 = dataset.getNamedModel(graph1) ;
+        m1.getGraph().add(SSE.parseTriple("(<x> <p> 'Graph 1')")) ;
+        m1.getGraph().add(SSE.parseTriple("(<x> <p> 'ZZZ')")) ;
+        
+        Model m2 = dataset.getNamedModel(graph2) ;
+        m2.getGraph().add(SSE.parseTriple("(<x> <p> 'Graph 2')")) ;
+        m2.getGraph().add(SSE.parseTriple("(<x> <p> 'ZZZ')")) ;
+        calcUnion.add(m1) ;
+        calcUnion.add(m2) ;
+    }
+
     String queryString =  "SELECT * {?s ?p ?o}" ;
     
     @Test public void graph1() 


Mime
View raw message