UTs for EXISTS/NOT EXISTS.

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

Branch: refs/heads/master
Commit: 50f277fbcb697c9e57d039cc5dac2a24f08e89e1
Parents: f547447
Author: Jeremy Coulon <jeremy.cou...@3ds.com>
Authored: Mon Apr 9 15:48:18 2018 +0200
Committer: Jeremy Coulon <jeremy.cou...@3ds.com>
Committed: Mon Apr 9 15:48:18 2018 +0200

----------------------------------------------------------------------
 .../jena/sparql/core/TestSpecialGraphNames.java | 36 ++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/50f277fb/jena-arq/src/test/java/org/apache/jena/sparql/core/TestSpecialGraphNames.java
----------------------------------------------------------------------
diff --git 
a/jena-arq/src/test/java/org/apache/jena/sparql/core/TestSpecialGraphNames.java 
b/jena-arq/src/test/java/org/apache/jena/sparql/core/TestSpecialGraphNames.java
index 77fd1e2..c9d06e6 100644
--- 
a/jena-arq/src/test/java/org/apache/jena/sparql/core/TestSpecialGraphNames.java
+++ 
b/jena-arq/src/test/java/org/apache/jena/sparql/core/TestSpecialGraphNames.java
@@ -217,6 +217,42 @@ public class TestSpecialGraphNames {
         List<Binding> results = exec("(minus (bgp (?s ?p ?o)) (bgp (<x2> ?p 
?o)))", QUADBLOCKS) ;
         assertEquals(2, results.size()) ;
     }
+    
+    @Test
+    public void filter_exists_1() {
+        List<Binding> results = exec("(filter (exists (bgp (?s <p> <o>))) (bgp 
(?s ?p ?o)))", TRIPLES) ;
+        assertEquals(1, results.size()) ;
+    }
+    
+    @Test
+    public void filter_exists_2() {
+        List<Binding> results = exec("(filter (exists (bgp (?s <p> <o>))) (bgp 
(?s ?p ?o)))", QUADS) ;
+        assertEquals(1, results.size()) ;
+    }
+    
+    @Test
+    public void filter_exists_3() {
+        List<Binding> results = exec("(filter (exists (bgp (?s <p> <o>))) (bgp 
(?s ?p ?o)))", QUADBLOCKS) ;
+        assertEquals(1, results.size()) ;
+    }
+    
+    @Test
+    public void filter_notexists_1() {
+        List<Binding> results = exec("(filter (notexists (bgp (?s <p> <o>))) 
(bgp (?s ?p ?o)))", TRIPLES) ;
+        assertEquals(4, results.size()) ;
+    }
+    
+    @Test
+    public void filter_notexists_2() {
+        List<Binding> results = exec("(filter (notexists (bgp (?s <p> <o>))) 
(bgp (?s ?p ?o)))", QUADS) ;
+        assertEquals(4, results.size()) ;
+    }
+    
+    @Test
+    public void filter_notexists_3() {
+        List<Binding> results = exec("(filter (notexists (bgp (?s <p> <o>))) 
(bgp (?s ?p ?o)))", QUADBLOCKS) ;
+        assertEquals(4, results.size()) ;
+    }
 
     private List<Binding> exec(String string, Mode mode) {
         Op op = op(string, mode) ;

Reply via email to