commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [01/46] incubator-commonsrdf git commit: COMMONSRDF-8 Verify factory.createBlankNode("..") is local
Date Thu, 02 Jun 2016 16:31:38 GMT
Repository: incubator-commonsrdf
Updated Branches:
  refs/heads/quad c7e1a5bde -> 14e505e33


COMMONSRDF-8 Verify factory.createBlankNode("..") is local

e.g. creation of the same name on two different
factories are different


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/d0ae0ca4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/d0ae0ca4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/d0ae0ca4

Branch: refs/heads/quad
Commit: d0ae0ca418b4787429a5aa3aa2273c9f3ee49aec
Parents: c607938
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Mon Apr 13 11:24:30 2015 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Sat Mar 12 18:28:17 2016 +0000

----------------------------------------------------------------------
 .../commons/rdf/api/AbstractGraphTest.java      |  8 ++++----
 .../rdf/api/AbstractRDFTermFactoryTest.java     | 20 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/d0ae0ca4/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java b/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
index 22a32d1..06ea124 100644
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractGraphTest.java
@@ -370,10 +370,10 @@ public abstract class AbstractGraphTest {
 
         IRI name = factory1.createIRI("http://xmlns.com/foaf/0.1/name");
         Graph g1 = factory1.createGraph();
-        BlankNode b1 = factory1.createBlankNode();
+        BlankNode b1 = factory1.createBlankNode("b1");
         g1.add(b1, name, factory1.createLiteral("Alice"));
 
-        BlankNode b2 = factory1.createBlankNode();
+        BlankNode b2 = factory1.createBlankNode("b2");
         g1.add(b2, name, factory1.createLiteral("Bob"));
 
         IRI hasChild = factory1.createIRI("http://example.com/hasChild");
@@ -392,10 +392,10 @@ public abstract class AbstractGraphTest {
 
         Graph g2 = factory2.createGraph();
 
-        BlankNode b1 = factory2.createBlankNode();
+        BlankNode b1 = factory2.createBlankNode("b1");
         g2.add(b1, name, factory2.createLiteral("Charlie"));
 
-        BlankNode b2 = factory2.createBlankNode();
+        BlankNode b2 = factory2.createBlankNode("b2");
         g2.add(b2, name, factory2.createLiteral("Dave"));
 
         IRI hasChild = factory2.createIRI("http://example.com/hasChild");

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/d0ae0ca4/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
----------------------------------------------------------------------
diff --git a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
index 1c62161..4f5de6b 100644
--- a/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
+++ b/api/src/test/java/org/apache/commons/rdf/api/AbstractRDFTermFactoryTest.java
@@ -114,6 +114,26 @@ public abstract class AbstractRDFTermFactoryTest {
     }
 
     @Test
+    public void testCreateBlankNodeIdentifierTwiceDifferentFactories() throws Exception {
+        BlankNode bnode1, differentFactory;
+        try {
+            bnode1 = factory.createBlankNode("example1");
+            // it should differ from a second factory
+            differentFactory = createFactory().createBlankNode("example1");
+        } catch (UnsupportedOperationException ex) {
+            Assume.assumeNoException(ex);
+            return;
+        }
+        //
+        assertNotEquals(bnode1, differentFactory);
+        assertNotEquals(bnode1.internalIdentifier(),
+                differentFactory.internalIdentifier());
+        // but not
+        //assertNotEquals(bnode1.ntriplesString(), differentFactory.ntriplesString());
+    }
+
+
+    @Test
     public void testCreateGraph() {
         Graph graph;
         try {


Mime
View raw message