This is an automated email from the ASF dual-hosted git repository. kenhuuu pushed a commit to branch master-http-final in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit d3abc135689cc7bc91fbccbc917377f425c108c0 Author: Ken Hu <[email protected]> AuthorDate: Tue Oct 29 20:45:24 2024 -0700 Re-enable feature test of GraphSONv4 CTR --- .../remote/GraphSONLangRemoteFeatureTest.java | 51 +++++++++++++++++++++ .../remote/GraphSONRemoteComputerFeatureTest.java | 52 ++++++++++++++++++++++ .../gremlin/driver/remote/RemoteWorld.java | 24 ++++++++++ .../io.cucumber.core.backend.ObjectFactory | 2 + 4 files changed, 129 insertions(+) diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONLangRemoteFeatureTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONLangRemoteFeatureTest.java new file mode 100644 index 0000000000..550ed25713 --- /dev/null +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONLangRemoteFeatureTest.java @@ -0,0 +1,51 @@ +/* + * 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.driver.remote; + +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Stage; +import io.cucumber.guice.CucumberModules; +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.apache.tinkerpop.gremlin.features.AbstractGuiceFactory; +import org.apache.tinkerpop.gremlin.features.World; +import org.junit.runner.RunWith; + +@RunWith(Cucumber.class) +@CucumberOptions( + tags = "not @RemoteOnly and not @GraphComputerOnly and not @AllowNullPropertyValues", + glue = { "org.apache.tinkerpop.gremlin.features" }, + objectFactory = GraphSONLangRemoteFeatureTest.RemoteGuiceFactory.class, + features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" }, + plugin = {"progress", "junit:target/cucumber.xml"}) +public class GraphSONLangRemoteFeatureTest extends AbstractFeatureTest { + public static class RemoteGuiceFactory extends AbstractGuiceFactory { + public RemoteGuiceFactory() { + super(Guice.createInjector(Stage.PRODUCTION, CucumberModules.createScenarioModule(), new ServiceModule())); + } + } + + public static final class ServiceModule extends AbstractModule { + @Override + protected void configure() { + bind(World.class).to(RemoteWorld.GraphSONLangRemoteWorld.class); + } + } +} diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteComputerFeatureTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteComputerFeatureTest.java new file mode 100644 index 0000000000..6e92604426 --- /dev/null +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/GraphSONRemoteComputerFeatureTest.java @@ -0,0 +1,52 @@ +/* + * 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.driver.remote; + +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Stage; +import io.cucumber.guice.CucumberModules; +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.apache.tinkerpop.gremlin.features.AbstractGuiceFactory; +import org.apache.tinkerpop.gremlin.features.World; +import org.junit.runner.RunWith; + +@RunWith(Cucumber.class) +@CucumberOptions( + tags = "not @RemoteOnly and not @GraphComputerVerificationElementSupported and " + + "not @GraphComputerVerificationReferenceOnly and not @InsertionOrderingRequired", + glue = { "org.apache.tinkerpop.gremlin.features" }, + objectFactory = GraphSONRemoteComputerFeatureTest.RemoteGuiceFactory.class, + features = { "classpath:/org/apache/tinkerpop/gremlin/test/features" }, + plugin = {"progress", "junit:target/cucumber.xml"}) +public class GraphSONRemoteComputerFeatureTest extends AbstractFeatureTest { + public static class RemoteGuiceFactory extends AbstractGuiceFactory { + public RemoteGuiceFactory() { + super(Guice.createInjector(Stage.PRODUCTION, CucumberModules.createScenarioModule(), new ServiceModule())); + } + } + + public static final class ServiceModule extends AbstractModule { + @Override + protected void configure() { + bind(World.class).to(RemoteWorld.GraphSONRemoteComputerWorld.class); + } + } +} diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java index 84109b080e..668bc57ca1 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/driver/remote/RemoteWorld.java @@ -200,4 +200,28 @@ public abstract class RemoteWorld implements World { return g.with("language", "groovy-test"); } } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + public static class GraphSONLangRemoteWorld extends RemoteWorld { + public GraphSONLangRemoteWorld() { super(createTestCluster(Serializers.GRAPHSON_V4)); } + + @Override + public GraphTraversalSource getGraphTraversalSource(final LoadGraphWith.GraphData graphData) { + final GraphTraversalSource g = super.getGraphTraversalSource(graphData); + return g.with("language", "gremlin-lang"); + } + } + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + public static class GraphSONRemoteComputerWorld extends RemoteComputerWorld { + public GraphSONRemoteComputerWorld() { super(createTestCluster(Serializers.GRAPHSON_V4)); } + + @Override + public GraphTraversalSource getGraphTraversalSource(final LoadGraphWith.GraphData graphData) { + final GraphTraversalSource g = super.getGraphTraversalSource(graphData); + return g.with("language", "groovy-test"); + } + } } diff --git a/gremlin-server/src/test/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory b/gremlin-server/src/test/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory index 7b70b113b0..d7c53bc1bd 100644 --- a/gremlin-server/src/test/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory +++ b/gremlin-server/src/test/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory @@ -2,3 +2,5 @@ org.apache.tinkerpop.gremlin.driver.remote.GraphBinaryLangRemoteFeatureTest$Remo org.apache.tinkerpop.gremlin.driver.remote.GraphBinaryLangBulkedRemoteFeatureTest$RemoteGuiceFactory org.apache.tinkerpop.gremlin.driver.remote.GraphBinaryGroovyRemoteFeatureTest$RemoteGuiceFactory org.apache.tinkerpop.gremlin.driver.remote.GraphBinaryRemoteComputerFeatureTest$RemoteGuiceFactory +org.apache.tinkerpop.gremlin.driver.remote.GraphSONLangRemoteFeatureTest$RemoteGuiceFactory +org.apache.tinkerpop.gremlin.driver.remote.GraphSONRemoteComputerFeatureTest$RemoteGuiceFactory
