clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From flor...@apache.org
Subject [2/2] git commit: remove deprecated use of Junit's assert
Date Tue, 23 Sep 2014 18:06:56 GMT
remove deprecated use of Junit's assert


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

Branch: refs/heads/CLEREZZA-950
Commit: 4182228087a74f577ba1a3d983e0827f91a94925
Parents: a0842b6
Author: Florent André <florent@apache.org>
Authored: Tue Sep 23 20:05:29 2014 +0200
Committer: Florent André <florent@apache.org>
Committed: Tue Sep 23 20:05:29 2014 +0200

----------------------------------------------------------------------
 .../clerezza/rdf/utils/TestGraphNode.java       | 65 ++++++++++----------
 1 file changed, 32 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/41822280/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java
index 51267cb..0bf0e1e 100644
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java
+++ b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java
@@ -23,7 +23,6 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
 
-import junit.framework.Assert;
 import static org.junit.Assert.*;
 
 import org.junit.Test;
@@ -59,10 +58,10 @@ public class TestGraphNode {
         g.add(new TripleImpl(property1, property1, bNode2));
         g.add(new TripleImpl(property1, property1, new PlainLiteralImpl("bla bla")));
         GraphNode n = new GraphNode(bNode1, g);
-        Assert.assertEquals(4, n.getNodeContext().size());
+        assertEquals(4, n.getNodeContext().size());
         n.deleteNodeContext();
-        Assert.assertEquals(1, g.size());
-        Assert.assertFalse(n.getObjects(property2).hasNext());
+        assertEquals(1, g.size());
+        assertFalse(n.getObjects(property2).hasNext());
     }
 
     @Test
@@ -73,7 +72,7 @@ public class TestGraphNode {
         UriRef property1 = new UriRef("http://example.org/property1");
         GraphNode n = new GraphNode(bNode1, g);
         n.addProperty(property1, bNode2);
-        Assert.assertEquals(1, g.size());
+        assertEquals(1, g.size());
     }
     
     @Test
@@ -114,7 +113,7 @@ public class TestGraphNode {
                 Iterator<GraphNode> objectNodes = node.getObjectNodes(property);
                 while (objectNodes.hasNext()) {
                     GraphNode graphNode = objectNodes.next();
-                    Assert.assertTrue(objects.contains(graphNode.getNode()));
+                    assertTrue(objects.contains(graphNode.getNode()));
                 }
             }
         }
@@ -129,7 +128,7 @@ public class TestGraphNode {
                 Iterator<GraphNode> subjectNodes = node.getSubjectNodes(property);
                 while (subjectNodes.hasNext()) {
                     GraphNode graphNode = subjectNodes.next();
-                    Assert.assertTrue(subjects.contains(graphNode.getNode()));
+                    assertTrue(subjects.contains(graphNode.getNode()));
                 }
             }
         }
@@ -159,11 +158,11 @@ public class TestGraphNode {
         while(properties.hasNext()){
             i++;
             UriRef prop = properties.next();
-            Assert.assertTrue(props.contains(prop));
+            assertTrue(props.contains(prop));
             props.remove(prop);
         }
-        Assert.assertEquals(i, 4);
-        Assert.assertEquals(props.size(), 0);
+        assertEquals(i, 4);
+        assertEquals(props.size(), 0);
 
     }
 
@@ -183,7 +182,7 @@ public class TestGraphNode {
         g.add(new TripleImpl(bNode2, property1, new PlainLiteralImpl("bla bla")));
         GraphNode n = new GraphNode(bNode1, g);
         n.deleteProperties(property1);
-        Assert.assertEquals(3, g.size());
+        assertEquals(3, g.size());
     }
 
     @Test
@@ -202,7 +201,7 @@ public class TestGraphNode {
         g.add(new TripleImpl(bNode2, property1, new PlainLiteralImpl("bla bla")));
         GraphNode n = new GraphNode(bNode1, g);
         n.deleteProperty(property1, new PlainLiteralImpl("literal"));
-        Assert.assertEquals(4, g.size());
+        assertEquals(4, g.size());
     }
 
     @Test
@@ -231,21 +230,21 @@ public class TestGraphNode {
                 new SimpleMGraph(initialGraph.iterator()));
 
         node.replaceWith(newUriRef, true);
-        Assert.assertEquals(5, node.getGraph().size());
+        assertEquals(5, node.getGraph().size());
         Triple expectedTriple1 = new TripleImpl(bNode1, newUriRef, literal1);
         Triple expectedTriple2 = new TripleImpl(bNode1, property2, newUriRef);
         Triple expectedTriple3 = new TripleImpl(newUriRef, newUriRef, bNode2);
         Triple expectedTriple4 = new TripleImpl(newUriRef, newUriRef, literal2);
 
-        Assert.assertTrue(node.getGraph().contains(expectedTriple1));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple2));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple3));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple4));
+        assertTrue(node.getGraph().contains(expectedTriple1));
+        assertTrue(node.getGraph().contains(expectedTriple2));
+        assertTrue(node.getGraph().contains(expectedTriple3));
+        assertTrue(node.getGraph().contains(expectedTriple4));
 
-        Assert.assertFalse(node.getGraph().contains(triple1));
-        Assert.assertFalse(node.getGraph().contains(triple2));
-        Assert.assertFalse(node.getGraph().contains(triple4));
-        Assert.assertFalse(node.getGraph().contains(triple5));
+        assertFalse(node.getGraph().contains(triple1));
+        assertFalse(node.getGraph().contains(triple2));
+        assertFalse(node.getGraph().contains(triple4));
+        assertFalse(node.getGraph().contains(triple5));
 
         node = new GraphNode(property1, new SimpleMGraph(initialGraph.iterator()));
         node.replaceWith(newBnode);
@@ -253,25 +252,25 @@ public class TestGraphNode {
         Triple expectedTriple6 = new TripleImpl(newBnode, property1, bNode2);
         Triple expectedTriple7 = new TripleImpl(newBnode, property1, literal2);
 
-        Assert.assertTrue(node.getGraph().contains(triple1));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple5));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple6));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple7));
+        assertTrue(node.getGraph().contains(triple1));
+        assertTrue(node.getGraph().contains(expectedTriple5));
+        assertTrue(node.getGraph().contains(expectedTriple6));
+        assertTrue(node.getGraph().contains(expectedTriple7));
 
         node = new GraphNode(literal1, new SimpleMGraph(initialGraph.iterator()));
         node.replaceWith(newBnode);
         Triple expectedTriple8 = new TripleImpl(bNode1, property1, newBnode);
-        Assert.assertTrue(node.getGraph().contains(expectedTriple8));
+        assertTrue(node.getGraph().contains(expectedTriple8));
 
         node = new GraphNode(property1, new SimpleMGraph(initialGraph.iterator()));
         node.replaceWith(newUriRef);
         Triple expectedTriple9 = new TripleImpl(bNode1, property2, newUriRef);
         Triple expectedTriple10 = new TripleImpl(newUriRef, property1, bNode2);
         Triple expectedTriple11 = new TripleImpl(newUriRef, property1, literal2);
-        Assert.assertTrue(node.getGraph().contains(triple1));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple9));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple10));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple11));
+        assertTrue(node.getGraph().contains(triple1));
+        assertTrue(node.getGraph().contains(expectedTriple9));
+        assertTrue(node.getGraph().contains(expectedTriple10));
+        assertTrue(node.getGraph().contains(expectedTriple11));
     }
 
     @Test
@@ -282,10 +281,10 @@ public class TestGraphNode {
         UriRef property1 = new UriRef("http://example.org/property1");
         GraphNode n = new GraphNode(bNode1, g);
         n.addProperty(property1, bNode2);
-        Assert.assertTrue(n.equals(new GraphNode(bNode1, g)));
-        Assert.assertFalse(n.equals(new GraphNode(bNode2, g)));
+        assertTrue(n.equals(new GraphNode(bNode1, g)));
+        assertFalse(n.equals(new GraphNode(bNode2, g)));
         GraphNode n2 = null;
-        Assert.assertFalse(n.equals(n2));
+        assertFalse(n.equals(n2));
     }
 
     private Set<Resource> createSet(Iterator<? extends Resource> resources) {


Mime
View raw message