You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/04/15 19:48:00 UTC

[38/50] incubator-tinkerpop git commit: Used convertId in GraphTest checks of NoSuchElementException on Graph.vertices/edges #TINKERPOP3-633

Used convertId in GraphTest checks of NoSuchElementException on Graph.vertices/edges #TINKERPOP3-633

Remove two redundant tests from EdgeTest and VertexTest.


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

Branch: refs/heads/variables
Commit: db11d3b758376e596584e66ae781b2b7e3989109
Parents: c13c9ba
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Apr 15 07:42:26 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Apr 15 07:42:26 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/EdgeTest.java      |  6 ------
 .../tinkerpop/gremlin/structure/GraphTest.java     | 17 +++++++----------
 .../tinkerpop/gremlin/structure/VertexTest.java    |  6 ------
 3 files changed, 7 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/db11d3b7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
index 1511b75..ab41925 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/EdgeTest.java
@@ -146,12 +146,6 @@ public class EdgeTest {
             }
         }
 
-        @Test(expected = NoSuchElementException.class)
-        @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
-        public void shouldThrowNoSuchElementExceptionIfEdgeWithIdNotPresent() {
-            g.E(graphProvider.convertId(100, Edge.class)).next();
-        }
-
         @Test
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/db11d3b7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
index 457e235..4ca7eb0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/GraphTest.java
@@ -92,30 +92,28 @@ public class GraphTest extends AbstractGremlinTest {
     @Test
     public void shouldHaveExceptionConsistencyWhenFindVertexByIdThatIsNonExistentViaIterator() {
         try {
-            graph.vertices(10000l).next();
-            fail("Call to g.V(10000l) should throw an exception");
+            graph.vertices(graphProvider.convertId(10000l, Vertex.class)).next();
+            fail("Call to g.vertices(10000l) should throw an exception");
         } catch (Exception ex) {
-            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Vertex.class, 10000l).getClass()));
+            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Vertex.class, graphProvider.convertId(10000l, Vertex.class)).getClass()));
         }
-
     }
 
     @Test
     public void shouldHaveExceptionConsistencyWhenFindEdgeByIdThatIsNonExistentViaIterator() {
         try {
-            graph.edges(10000l).next();
-            fail("Call to g.E(10000l) should throw an exception");
+            graph.edges(graphProvider.convertId(10000l, Edge.class)).next();
+            fail("Call to g.edges(10000l) should throw an exception");
         } catch (Exception ex) {
-            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Edge.class, 10000l).getClass()));
+            assertThat(ex, instanceOf(Graph.Exceptions.elementNotFound(Edge.class, graphProvider.convertId(10000l, Edge.class)).getClass()));
         }
-
     }
 
     @Test
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS)
     public void shouldHaveExceptionConsistencyWhenAssigningSameIdOnVertex() {
-        final Object o = GraphManager.getGraphProvider().convertId("1", Vertex.class);
+        final Object o = graphProvider.convertId("1", Vertex.class);
         graph.addVertex(T.id, o);
         try {
             graph.addVertex(T.id, o);
@@ -123,7 +121,6 @@ public class GraphTest extends AbstractGremlinTest {
         } catch (Exception ex) {
             assertThat(ex, instanceOf(Graph.Exceptions.vertexWithIdAlreadyExists(0).getClass()));
         }
-
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/db11d3b7/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
index b991762..6b52699 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
@@ -255,12 +255,6 @@ public class VertexTest {
             }
         }
 
-        @Test(expected = NoSuchElementException.class)
-        @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
-        public void shouldThrowNoSuchElementExceptionIfVertexWithIdNotPresent() {
-            graph.vertices(graphProvider.convertId(100, Vertex.class)).next();
-        }
-
         @Test
         @FeatureRequirement(featureClass = Graph.Features.EdgeFeatures.class, feature = Graph.Features.EdgeFeatures.FEATURE_ADD_EDGES)
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)