clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: CLEREZZA-854: added test with multiple path virtual property values
Date Wed, 18 Dec 2013 07:22:22 GMT
Updated Branches:
  refs/heads/master fd91fa3d8 -> 3a9b5fa96


CLEREZZA-854: added test with multiple path virtual property values

Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/3a9b5fa9
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/3a9b5fa9
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/3a9b5fa9

Branch: refs/heads/master
Commit: 3a9b5fa96e0157fdbaf2913df4b91a1590819145
Parents: fd91fa3
Author: retobg <reto@apache.org>
Authored: Wed Dec 18 08:22:04 2013 +0100
Committer: retobg <reto@apache.org>
Committed: Wed Dec 18 08:22:04 2013 +0100

----------------------------------------------------------------------
 .../clerezza/rdf/cris/GraphIndexerTest.java     | 44 ++++++++++++++++----
 1 file changed, 36 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/3a9b5fa9/rdf.cris/core/src/test/java/org/apache/clerezza/rdf/cris/GraphIndexerTest.java
----------------------------------------------------------------------
diff --git a/rdf.cris/core/src/test/java/org/apache/clerezza/rdf/cris/GraphIndexerTest.java
b/rdf.cris/core/src/test/java/org/apache/clerezza/rdf/cris/GraphIndexerTest.java
index 82cad69..5d6733c 100644
--- a/rdf.cris/core/src/test/java/org/apache/clerezza/rdf/cris/GraphIndexerTest.java
+++ b/rdf.cris/core/src/test/java/org/apache/clerezza/rdf/cris/GraphIndexerTest.java
@@ -97,14 +97,30 @@ public class GraphIndexerTest {
             node.addPropertyValue(FOAF.firstName, "William");
             node.addPropertyValue(FOAF.lastName, "Smith");
             node.addPropertyValue(RDFS.comment, "A person with two names");
-            //and a pet
-            BNode pet = new BNode();
-            node.addProperty(ownsPetProperty, pet);
-
-            GraphNode petNode = new GraphNode(pet, dataGraph);
-            petNode.addPropertyValue(FOAF.name, "Silvio");
+            {
+                //and a pet
+                BNode pet = new BNode();
+                node.addProperty(ownsPetProperty, pet);
+                GraphNode petNode = new GraphNode(pet, dataGraph);
+                petNode.addPropertyValue(FOAF.name, "Silvio");
+            }
+            {
+                //and another pet
+                BNode pet = new BNode();
+                node.addProperty(ownsPetProperty, pet);
+                GraphNode petNode = new GraphNode(pet, dataGraph);
+                petNode.addPropertyValue(FOAF.name, "Beni");
+            }
+            {
+                //and another pet
+                NonLiteral pet = new UriRef("http://example.org/pets/Robi");
+                node.addProperty(ownsPetProperty, pet);
+                GraphNode petNode = new GraphNode(pet, dataGraph);
+                petNode.addPropertyValue(FOAF.name, "Robi");
+                petNode.addPropertyValue(FOAF.name, "Robert");
+            }
         }
-        
+
         {
             //a person with languages first names
             GraphNode node = new GraphNode(new UriRef(Util.createURN5()), dataGraph);
@@ -368,6 +384,18 @@ public class GraphIndexerTest {
                 List<NonLiteral> results = service.findResources(pathProperty, "Silvio");
                 Assert.assertEquals(1, results.size());
             }
+            {
+                List<NonLiteral> results = service.findResources(pathProperty, "Beni");
+                Assert.assertEquals(1, results.size());
+            }
+            {
+                List<NonLiteral> results = service.findResources(pathProperty, "Robi");
+                Assert.assertEquals(1, results.size());
+            }
+            {
+                List<NonLiteral> results = service.findResources(pathProperty, "Robert");
+                Assert.assertEquals(1, results.size());
+            }
             //and a late addtition, lets give Frank a pet
             GraphNode frank = new GraphNode(service.findResources(FOAF.firstName, "Frank").get(0),
dataGraph);
             GraphNode pet = new GraphNode(new UriRef("http://example.org/pet"), dataGraph);
@@ -402,7 +430,7 @@ public class GraphIndexerTest {
 
                 //there are 7 distinct first names
 
-                Assert.assertEquals(1, facets.size());
+                Assert.assertEquals(2, facets.size());
                 /*//the firstname "Frank" appears once
                  Assert.assertEquals(new Integer(1), facetCollector.getFacetValue(firstName,
"Frank"));
                  //the firstname "frank" never appears


Mime
View raw message