tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject tinkerpop git commit: TINKERPOP-1809 WIP for basic identification of tests that modify toy graph data
Date Wed, 25 Oct 2017 15:51:03 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1809 [created] 15492a5cb


TINKERPOP-1809 WIP for basic identification of tests that modify toy graph data


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

Branch: refs/heads/TINKERPOP-1809
Commit: 15492a5cbd7ed3249829005879dcd48a67cc9c31
Parents: c0a03ca
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Oct 25 11:50:13 2017 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Wed Oct 25 11:50:13 2017 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/AbstractGremlinTest.java     | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/15492a5c/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
index 8485d56..d6b21da 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java
@@ -132,6 +132,23 @@ public abstract class AbstractGremlinTest {
     @After
     public void tearDown() throws Exception {
         if (null != graphProvider) {
+            final Method testMethod = this.getClass().getMethod(cleanMethodName(name.getMethodName()));
+            final LoadGraphWith[] loadGraphWiths = testMethod.getAnnotationsByType(LoadGraphWith.class);
+            final LoadGraphWith loadGraphWith = loadGraphWiths.length == 0 ? null : loadGraphWiths[0];
+            final LoadGraphWith.GraphData loadGraphWithData = null == loadGraphWith ? null
: loadGraphWith.value();
+
+            // toy graphs should stay static
+            if (loadGraphWithData != null) {
+                if (loadGraphWithData.equals(LoadGraphWith.GraphData.CLASSIC))
+                    assertVertexEdgeCounts(graph, 6, 6);
+                else if (loadGraphWithData.equals(LoadGraphWith.GraphData.MODERN))
+                    assertVertexEdgeCounts(graph, 6, 6);
+                else if (loadGraphWithData.equals(LoadGraphWith.GraphData.CREW))
+                    assertVertexEdgeCounts(graph, 6, 14);
+                else if (loadGraphWithData.equals(LoadGraphWith.GraphData.GRATEFUL))
+                    org.junit.Assert.assertTrue(true);
+            }
+
             graphProvider.getTestListener().ifPresent(l -> l.onTestEnd(this.getClass(),
name.getMethodName()));
             graphProvider.clear(graph, config);
 


Mime
View raw message