http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server-modern-readonly.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml index d4ff8d4..7750ad3 100644 --- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml +++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 30000 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/generate-modern-readonly.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern-readonly.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server-modern.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml index 08096f6..5d0a67d 100644 --- a/gremlin-server/conf/gremlin-server-modern.yaml +++ b/gremlin-server/conf/gremlin-server-modern.yaml @@ -20,13 +20,12 @@ port: 8182 scriptEvaluationTimeout: 30000 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/generate-modern.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server-neo4j.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml index 1d4003e..0ca8b9c 100644 --- a/gremlin-server/conf/gremlin-server-neo4j.yaml +++ b/gremlin-server/conf/gremlin-server-neo4j.yaml @@ -31,13 +31,12 @@ scriptEvaluationTimeout: 30000 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/neo4j-empty.properties} -plugins: - - tinkerpop.neo4j scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/empty-sample.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.neo4j.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server-rest-modern.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server-rest-modern.yaml b/gremlin-server/conf/gremlin-server-rest-modern.yaml index e39e497..a2d4327 100644 --- a/gremlin-server/conf/gremlin-server-rest-modern.yaml +++ b/gremlin-server/conf/gremlin-server-rest-modern.yaml @@ -21,13 +21,12 @@ scriptEvaluationTimeout: 30000 channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/generate-modern.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-modern.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server-rest-secure.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server-rest-secure.yaml b/gremlin-server/conf/gremlin-server-rest-secure.yaml index e3d9330..6aa4de7 100644 --- a/gremlin-server/conf/gremlin-server-rest-secure.yaml +++ b/gremlin-server/conf/gremlin-server-rest-secure.yaml @@ -29,18 +29,13 @@ scriptEvaluationTimeout: 30000 channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/empty-sample-secure.groovy], - config: { - compilerCustomizerProviders: { - "org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ThreadInterruptCustomizerProvider":[], - "org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.TimedInterruptCustomizerProvider":[10000], - "org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider":["org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension"]}}}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin: {enableThreadInterrupt: true, timedInterrupt: 10000, compilation: COMPILE_STATIC, extensions: org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample-secure.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV1d0] }} # application/vnd.gremlin-v1.0+json - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV2d0] }} # application/vnd.gremlin-v2.0+json http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server-secure.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server-secure.yaml b/gremlin-server/conf/gremlin-server-secure.yaml index e4b6049..05ea0e6 100644 --- a/gremlin-server/conf/gremlin-server-secure.yaml +++ b/gremlin-server/conf/gremlin-server-secure.yaml @@ -29,18 +29,13 @@ scriptEvaluationTimeout: 30000 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/empty-sample-secure.groovy], - config: { - compilerCustomizerProviders: { - "org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ThreadInterruptCustomizerProvider":[], - "org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.TimedInterruptCustomizerProvider":[10000], - "org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider":["org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension"]}}}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {} + org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin: {enableThreadInterrupt: true, timedInterrupt: 10000, compilation: COMPILE_STATIC, extensions: org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample-secure.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server-spark.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server-spark.yaml b/gremlin-server/conf/gremlin-server-spark.yaml index 2335c31..17c9638 100644 --- a/gremlin-server/conf/gremlin-server-spark.yaml +++ b/gremlin-server/conf/gremlin-server-spark.yaml @@ -44,13 +44,12 @@ scriptEvaluationTimeout: 30000 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/hadoop-gryo.properties} -plugins: - - tinkerpop.spark scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/spark.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.spark.jsr223.SparkGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/spark.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/conf/gremlin-server.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/conf/gremlin-server.yaml b/gremlin-server/conf/gremlin-server.yaml index a468096..83a3fc7 100644 --- a/gremlin-server/conf/gremlin-server.yaml +++ b/gremlin-server/conf/gremlin-server.yaml @@ -21,13 +21,12 @@ scriptEvaluationTimeout: 30000 channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/empty-sample.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+gryo-lite http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/pom.xml ---------------------------------------------------------------------- diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml index dc40bab..ee60953 100644 --- a/gremlin-server/pom.xml +++ b/gremlin-server/pom.xml @@ -81,12 +81,6 @@ limitations under the License. <scope>test</scope> </dependency> <dependency> - <groupId>org.apache.tinkerpop</groupId> - <artifactId>gremlin-groovy-test</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>com.carrotsearch</groupId> <artifactId>junit-benchmarks</artifactId> <version>0.7.2</version> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java ---------------------------------------------------------------------- diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java index 96cc132..3792022 100644 --- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java +++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java @@ -41,11 +41,9 @@ import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteTraversalSideEffec import org.apache.tinkerpop.gremlin.driver.ser.Serializers; import org.apache.tinkerpop.gremlin.driver.simple.SimpleClient; import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.CompileStaticCustomizerProvider; +import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin; import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ConfigurationCustomizerProvider; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.InterpreterModeCustomizerProvider; import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.SimpleSandboxExtension; -import org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.TimedInterruptCustomizerProvider; import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; @@ -54,7 +52,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet; import org.apache.tinkerpop.gremlin.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.server.channel.NioChannelizer; -import org.apache.tinkerpop.gremlin.structure.Vertex; import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex; import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph; import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender; @@ -84,6 +81,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; +import static org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin.Compilation.COMPILE_STATIC; import static org.apache.tinkerpop.gremlin.process.traversal.TraversalSource.GREMLIN_REMOTE_CONNECTION_CLASS; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.is; @@ -171,13 +169,13 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration defaultSettings.port = TestClientFactory.PORT; return settings; case "shouldUseSimpleSandbox": - settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForSimpleSandbox(); + settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForSimpleSandbox()); break; case "shouldUseInterpreterMode": - settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForInterpreterMode(); + settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForInterpreterMode()); break; case "shouldReceiveFailureTimeOutOnScriptEvalOfOutOfControlLoop": - settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForTimedInterrupt(); + settings.scriptEngines.get("gremlin-groovy").plugins.put(GroovyCompilerGremlinPlugin.class.getName(), getScriptEngineConfForTimedInterrupt()); break; case "shouldUseBaseScript": settings.scriptEngines.get("gremlin-groovy").config = getScriptEngineConfForBaseScript(); @@ -201,29 +199,20 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration private static Map<String, Object> getScriptEngineConfForSimpleSandbox() { final Map<String,Object> scriptEngineConf = new HashMap<>(); - final Map<String,Object> compilerCustomizerProviderConf = new HashMap<>(); - final List<String> sandboxes = new ArrayList<>(); - sandboxes.add(SimpleSandboxExtension.class.getName()); - compilerCustomizerProviderConf.put(CompileStaticCustomizerProvider.class.getName(), sandboxes); - scriptEngineConf.put("compilerCustomizerProviders", compilerCustomizerProviderConf); + scriptEngineConf.put("compilation", COMPILE_STATIC.name()); + scriptEngineConf.put("extensions", SimpleSandboxExtension.class.getName()); return scriptEngineConf; } private static Map<String, Object> getScriptEngineConfForTimedInterrupt() { final Map<String,Object> scriptEngineConf = new HashMap<>(); - final Map<String,Object> timedInterruptProviderConf = new HashMap<>(); - final List<Object> config = new ArrayList<>(); - config.add(1000); - timedInterruptProviderConf.put(TimedInterruptCustomizerProvider.class.getName(), config); - scriptEngineConf.put("compilerCustomizerProviders", timedInterruptProviderConf); + scriptEngineConf.put("timedInterrupt", 1000); return scriptEngineConf; } private static Map<String, Object> getScriptEngineConfForInterpreterMode() { final Map<String,Object> scriptEngineConf = new HashMap<>(); - final Map<String,Object> interpreterProviderConf = new HashMap<>(); - interpreterProviderConf.put(InterpreterModeCustomizerProvider.class.getName(), Collections.EMPTY_LIST); - scriptEngineConf.put("compilerCustomizerProviders", interpreterProviderConf); + scriptEngineConf.put("enableInterpreterMode", true); return scriptEngineConf; } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml index ca8a0df..a755be2 100644 --- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml +++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml @@ -24,13 +24,12 @@ graphs: { modern: conf/tinkergraph-empty.properties, crew: conf/tinkergraph-empty.properties, grateful: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/generate-all.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-all.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph, custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}} - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph, custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml ---------------------------------------------------------------------- diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml index 623c35e..dc41190 100644 --- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml +++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml @@ -20,13 +20,12 @@ port: 45940 scriptEvaluationTimeout: 30000 graphs: { graph: conf/tinkergraph-empty.properties} -plugins: - - tinkerpop.tinkergraph scriptEngines: { gremlin-groovy: { - imports: [java.lang.Math], - staticImports: [java.lang.Math.PI], - scripts: [scripts/empty-sample.groovy]}} + plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}, + org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]}, + org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}}}} serializers: - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph, custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}} - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph, custom: [groovy.json.JsonBuilder;org.apache.tinkerpop.gremlin.driver.ser.JsonBuilderGryoSerializer]}} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java ---------------------------------------------------------------------- diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java index 665d21f..344fc9d 100644 --- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java +++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/structure/HadoopGraph.java @@ -48,8 +48,6 @@ import java.util.stream.Stream; @Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_STANDARD) @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD) @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_COMPUTER) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_STANDARD) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_COMPUTER) @Graph.OptOut( test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest$Traversals", method = "g_V_matchXa_hasXname_GarciaX__a_0writtenBy_b__a_0sungBy_bX", http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java ---------------------------------------------------------------------- diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java index f7b702a..5cdad56 100644 --- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java +++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPluginCheck.java @@ -23,17 +23,21 @@ import org.apache.tinkerpop.gremlin.AbstractGremlinTest; import org.apache.tinkerpop.gremlin.LoadGraphWith; import org.apache.tinkerpop.gremlin.TestHelper; import org.apache.tinkerpop.gremlin.groovy.loaders.GremlinLoader; +import org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin; +import org.apache.tinkerpop.gremlin.groovy.plugin.PluginAcceptor; import org.apache.tinkerpop.gremlin.groovy.plugin.RemoteAcceptor; -import org.apache.tinkerpop.gremlin.groovy.util.SugarTestHelper; import org.apache.tinkerpop.gremlin.groovy.util.TestableConsolePluginAcceptor; import org.apache.tinkerpop.gremlin.hadoop.Constants; import org.apache.tinkerpop.gremlin.hadoop.HadoopGremlinSuite; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.util.Gremlin; import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; +import org.codehaus.groovy.tools.shell.Groovysh; +import org.codehaus.groovy.tools.shell.IO; import org.junit.Before; import org.junit.Test; +import javax.script.ScriptException; import javax.tools.JavaCompiler; import javax.tools.SimpleJavaFileObject; import javax.tools.ToolProvider; @@ -42,11 +46,14 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.io.OutputStream; import java.net.URI; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.jar.Attributes; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; @@ -67,7 +74,15 @@ import static org.junit.Assert.fail; * @author Marko A. Rodriguez (http://markorodriguez.com) */ public class HadoopGremlinPluginCheck extends AbstractGremlinTest { + // *********************** + // This test will be removed as the old "plugin" infrastructure was deprecated in 3.2.4. need to rework the + // tests a bi for this to see what the model is for validating the jsr223 plugins. note that the code from + // gremlin-groovy-test, specifically TestableConsolePluginAcceptor, has been copied to the bottom of this + // file for reference + // *********************** + + /** @Before public void setupTest() { try { @@ -308,4 +323,73 @@ public class HadoopGremlinPluginCheck extends AbstractGremlinTest { return code; } } + **/ + + + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////// + + +//package org.apache.tinkerpop.gremlin.groovy.util; +// +//import org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin; +//import org.apache.tinkerpop.gremlin.groovy.plugin.PluginAcceptor; +//import org.codehaus.groovy.tools.shell.Groovysh; +//import org.codehaus.groovy.tools.shell.IO; +// +//import javax.script.ScriptException; +//import java.io.IOException; +//import java.io.OutputStream; +//import java.util.Collections; +//import java.util.HashMap; +//import java.util.Map; +//import java.util.Set; +// +// /** +// * @author Marko A. Rodriguez (http://markorodriguez.com) +// */ +// public class TestableConsolePluginAcceptor implements PluginAcceptor { +// +// public static final String ENVIRONMENT_NAME = "console"; +// public static final String ENVIRONMENT_SHELL = "ConsolePluginAcceptor.shell"; +// public static final String ENVIRONMENT_IO = "ConsolePluginAcceptor.io"; +// +// private Groovysh shell = new Groovysh(new IO(System.in, new OutputStream() { +// @Override +// public void write(int b) throws IOException { +// +// } +// }, System.err)); +// +// @Override +// public void addImports(final Set<String> importStatements) { +// importStatements.forEach(this.shell::execute); +// } +// +// @Override +// public void addBinding(final String key, final Object val) { +// this.shell.getInterp().getContext().setVariable(key, val); +// } +// +// @Override +// public Map<String, Object> getBindings() { +// return Collections.unmodifiableMap(this.shell.getInterp().getContext().getVariables()); +// } +// +// @Override +// public Object eval(final String script) throws ScriptException { +// return this.shell.execute(script); +// } +// +// @Override +// public Map<String, Object> environment() { +// final Map<String, Object> env = new HashMap<>(); +// env.put(GremlinPlugin.ENVIRONMENT, ENVIRONMENT_NAME); +// env.put(ENVIRONMENT_IO, this.shell.getIo()); +// env.put(ENVIRONMENT_SHELL, this.shell); +// return env; +// } +// +// } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/neo4j-gremlin/pom.xml ---------------------------------------------------------------------- diff --git a/neo4j-gremlin/pom.xml b/neo4j-gremlin/pom.xml index 30c681d..cedd11e 100644 --- a/neo4j-gremlin/pom.xml +++ b/neo4j-gremlin/pom.xml @@ -32,11 +32,6 @@ limitations under the License. <version>${project.version}</version> </dependency> <dependency> - <groupId>org.apache.tinkerpop</groupId> - <artifactId>gremlin-groovy</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-tinkerpop-api</artifactId> <version>0.1</version> @@ -49,12 +44,6 @@ limitations under the License. <scope>test</scope> </dependency> <dependency> - <groupId>org.apache.tinkerpop</groupId> - <artifactId>gremlin-groovy-test</artifactId> - <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <scope>test</scope> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java ---------------------------------------------------------------------- diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java deleted file mode 100644 index 68c0016..0000000 --- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/groovy/plugin/Neo4jGremlinPlugin.java +++ /dev/null @@ -1,62 +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.neo4j.groovy.plugin; - -import org.apache.tinkerpop.gremlin.groovy.plugin.AbstractGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.plugin.IllegalEnvironmentException; -import org.apache.tinkerpop.gremlin.groovy.plugin.PluginAcceptor; -import org.apache.tinkerpop.gremlin.groovy.plugin.PluginInitializationException; -import org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP; -import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph; - -import java.util.HashSet; -import java.util.Set; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - * @deprecated As of release 3.2.4, replaced by {@link org.apache.tinkerpop.gremlin.neo4j.jsr223.Neo4jGremlinPlugin}. - */ -@Deprecated -public final class Neo4jGremlinPlugin extends AbstractGremlinPlugin { - - private static final Set<String> IMPORTS = new HashSet<String>() {{ - add(IMPORT_SPACE + Neo4jGraph.class.getPackage().getName() + DOT_STAR); - add(IMPORT_STATIC_SPACE + LabelP.class.getCanonicalName() + DOT_STAR); - }}; - - @Override - public String getName() { - return "tinkerpop.neo4j"; - } - - @Override - public void pluginTo(final PluginAcceptor pluginAcceptor) throws PluginInitializationException, IllegalEnvironmentException { - pluginAcceptor.addImports(IMPORTS); - } - - @Override - public void afterPluginTo(final PluginAcceptor pluginAcceptor) throws IllegalEnvironmentException, PluginInitializationException { - - } - - @Override - public boolean requireRestart() { - return true; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java ---------------------------------------------------------------------- diff --git a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java index 8224d47..b92801a 100644 --- a/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java +++ b/neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java @@ -64,9 +64,6 @@ import java.util.stream.Stream; @Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_STANDARD) @Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_INTEGRATE) @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_STANDARD) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE) @Graph.OptIn("org.apache.tinkerpop.gremlin.neo4j.NativeNeo4jSuite") public final class Neo4jGraph implements Graph, WrappedGraph<Neo4jGraphAPI> { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin ---------------------------------------------------------------------- diff --git a/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin b/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin deleted file mode 100644 index f4cbea8..0000000 --- a/neo4j-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin +++ /dev/null @@ -1 +0,0 @@ -org.apache.tinkerpop.gremlin.neo4j.groovy.plugin.Neo4jGremlinPlugin \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.java deleted file mode 100644 index 2e22e1c..0000000 --- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/MultiMetaNeo4jGraphGroovyProcessStandardTest.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.neo4j.process.groovy; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.neo4j.MultiMetaNeo4jGraphProvider; -import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph; -import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(GroovyProcessStandardSuite.class) -@GraphProviderClass(provider = MultiMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class) -public class MultiMetaNeo4jGraphGroovyProcessStandardTest { -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.java deleted file mode 100644 index 1e7e200..0000000 --- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/process/groovy/NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest.java +++ /dev/null @@ -1,34 +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.neo4j.process.groovy; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.neo4j.NoMultiNoMetaNeo4jGraphProvider; -import org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph; -import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(GroovyProcessStandardSuite.class) -@GraphProviderClass(provider = NoMultiNoMetaNeo4jGraphProvider.class, graph = Neo4jGraph.class) -public class NoMultiNoMetaNeo4jGraphGroovyProcessStandardTest { - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java ---------------------------------------------------------------------- diff --git a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java index d585a5a..b2f245f 100644 --- a/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java +++ b/neo4j-gremlin/src/test/java/org/apache/tinkerpop/gremlin/neo4j/structure/NativeNeo4jStructureCheck.java @@ -19,13 +19,10 @@ package org.apache.tinkerpop.gremlin.neo4j.structure; import org.apache.tinkerpop.gremlin.FeatureRequirement; -import org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine; import org.apache.tinkerpop.gremlin.neo4j.AbstractNeo4jGremlinTest; import org.apache.tinkerpop.gremlin.neo4j.process.traversal.LabelP; import org.apache.tinkerpop.gremlin.neo4j.structure.trait.MultiMetaNeo4jTrait; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; -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.structure.Graph; import org.apache.tinkerpop.gremlin.structure.T; import org.apache.tinkerpop.gremlin.structure.Vertex; @@ -38,12 +35,14 @@ import org.neo4j.tinkerpop.api.Neo4jNode; import org.neo4j.tinkerpop.api.Neo4jRelationship; import org.neo4j.tinkerpop.api.Neo4jTx; -import javax.script.Bindings; -import javax.script.ScriptException; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + /** * @author Marko A. Rodriguez (http://markorodriguez.com) @@ -128,48 +127,6 @@ public class NativeNeo4jStructureCheck extends AbstractNeo4jGremlinTest { } @Test - public void shouldEnsureTraverseRelationshipNeedsTx() throws ScriptException { - final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(); - final Bindings bindings = engine.createBindings(); - bindings.put("g", graph.traversal()); - bindings.put("#jsr223.groovy.engine.keep.globals", "phantom"); - - Vertex marko = this.graph.addVertex(T.label, "Person", "name", "marko"); - Vertex john = this.graph.addVertex(T.label, "Person", "name", "john"); - Vertex pete = this.graph.addVertex(T.label, "Person", "name", "pete"); - marko.addEdge("friend", john); - marko.addEdge("friend", pete); - this.graph.tx().commit(); - - Object result = engine.eval("g.V(" + marko.id().toString() + ").outE('friend')", bindings); - assertTrue(result instanceof GraphTraversal); - - this.graph.tx().commit(); - assertEquals(2L, ((GraphTraversal) result).count().next()); - } - - @Test - public void shouldEnsureTraversalOfVerticesNeedsTx() throws ScriptException { - final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine(); - final Bindings bindings = engine.createBindings(); - bindings.put("g", graph.traversal()); - bindings.put("#jsr223.groovy.engine.keep.globals", "phantom"); - - Vertex marko = this.graph.addVertex(T.label, "Person", "name", "marko"); - Vertex john = this.graph.addVertex(T.label, "Person", "name", "john"); - Vertex pete = this.graph.addVertex(T.label, "Person", "name", "pete"); - marko.addEdge("friend", john); - marko.addEdge("friend", pete); - this.graph.tx().commit(); - - Object result = engine.eval("g.V(" + marko.id().toString() + ").out('friend')", bindings); - assertTrue(result instanceof GraphTraversal); - - this.graph.tx().commit(); - assertEquals(2L, ((GraphTraversal) result).count().next()); - } - - @Test public void shouldDoLabelSearch() { this.graph.addVertex(T.label, "Person", "name", "marko"); this.graph.addVertex(T.label, "Person", "name", "john"); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 94787f2..29d9091 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,6 @@ limitations under the License. <module>gremlin-core</module> <module>gremlin-test</module> <module>gremlin-groovy</module> - <module>gremlin-groovy-test</module> <module>tinkergraph-gremlin</module> <module>gremlin-python</module> <module>hadoop-gremlin</module> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/pom.xml ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml index 02e32d7..4f26d48 100644 --- a/tinkergraph-gremlin/pom.xml +++ b/tinkergraph-gremlin/pom.xml @@ -35,24 +35,15 @@ limitations under the License. <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> </dependency> - <!-- provided scope for gremlin-groovy because it is only used for purpose of scriptengine plugin in - the console and server - in which case that jar should already be present --> <dependency> - <groupId>org.apache.tinkerpop</groupId> - <artifactId>gremlin-groovy</artifactId> - <version>${project.version}</version> - <scope>provided</scope> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <scope>test</scope> </dependency> <dependency> <groupId>org.apache.tinkerpop</groupId> - <artifactId>gremlin-groovy-test</artifactId> + <artifactId>gremlin-test</artifactId> <version>${project.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <scope>test</scope> </dependency> </dependencies> <build> http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/groovy/plugin/TinkerGraphGremlinPlugin.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/groovy/plugin/TinkerGraphGremlinPlugin.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/groovy/plugin/TinkerGraphGremlinPlugin.java deleted file mode 100644 index 5c8231a..0000000 --- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/groovy/plugin/TinkerGraphGremlinPlugin.java +++ /dev/null @@ -1,57 +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.tinkergraph.groovy.plugin; - -import org.apache.tinkerpop.gremlin.groovy.plugin.AbstractGremlinPlugin; -import org.apache.tinkerpop.gremlin.groovy.plugin.IllegalEnvironmentException; -import org.apache.tinkerpop.gremlin.groovy.plugin.PluginAcceptor; -import org.apache.tinkerpop.gremlin.groovy.plugin.PluginInitializationException; -import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; - -import java.util.HashSet; -import java.util.Set; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - * @deprecated As of release 3.2.4, replaced by {@link org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin}. - */ -@Deprecated -public final class TinkerGraphGremlinPlugin extends AbstractGremlinPlugin { - - private static final Set<String> IMPORTS = new HashSet<String>() {{ - add(IMPORT_SPACE + TinkerGraph.class.getPackage().getName() + DOT_STAR); - add(IMPORT_SPACE + TinkerGraphComputer.class.getPackage().getName() + DOT_STAR); - }}; - - @Override - public String getName() { - return "tinkerpop.tinkergraph"; - } - - @Override - public void pluginTo(final PluginAcceptor pluginAcceptor) throws PluginInitializationException, IllegalEnvironmentException { - pluginAcceptor.addImports(IMPORTS); - } - - @Override - public void afterPluginTo(final PluginAcceptor pluginAcceptor) throws IllegalEnvironmentException, PluginInitializationException { - - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java index 9d2df0a..79503ea 100644 --- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java +++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraph.java @@ -63,10 +63,6 @@ import java.util.stream.Stream; @Graph.OptIn(Graph.OptIn.SUITE_STRUCTURE_INTEGRATE) @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_STANDARD) @Graph.OptIn(Graph.OptIn.SUITE_PROCESS_COMPUTER) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_STANDARD) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_PROCESS_COMPUTER) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT) -@Graph.OptIn(Graph.OptIn.SUITE_GROOVY_ENVIRONMENT_INTEGRATE) public final class TinkerGraph implements Graph { static { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin b/tinkergraph-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin deleted file mode 100644 index 2c627fe..0000000 --- a/tinkergraph-gremlin/src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.groovy.plugin.GremlinPlugin +++ /dev/null @@ -1 +0,0 @@ -org.apache.tinkerpop.gremlin.tinkergraph.groovy.plugin.TinkerGraphGremlinPlugin \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessComputerTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessComputerTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessComputerTest.java deleted file mode 100644 index decf9f4..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessComputerTest.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.tinkergraph.process.groovy; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.process.GroovyProcessComputerSuite; -import org.apache.tinkerpop.gremlin.tinkergraph.process.TinkerGraphComputerProvider; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(GroovyProcessComputerSuite.class) -@GraphProviderClass(provider = TinkerGraphComputerProvider.class, graph = TinkerGraph.class) -public class TinkerGraphGroovyProcessComputerTest { -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessStandardTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessStandardTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessStandardTest.java deleted file mode 100644 index a900eae..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/TinkerGraphGroovyProcessStandardTest.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.tinkergraph.process.groovy; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.process.GroovyProcessStandardSuite; -import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(GroovyProcessStandardSuite.class) -@GraphProviderClass(provider = TinkerGraphProvider.class, graph = TinkerGraph.class) -public class TinkerGraphGroovyProcessStandardTest { -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/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 deleted file mode 100644 index ca0e58f..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/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.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) - */ -@GraphProvider.Descriptor(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/aa828940/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 deleted file mode 100644 index 67760ce..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/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.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/aa828940/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 deleted file mode 100644 index 058b552..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/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.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/aa828940/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 deleted file mode 100644 index f7e8cc4..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java +++ /dev/null @@ -1,77 +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.tinkergraph.process.groovy.jsr223; - -import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator; -import org.apache.tinkerpop.gremlin.process.computer.GraphComputerTest; -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.MatchTest; -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.EventStrategy; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy; -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", - GraphComputerTest.class.getCanonicalName(), - ProgramTest.Traversals.class.getCanonicalName(), - TraversalInterruptionTest.class.getCanonicalName(), - TraversalInterruptionComputerTest.class.getCanonicalName(), - EventStrategyProcessTest.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.withStrategies(new TranslationStrategy(g, GroovyTranslator.of("g"))); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/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 deleted file mode 100644 index a12210a..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/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.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) - */ -@GraphProvider.Descriptor(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/aa828940/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 deleted file mode 100644 index 08ba513..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/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.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/aa828940/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 deleted file mode 100644 index c017182..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/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.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/aa828940/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 deleted file mode 100644 index 011ad5d..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java +++ /dev/null @@ -1,74 +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.tinkergraph.process.jsr223; - -import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; -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.strategy.decoration.EventStrategyProcessTest; -import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy; -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", - TraversalInterruptionTest.class.getCanonicalName(), - TraversalInterruptionComputerTest.class.getCanonicalName(), - ElementIdStrategyProcessTest.class.getCanonicalName(), - EventStrategyProcessTest.class.getCanonicalName(), - ProgramTest.Traversals.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.withStrategies(new TranslationStrategy(g, JavaTranslator.of(g))); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentIntegrateTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentIntegrateTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentIntegrateTest.java deleted file mode 100644 index b97ec06..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentIntegrateTest.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.tinkergraph.structure.groovy; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.groovy.GroovyEnvironmentIntegrateSuite; -import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader; -import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -@RunWith(GroovyEnvironmentIntegrateSuite.class) -@GraphProviderClass(provider = TinkerGraphProvider.class, graph = TinkerGraph.class) -public class TinkerGraphGroovyEnvironmentIntegrateTest { - static { - SugarLoader.load(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentTest.java deleted file mode 100644 index 6fb0d1d..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphGroovyEnvironmentTest.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.tinkergraph.structure.groovy; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.groovy.GroovyEnvironmentSuite; -import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader; -import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -@RunWith(GroovyEnvironmentSuite.class) -@GraphProviderClass(provider = TinkerGraphProvider.class, graph = TinkerGraph.class) -public class TinkerGraphGroovyEnvironmentTest { - static { - SugarLoader.load(); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphUUIDGroovyEnvironmentTest.java ---------------------------------------------------------------------- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphUUIDGroovyEnvironmentTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphUUIDGroovyEnvironmentTest.java deleted file mode 100644 index a3dfad7..0000000 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/groovy/TinkerGraphUUIDGroovyEnvironmentTest.java +++ /dev/null @@ -1,38 +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.tinkergraph.structure.groovy; - -import org.apache.tinkerpop.gremlin.GraphProviderClass; -import org.apache.tinkerpop.gremlin.groovy.GroovyEnvironmentSuite; -import org.apache.tinkerpop.gremlin.groovy.loaders.SugarLoader; -import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphUUIDProvider; -import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; -import org.junit.runner.RunWith; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(GroovyEnvironmentSuite.class) -@GraphProviderClass(provider = TinkerGraphUUIDProvider.class, graph = TinkerGraph.class) -public class TinkerGraphUUIDGroovyEnvironmentTest { - static { - SugarLoader.load(); - } -} \ No newline at end of file