You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by cl...@apache.org on 2013/10/27 16:47:58 UTC
svn commit: r1536157 -
/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/GraphContractTest.java
Author: claude
Date: Sun Oct 27 15:47:58 2013
New Revision: 1536157
URL: http://svn.apache.org/r1536157
Log:
fixed some error messages
modified testIterator_Remove() to catch UnsupportedOperationExcpetion
Modified:
jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/GraphContractTest.java
Modified: jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/GraphContractTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/GraphContractTest.java?rev=1536157&r1=1536156&r2=1536157&view=diff
==============================================================================
--- jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/GraphContractTest.java (original)
+++ jena/Experimental/new-test/src/test/java/com/hp/hpl/jena/graph/GraphContractTest.java Sun Oct 27 15:47:58 2013
@@ -179,7 +179,6 @@ public class GraphContractTest<T extends
public void testClose() {
Graph graph = graphWith(getProducer().newInstance(),
"S P O; S P2 O2; S3 P P3");
- System.out.println("Graph type in close: " + graph.getClass());
graph.getEventManager().register(GL);
assertFalse("Graph was constructed closed", graph.isClosed());
@@ -1124,7 +1123,7 @@ public class GraphContractTest<T extends
}
assertTrue(g.isEmpty());
} catch (UnsupportedOperationException e) {
- fail("Error attempting to remove nodes" + e.getMessage());
+ fail("Error attempting to remove nodes " + e.getMessage());
}
}
}
@@ -1305,17 +1304,21 @@ public class GraphContractTest<T extends
public void testIterator_Remove() {
Graph graph = graphWith(getProducer().newInstance(), "a R b; b S e");
if (graph.getCapabilities().iteratorRemoveAllowed()) {
-
- graph.getEventManager().register(GL);
- txnBegin(graph);
-
- Triple toRemove = triple("a R b");
- ExtendedIterator<Triple> rtr = graph.find(toRemove);
- assertTrue("ensure a(t least) one triple", rtr.hasNext());
- rtr.next();
- rtr.remove();
- rtr.close();
- GL.assertHas("delete", graph, toRemove);
+ try {
+ graph.getEventManager().register(GL);
+ txnBegin(graph);
+
+ Triple toRemove = triple("a R b");
+ ExtendedIterator<Triple> rtr = graph.find(toRemove);
+ assertTrue("ensure a(t least) one triple", rtr.hasNext());
+ rtr.next();
+ rtr.remove();
+ rtr.close();
+ GL.assertHas("delete", graph, toRemove);
+ } catch (UnsupportedOperationException e) {
+ fail("Error attempting to remove nodes " + e.getMessage());
+ }
+
}
}
@@ -1488,7 +1491,7 @@ public class GraphContractTest<T extends
it.removeNext();
assertEquals(0, g.size());
} catch (UnsupportedOperationException e) {
- fail("Error attempting to remove nodes" + e.getMessage());
+ fail("Error attempting to remove nodes " + e.getMessage());
}
}
}
@@ -1593,7 +1596,7 @@ public class GraphContractTest<T extends
assertFalse(g.find(Node.ANY, node("R"), Node.ANY).hasNext());
assertFalse(g.find(Node.ANY, Node.ANY, node("y")).hasNext());
} catch (UnsupportedOperationException e) {
- fail("Error attempting to remove nodes" + e.getMessage());
+ fail("Error attempting to remove nodes " + e.getMessage());
}
}
}
@@ -1608,7 +1611,7 @@ public class GraphContractTest<T extends
it.removeNext();
assertFalse(g.find(Node.ANY, Node.ANY, Node.ANY).hasNext());
} catch (UnsupportedOperationException e) {
- fail("Error attempting to remove nodes" + e.getMessage());
+ fail("Error attempting to remove nodes " + e.getMessage());
}
}
}
@@ -1623,7 +1626,7 @@ public class GraphContractTest<T extends
it.removeNext();
assertFalse(g.find(Node.ANY, Node.ANY, Node.ANY).hasNext());
} catch (UnsupportedOperationException e) {
- fail("Error attempting to remove nodes" + e.getMessage());
+ fail("Error attempting to remove nodes " + e.getMessage());
}
}
}
@@ -1639,7 +1642,7 @@ public class GraphContractTest<T extends
assertFalse(g.find(Node.ANY, Node.ANY, Node.ANY).hasNext());
} catch (UnsupportedOperationException e) {
- fail("Error attempting to remove nodes" + e.getMessage());
+ fail("Error attempting to remove nodes " + e.getMessage());
}
}
}