Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1278 e50f62c1d -> 0803fdc2d
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGraphSONTranslatorProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGraphSONTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGraphSONTranslatorProvider.java deleted file mode 100644 index 85d8b0e..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGraphSONTranslatorProvider.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest; -import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest; -import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategyProcessTest; -import org.apache.tinkerpop.gremlin.process.traversal.util.JavaTranslator; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public class TinkerGraphGraphSONTranslatorProvider extends TinkerGraphProvider { - - private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList( - "testProfileStrategyCallback", - "testProfileStrategyCallbackSideEffect", - "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", - "g_V_both_hasLabelXpersonX_order_byXage_decrX_name", - "g_VX1X_out_injectXv2X_name", - "shouldNeverPropagateANoBulkTraverser", - "shouldNeverPropagateANullValuedTraverser", - "shouldTraversalResetProperly", - "shouldHidePartitionKeyForValues", - // - "g_VXlistXv1_v2_v3XX_name", - "g_V_hasLabelXpersonX_asXpX_VXsoftwareX_addInEXuses_pX", - "g_VXv1X_hasXage_gt_30X", - "g_V_chooseXout_countX_optionX2L__nameX_optionX3L__valueMapX", - "g_V_branchXlabelX_optionXperson__ageX_optionXsoftware__langX_optionXsoftware__nameX", - // - PageRankTest.Traversals.class.getCanonicalName(), - ProgramTest.Traversals.class.getCanonicalName(), - TraversalInterruptionTest.class.getCanonicalName(), - TraversalInterruptionComputerTest.class.getCanonicalName(), - EventStrategyProcessTest.class.getCanonicalName(), - CoreTraversalTest.class.getCanonicalName(), - PartitionStrategyProcessTest.class.getCanonicalName(), - ElementIdStrategyProcessTest.class.getCanonicalName())); - - - @Override - public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, - final LoadGraphWith.GraphData loadGraphWith) { - - final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith); - config.put("skipTest", SKIP_TESTS.contains(testMethodName) || SKIP_TESTS.contains(test.getCanonicalName())); - return config; - } - - @Override - public GraphTraversalSource traversal(final Graph graph) { - if ((Boolean) graph.configuration().getProperty("skipTest")) - return graph.traversal(); - //throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance()); - else { - final GraphTraversalSource g = graph.traversal(); - return g.withTranslator(new GraphSONTranslator<>(JavaTranslator.of(g, __.class))); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorComputerProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorComputerProvider.java deleted file mode 100644 index fb844e2..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorComputerProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.GraphProvider; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ [email protected](computer = TinkerGraphComputer.class) -public class TinkerGraphGroovyTranslatorComputerProvider extends TinkerGraphGroovyTranslatorProvider { - - @Override - public GraphTraversalSource traversal(final Graph graph) { - return super.traversal(graph).withComputer(); - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessComputerTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessComputerTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessComputerTest.java deleted file mode 100644 index 6ef75c0..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessComputerTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.process.ProcessComputerSuite; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(ProcessComputerSuite.class) -@GraphProviderClass(provider = TinkerGraphGroovyTranslatorComputerProvider.class, graph = TinkerGraph.class) -public class TinkerGraphGroovyTranslatorProcessComputerTest { -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessStandardTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessStandardTest.java deleted file mode 100644 index d37992f..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProcessStandardTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(ProcessStandardSuite.class) -@GraphProviderClass(provider = TinkerGraphGroovyTranslatorProvider.class, graph = TinkerGraph.class) -public class TinkerGraphGroovyTranslatorProcessStandardTest { -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProvider.java deleted file mode 100644 index b5f6b1d..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphGroovyTranslatorProvider.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator; -import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest; -import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public class TinkerGraphGroovyTranslatorProvider extends TinkerGraphProvider { - - private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList( - "testProfileStrategyCallback", - "testProfileStrategyCallbackSideEffect", - "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", - "g_V_both_hasLabelXpersonX_order_byXage_decrX_name", - "g_VX1X_out_injectXv2X_name", - "shouldSupportGraphFilter", - "shouldNeverPropagateANoBulkTraverser", - "shouldNeverPropagateANullValuedTraverser", - "shouldTraversalResetProperly", - "shouldHidePartitionKeyForValues", - ProgramTest.Traversals.class.getCanonicalName(), - TraversalInterruptionTest.class.getCanonicalName(), - TraversalInterruptionComputerTest.class.getCanonicalName(), - ElementIdStrategyProcessTest.class.getCanonicalName())); - - - @Override - public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, - final LoadGraphWith.GraphData loadGraphWith) { - - final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith); - config.put("skipTest", SKIP_TESTS.contains(testMethodName) || SKIP_TESTS.contains(test.getCanonicalName())); - return config; - } - - @Override - public GraphTraversalSource traversal(final Graph graph) { - if ((Boolean) graph.configuration().getProperty("skipTest")) - return graph.traversal(); - //throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance()); - else - return graph.traversal().withTranslator(GroovyTranslator.of("g","__")); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorComputerProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorComputerProvider.java deleted file mode 100644 index d526d9e..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorComputerProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.GraphProvider; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ [email protected](computer = TinkerGraphComputer.class) -public class TinkerGraphJavaTranslatorComputerProvider extends TinkerGraphJavaTranslatorProvider { - - @Override - public GraphTraversalSource traversal(final Graph graph) { - return super.traversal(graph).withComputer(); - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessComputerTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessComputerTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessComputerTest.java deleted file mode 100644 index 389ad19..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessComputerTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.process.ProcessComputerSuite; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(ProcessComputerSuite.class) -@GraphProviderClass(provider = TinkerGraphJavaTranslatorComputerProvider.class, graph = TinkerGraph.class) -public class TinkerGraphJavaTranslatorProcessComputerTest { -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessStandardTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessStandardTest.java deleted file mode 100644 index 1ce264b..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProcessStandardTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(ProcessStandardSuite.class) -@GraphProviderClass(provider = TinkerGraphJavaTranslatorProvider.class, graph = TinkerGraph.class) -public class TinkerGraphJavaTranslatorProcessStandardTest { -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProvider.java deleted file mode 100644 index 4de3b0c..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/java/translator/TinkerGraphJavaTranslatorProvider.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.java.translator; - -import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest; -import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; -import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest; -import org.apache.tinkerpop.gremlin.process.traversal.util.JavaTranslator; -import org.apache.tinkerpop.gremlin.structure.Graph; -import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public class TinkerGraphJavaTranslatorProvider extends TinkerGraphProvider { - - private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList( - "testProfileStrategyCallback", - "testProfileStrategyCallbackSideEffect", - "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", - "g_V_both_hasLabelXpersonX_order_byXage_decrX_name", - "g_VX1X_out_injectXv2X_name", - "shouldSupportGraphFilter", - "shouldNeverPropagateANoBulkTraverser", - "shouldNeverPropagateANullValuedTraverser", - "shouldTraversalResetProperly", - "shouldHidePartitionKeyForValues", - ProgramTest.Traversals.class.getCanonicalName(), - TraversalInterruptionTest.class.getCanonicalName(), - TraversalInterruptionComputerTest.class.getCanonicalName(), - ElementIdStrategyProcessTest.class.getCanonicalName())); - - - @Override - public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, - final LoadGraphWith.GraphData loadGraphWith) { - - final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith); - config.put("skipTest", SKIP_TESTS.contains(testMethodName) || SKIP_TESTS.contains(test.getCanonicalName())); - return config; - } - - @Override - public GraphTraversalSource traversal(final Graph graph) { - if ((Boolean) graph.configuration().getProperty("skipTest")) - return graph.traversal(); - //throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance()); - else { - final GraphTraversalSource g = graph.traversal(); - return g.withTranslator(JavaTranslator.of(g,__.class)); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorComputerProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorComputerProvider.java new file mode 100644 index 0000000..ca0e58f --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorComputerProvider.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.tinkergraph.process.groovy.jsr223; + +import org.apache.tinkerpop.gremlin.GraphProvider; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ [email protected](computer = TinkerGraphComputer.class) +public class TinkerGraphGroovyTranslatorComputerProvider extends TinkerGraphGroovyTranslatorProvider { + + @Override + public GraphTraversalSource traversal(final Graph graph) { + return super.traversal(graph).withComputer(); + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessComputerTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessComputerTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessComputerTest.java new file mode 100644 index 0000000..67760ce --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessComputerTest.java @@ -0,0 +1,33 @@ +/* + * 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.tinkergraph.process.groovy.jsr223; + +import org.apache.tinkerpop.gremlin.GraphProviderClass; +import org.apache.tinkerpop.gremlin.process.ProcessComputerSuite; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.runner.RunWith; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +@RunWith(ProcessComputerSuite.class) +@GraphProviderClass(provider = TinkerGraphGroovyTranslatorComputerProvider.class, graph = TinkerGraph.class) +public class TinkerGraphGroovyTranslatorProcessComputerTest { +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessStandardTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessStandardTest.java new file mode 100644 index 0000000..058b552 --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProcessStandardTest.java @@ -0,0 +1,33 @@ +/* + * 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.tinkergraph.process.groovy.jsr223; + +import org.apache.tinkerpop.gremlin.GraphProviderClass; +import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.runner.RunWith; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +@RunWith(ProcessStandardSuite.class) +@GraphProviderClass(provider = TinkerGraphGroovyTranslatorProvider.class, graph = TinkerGraph.class) +public class TinkerGraphGroovyTranslatorProcessStandardTest { +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java new file mode 100644 index 0000000..0dc9ea5 --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java @@ -0,0 +1,76 @@ +/* + * 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.tinkergraph.process.groovy.jsr223; + +import org.apache.tinkerpop.gremlin.LoadGraphWith; +import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +public class TinkerGraphGroovyTranslatorProvider extends TinkerGraphProvider { + + private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList( + "testProfileStrategyCallback", + "testProfileStrategyCallbackSideEffect", + "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", + "g_V_both_hasLabelXpersonX_order_byXage_decrX_name", + "g_VX1X_out_injectXv2X_name", + "shouldSupportGraphFilter", + "shouldNeverPropagateANoBulkTraverser", + "shouldNeverPropagateANullValuedTraverser", + "shouldTraversalResetProperly", + "shouldHidePartitionKeyForValues", + ProgramTest.Traversals.class.getCanonicalName(), + TraversalInterruptionTest.class.getCanonicalName(), + TraversalInterruptionComputerTest.class.getCanonicalName(), + ElementIdStrategyProcessTest.class.getCanonicalName())); + + + @Override + public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, + final LoadGraphWith.GraphData loadGraphWith) { + + final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith); + config.put("skipTest", SKIP_TESTS.contains(testMethodName) || SKIP_TESTS.contains(test.getCanonicalName())); + return config; + } + + @Override + public GraphTraversalSource traversal(final Graph graph) { + if ((Boolean) graph.configuration().getProperty("skipTest")) + return graph.traversal(); + //throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance()); + else + return graph.traversal().withTranslator(GroovyTranslator.of("g","__")); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorComputerProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorComputerProvider.java new file mode 100644 index 0000000..a12210a --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorComputerProvider.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.tinkergraph.process.jsr223; + +import org.apache.tinkerpop.gremlin.GraphProvider; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ [email protected](computer = TinkerGraphComputer.class) +public class TinkerGraphJavaTranslatorComputerProvider extends TinkerGraphJavaTranslatorProvider { + + @Override + public GraphTraversalSource traversal(final Graph graph) { + return super.traversal(graph).withComputer(); + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessComputerTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessComputerTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessComputerTest.java new file mode 100644 index 0000000..08ba513 --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessComputerTest.java @@ -0,0 +1,33 @@ +/* + * 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.tinkergraph.process.jsr223; + +import org.apache.tinkerpop.gremlin.GraphProviderClass; +import org.apache.tinkerpop.gremlin.process.ProcessComputerSuite; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.runner.RunWith; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +@RunWith(ProcessComputerSuite.class) +@GraphProviderClass(provider = TinkerGraphJavaTranslatorComputerProvider.class, graph = TinkerGraph.class) +public class TinkerGraphJavaTranslatorProcessComputerTest { +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessStandardTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessStandardTest.java new file mode 100644 index 0000000..c017182 --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProcessStandardTest.java @@ -0,0 +1,33 @@ +/* + * 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.tinkergraph.process.jsr223; + +import org.apache.tinkerpop.gremlin.GraphProviderClass; +import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.runner.RunWith; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +@RunWith(ProcessStandardSuite.class) +@GraphProviderClass(provider = TinkerGraphJavaTranslatorProvider.class, graph = TinkerGraph.class) +public class TinkerGraphJavaTranslatorProcessStandardTest { +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java new file mode 100644 index 0000000..18dabaa --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java @@ -0,0 +1,79 @@ +/* + * 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.tinkergraph.process.jsr223; + +import org.apache.tinkerpop.gremlin.LoadGraphWith; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest; +import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +public class TinkerGraphJavaTranslatorProvider extends TinkerGraphProvider { + + private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList( + "testProfileStrategyCallback", + "testProfileStrategyCallbackSideEffect", + "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", + "g_V_both_hasLabelXpersonX_order_byXage_decrX_name", + "g_VX1X_out_injectXv2X_name", + "shouldSupportGraphFilter", + "shouldNeverPropagateANoBulkTraverser", + "shouldNeverPropagateANullValuedTraverser", + "shouldTraversalResetProperly", + "shouldHidePartitionKeyForValues", + ProgramTest.Traversals.class.getCanonicalName(), + TraversalInterruptionTest.class.getCanonicalName(), + TraversalInterruptionComputerTest.class.getCanonicalName(), + ElementIdStrategyProcessTest.class.getCanonicalName())); + + + @Override + public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, + final LoadGraphWith.GraphData loadGraphWith) { + + final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith); + config.put("skipTest", SKIP_TESTS.contains(testMethodName) || SKIP_TESTS.contains(test.getCanonicalName())); + return config; + } + + @Override + public GraphTraversalSource traversal(final Graph graph) { + if ((Boolean) graph.configuration().getProperty("skipTest")) + return graph.traversal(); + //throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance()); + else { + final GraphTraversalSource g = graph.traversal(); + return g.withTranslator(JavaTranslator.of(g,__.class)); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java index 7e2c152..da3409b 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java @@ -28,7 +28,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.PathRetractionStrategy; -import org.apache.tinkerpop.gremlin.process.traversal.util.JavaTranslator; +import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; @@ -36,7 +36,6 @@ import org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo; import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader; import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter; import org.apache.tinkerpop.gremlin.util.TimeUtil; -import org.apache.tinkerpop.gremlin.util.function.Lambda; import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/GraphSONTranslator.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/GraphSONTranslator.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/GraphSONTranslator.java new file mode 100644 index 0000000..51d6395 --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/GraphSONTranslator.java @@ -0,0 +1,83 @@ +/* + * 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.tinkergraph.structure.io.graphson; + +import org.apache.tinkerpop.gremlin.process.traversal.Bytecode; +import org.apache.tinkerpop.gremlin.process.traversal.Translator; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.VerificationException; +import org.apache.tinkerpop.gremlin.process.traversal.util.BytecodeHelper; +import org.apache.tinkerpop.gremlin.process.traversal.util.EmptyTraversal; +import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONReader; +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.util.Arrays; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +final class GraphSONTranslator<S extends TraversalSource, T extends Traversal.Admin<?, ?>> implements Translator.StepTranslator<S, T> { + + private final JavaTranslator<S, T> wrappedTranslator; + private final GraphSONWriter writer = GraphSONWriter.build().create(); + private final GraphSONReader reader = GraphSONReader.build().create(); + + public GraphSONTranslator(final JavaTranslator<S, T> wrappedTranslator) { + this.wrappedTranslator = wrappedTranslator; + } + + @Override + public S getTraversalSource() { + return this.wrappedTranslator.getTraversalSource(); + } + + @Override + public Class getAnonymousTraversal() { + return this.wrappedTranslator.getAnonymousTraversal(); + } + + @Override + public T translate(final Bytecode bytecode) { + try { + for (final Bytecode.Instruction instruction : bytecode.getStepInstructions()) { + for (final Object argument : instruction.getArguments()) { + if (argument.toString().contains("$")) + throw new VerificationException("Lambdas are currently not supported: " + bytecode, EmptyTraversal.instance()); + } + } + final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + this.writer.writeObject(outputStream, BytecodeHelper.filterInstructions(bytecode, + instruction -> !Arrays.asList("withTranslator", "withStrategies").contains(instruction.getOperator()))); + // System.out.println(new String(outputStream.toByteArray())); + return this.wrappedTranslator.translate(this.reader.readObject(new ByteArrayInputStream(outputStream.toByteArray()), Bytecode.class)); + } catch (final Exception e) { + throw new IllegalStateException(e.getMessage(), e); + } + } + + @Override + public String getTargetLanguage() { + return this.wrappedTranslator.getTargetLanguage(); + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorComputerProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorComputerProvider.java new file mode 100644 index 0000000..2890bfe --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorComputerProvider.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.tinkergraph.structure.io.graphson; + +import org.apache.tinkerpop.gremlin.GraphProvider; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ [email protected](computer = TinkerGraphComputer.class) +public class TinkerGraphGraphSONTranslatorComputerProvider extends TinkerGraphGraphSONTranslatorProvider { + + @Override + public GraphTraversalSource traversal(final Graph graph) { + return super.traversal(graph).withComputer(); + } +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessComputerTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessComputerTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessComputerTest.java new file mode 100644 index 0000000..e715aef --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessComputerTest.java @@ -0,0 +1,33 @@ +/* + * 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.tinkergraph.structure.io.graphson; + +import org.apache.tinkerpop.gremlin.GraphProviderClass; +import org.apache.tinkerpop.gremlin.process.ProcessComputerSuite; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.runner.RunWith; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +@RunWith(ProcessComputerSuite.class) +@GraphProviderClass(provider = TinkerGraphGraphSONTranslatorComputerProvider.class, graph = TinkerGraph.class) +public class TinkerGraphGraphSONTranslatorProcessComputerTest { +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessStandardTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessStandardTest.java new file mode 100644 index 0000000..4ccee61 --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProcessStandardTest.java @@ -0,0 +1,33 @@ +/* + * 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.tinkergraph.structure.io.graphson; + +import org.apache.tinkerpop.gremlin.GraphProviderClass; +import org.apache.tinkerpop.gremlin.process.ProcessStandardSuite; +import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; +import org.junit.runner.RunWith; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +@RunWith(ProcessStandardSuite.class) +@GraphProviderClass(provider = TinkerGraphGraphSONTranslatorProvider.class, graph = TinkerGraph.class) +public class TinkerGraphGraphSONTranslatorProcessStandardTest { +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0803fdc2/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProvider.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProvider.java new file mode 100644 index 0000000..b85b8dc --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/TinkerGraphGraphSONTranslatorProvider.java @@ -0,0 +1,93 @@ +/* + * 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.tinkergraph.structure.io.graphson; + +import org.apache.tinkerpop.gremlin.LoadGraphWith; +import org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategyProcessTest; +import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + */ +public class TinkerGraphGraphSONTranslatorProvider extends TinkerGraphProvider { + + private static Set<String> SKIP_TESTS = new HashSet<>(Arrays.asList( + "testProfileStrategyCallback", + "testProfileStrategyCallbackSideEffect", + "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", + "g_V_both_hasLabelXpersonX_order_byXage_decrX_name", + "g_VX1X_out_injectXv2X_name", + "shouldNeverPropagateANoBulkTraverser", + "shouldNeverPropagateANullValuedTraverser", + "shouldTraversalResetProperly", + "shouldHidePartitionKeyForValues", + // + "g_VXlistXv1_v2_v3XX_name", + "g_V_hasLabelXpersonX_asXpX_VXsoftwareX_addInEXuses_pX", + "g_VXv1X_hasXage_gt_30X", + "g_V_chooseXout_countX_optionX2L__nameX_optionX3L__valueMapX", + "g_V_branchXlabelX_optionXperson__ageX_optionXsoftware__langX_optionXsoftware__nameX", + // + PageRankTest.Traversals.class.getCanonicalName(), + ProgramTest.Traversals.class.getCanonicalName(), + TraversalInterruptionTest.class.getCanonicalName(), + TraversalInterruptionComputerTest.class.getCanonicalName(), + EventStrategyProcessTest.class.getCanonicalName(), + CoreTraversalTest.class.getCanonicalName(), + PartitionStrategyProcessTest.class.getCanonicalName(), + ElementIdStrategyProcessTest.class.getCanonicalName())); + + + @Override + public Map<String, Object> getBaseConfiguration(final String graphName, final Class<?> test, final String testMethodName, + final LoadGraphWith.GraphData loadGraphWith) { + + final Map<String, Object> config = super.getBaseConfiguration(graphName, test, testMethodName, loadGraphWith); + config.put("skipTest", SKIP_TESTS.contains(testMethodName) || SKIP_TESTS.contains(test.getCanonicalName())); + return config; + } + + @Override + public GraphTraversalSource traversal(final Graph graph) { + if ((Boolean) graph.configuration().getProperty("skipTest")) + return graph.traversal(); + //throw new VerificationException("This test current does not work with Gremlin-Python", EmptyTraversal.instance()); + else { + final GraphTraversalSource g = graph.traversal(); + return g.withTranslator(new GraphSONTranslator<>(JavaTranslator.of(g, __.class))); + } + } +} \ No newline at end of file
