You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by ha...@apache.org on 2015/04/18 08:57:59 UTC
clerezza git commit: CLEREZZA-961: Used stricter assertion in
SparqlPreParserTest
Repository: clerezza
Updated Branches:
refs/heads/master 70f7fc08e -> 27c750e0b
CLEREZZA-961: Used stricter assertion in SparqlPreParserTest
Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/27c750e0
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/27c750e0
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/27c750e0
Branch: refs/heads/master
Commit: 27c750e0b468a0a666f6beb80222e4f22ad03a84
Parents: 70f7fc0
Author: Hasan <ha...@apache.org>
Authored: Sat Apr 18 08:57:24 2015 +0200
Committer: Hasan <ha...@apache.org>
Committed: Sat Apr 18 08:57:24 2015 +0200
----------------------------------------------------------------------
.../rdf/core/sparql/SparqlPreParserTest.java | 37 ++++++++++++--------
1 file changed, 23 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/clerezza/blob/27c750e0/rdf/core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
----------------------------------------------------------------------
diff --git a/rdf/core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java b/rdf/core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
index 7827247..1ecd6e9 100644
--- a/rdf/core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
+++ b/rdf/core/src/test/java/org/apache/clerezza/rdf/core/sparql/SparqlPreParserTest.java
@@ -38,7 +38,7 @@ public class SparqlPreParserTest {
class MyTcManager extends TcManager {
@Override
public Set<IRI> listGraphs() {
- Set<IRI> result = new HashSet<IRI>();
+ Set<IRI> result = new HashSet<>();
result.add(NAMED_GRAPH);
return result;
}
@@ -110,7 +110,10 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Assert.assertTrue(referredGraphs.contains(DEFAULT_GRAPH));
+ Set<IRI> expected = new HashSet<>();
+ expected.add(DEFAULT_GRAPH);
+ expected.add(new IRI("http://example.org/mydata"));
+ Assert.assertTrue(referredGraphs.containsAll(expected));
}
@Test
@@ -121,7 +124,10 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Assert.assertTrue(referredGraphs.contains(TEST_GRAPH));
+ Set<IRI> expected = new HashSet<>();
+ expected.add(TEST_GRAPH);
+ expected.add(new IRI("http://example.org/mydata"));
+ Assert.assertTrue(referredGraphs.containsAll(expected));
}
@Test
@@ -209,7 +215,7 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(DEFAULT_GRAPH);
expected.add(TEST_GRAPH);
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -223,7 +229,7 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(DEFAULT_GRAPH);
expected.add(TEST_GRAPH);
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -237,7 +243,7 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(DEFAULT_GRAPH);
expected.add(TEST_GRAPH);
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -251,7 +257,7 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(DEFAULT_GRAPH);
expected.add(TEST_GRAPH);
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -265,7 +271,7 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(DEFAULT_GRAPH);
expected.add(TEST_GRAPH);
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -279,7 +285,7 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(DEFAULT_GRAPH);
expected.add(TEST_GRAPH);
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -341,7 +347,7 @@ public class SparqlPreParserTest {
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(DEFAULT_GRAPH);
expected.add(TEST_GRAPH);
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -371,7 +377,7 @@ public class SparqlPreParserTest {
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(new IRI("http://example.com/names"));
expected.add(new IRI("http://example.com/addresses"));
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -386,7 +392,10 @@ public class SparqlPreParserTest {
SparqlPreParser parser;
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Assert.assertTrue(referredGraphs.contains(TEST_GRAPH));
+ Set<IRI> expected = new HashSet<>();
+ expected.add(TEST_GRAPH);
+ expected.add(DEFAULT_GRAPH);
+ Assert.assertTrue(referredGraphs.containsAll(expected));
}
@Test
@@ -412,7 +421,7 @@ public class SparqlPreParserTest {
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(new IRI("http://example/bookStore2"));
expected.add(new IRI("http://example/bookStore"));
Assert.assertTrue(referredGraphs.containsAll(expected));
@@ -446,7 +455,7 @@ public class SparqlPreParserTest {
parser = new SparqlPreParser(TcManager.getInstance());
Set<IRI> referredGraphs = parser.getReferredGraphs(queryStr, DEFAULT_GRAPH);
- Set<IRI> expected = new HashSet<IRI>();
+ Set<IRI> expected = new HashSet<>();
expected.add(new IRI("http://example/bookStore2"));
expected.add(new IRI("http://example/bookStore"));
Assert.assertTrue(referredGraphs.containsAll(expected));