You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2015/05/12 04:14:24 UTC

[06/12] incubator-tinkerpop git commit: restored IgnoreEngine class

restored IgnoreEngine class


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

Branch: refs/heads/TINKERPOP3-666
Commit: c63be0b45322f0933c45c421e3fbd260250a9dc3
Parents: b8ac0b0
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Tue May 12 00:43:30 2015 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Tue May 12 00:43:30 2015 +0200

----------------------------------------------------------------------
 .../process/AbstractGremlinProcessTest.java     |  9 +++++
 .../tinkerpop/gremlin/process/IgnoreEngine.java | 37 ++++++++++++++++++++
 .../traversal/step/filter/ExceptTest.java       |  1 -
 3 files changed, 46 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c63be0b4/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
index 2018114..494dbf8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/AbstractGremlinProcessTest.java
@@ -61,6 +61,15 @@ public abstract class AbstractGremlinProcessTest extends AbstractGremlinTest {
     @Before
     public void setupTest() {
         assumeTrue(graphMeetsTestRequirements());
+
+        try {
+            // ignore tests that aren't supported by a specific TraversalEngine
+            final IgnoreEngine ignoreEngine = this.getClass().getMethod(name.getMethodName()).getAnnotation(IgnoreEngine.class);
+            if (ignoreEngine != null)
+                assumeTrue(String.format("This test is ignored for %s", ignoreEngine.value()), !ignoreEngine.value().equals(GraphManager.getTraversalEngineType()));
+        } catch (NoSuchMethodException nsme) {
+            throw new RuntimeException(String.format("Could not find test method %s in test case %s", name.getMethodName(), this.getClass().getName()));
+        }
     }
 
     public <T> void checkResults(final List<T> expectedResults, final Traversal<?, T> traversal) {

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c63be0b4/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/IgnoreEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/IgnoreEngine.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/IgnoreEngine.java
new file mode 100644
index 0000000..245b9e5
--- /dev/null
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/IgnoreEngine.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.process;
+
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+@Inherited
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface IgnoreEngine {
+    public TraversalEngine.Type value();
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/c63be0b4/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
index d29c869..e3c2503 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/ExceptTest.java
@@ -119,7 +119,6 @@ public abstract class ExceptTest extends AbstractGremlinProcessTest {
 
     @Test
     @LoadGraphWith(MODERN)
-    @IgnoreEngine(TraversalEngine.Type.COMPUTER)
     public void g_VX1X_repeatXbothEXcreatedX_exceptXeX_aggregateXeX_otherVX_emit_path() {
         final Traversal<Vertex, Path> traversal = get_g_VX1X_repeatXbothEXcreatedX_exceptXeX_aggregateXeX_otherVX_emit_path(convertToVertexId("marko"));
         printTraversalForm(traversal);