You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/03/16 15:40:09 UTC
[27/50] incubator-tinkerpop git commit: Renamed test so that it is
actually an integration test.
Renamed test so that it is actually an integration test.
Added generate-all.groovy for the RemoteServer integration testing.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/1974c712
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/1974c712
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/1974c712
Branch: refs/heads/TINKERPOP-575
Commit: 1974c712a51756e2ee0ed586220e2e73d95032ca
Parents: d04261b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Mar 11 18:10:27 2016 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Mar 16 09:50:47 2016 -0400
----------------------------------------------------------------------
gremlin-server/scripts/generate-all.groovy | 32 +++++++++++++
.../gremlin/server/WithServerIntegrateTest.java | 49 ++++++++++++++++++++
.../server/WithServerIntegrationTest.java | 49 --------------------
3 files changed, 81 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1974c712/gremlin-server/scripts/generate-all.groovy
----------------------------------------------------------------------
diff --git a/gremlin-server/scripts/generate-all.groovy b/gremlin-server/scripts/generate-all.groovy
new file mode 100644
index 0000000..ec3ab69
--- /dev/null
+++ b/gremlin-server/scripts/generate-all.groovy
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+// an init script that returns a Map allows explicit setting of global bindings.
+def globals = [:]
+
+// Generates the modern graph into an "empty" TinkerGraph via LifeCycleHook.
+// Note that the name of the key in the "global" map is unimportant.
+globals << [hook : [
+ onStartUp: { ctx ->
+ TinkerFactory.generateClassic(classic)
+ TinkerFactory.generateModern(modern)
+ TinkerFactory.generateTheCrew(crew)
+ grateful.io(gryo()).readGraph('../data/grateful-dead.kryo')
+ }
+] as LifeCycleHook]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1974c712/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrateTest.java
new file mode 100644
index 0000000..683a164
--- /dev/null
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrateTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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.server;
+
+import org.apache.tinkerpop.gremlin.driver.Cluster;
+import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection;
+import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
+import org.junit.Test;
+
+import java.util.Collections;
+
+/**
+ * @author Stephen Mallette (http://stephen.genoprime.com)
+ */
+public class WithServerIntegrateTest extends AbstractGremlinServerIntegrationTest {
+ @Override
+ public Settings overrideSettings(final Settings settings) {
+ settings.scriptEngines.get("gremlin-groovy").scripts = Collections.singletonList("scripts/generate-modern.groovy");
+ return settings;
+ }
+
+ @Test
+ public void shouldDoServerGraphReturningVertices() {
+ final Cluster cluster = Cluster.open();
+ final Graph graph = RemoteGraph.open(DriverRemoteConnection.using(cluster), TinkerGraph.class);
+ final GraphTraversalSource g = graph.traversal();
+ g.V().forEachRemaining(v -> System.out.println("TEST: " + v.toString()));
+ cluster.close();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1974c712/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrationTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrationTest.java
deleted file mode 100644
index 40c8f8a..0000000
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/WithServerIntegrationTest.java
+++ /dev/null
@@ -1,49 +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.server;
-
-import org.apache.tinkerpop.gremlin.driver.Cluster;
-import org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection;
-import org.apache.tinkerpop.gremlin.process.remote.RemoteGraph;
-import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph;
-import org.junit.Test;
-
-import java.util.Collections;
-
-/**
- * @author Stephen Mallette (http://stephen.genoprime.com)
- */
-public class WithServerIntegrationTest extends AbstractGremlinServerIntegrationTest {
- @Override
- public Settings overrideSettings(final Settings settings) {
- settings.scriptEngines.get("gremlin-groovy").scripts = Collections.singletonList("scripts/generate-modern.groovy");
- return settings;
- }
-
- @Test
- public void shouldDoServerGraphReturningVertices() {
- final Cluster cluster = Cluster.open();
- final Graph graph = RemoteGraph.open(DriverRemoteConnection.using(cluster), TinkerGraph.class);
- final GraphTraversalSource g = graph.traversal();
- g.V().forEachRemaining(v -> System.out.println("TEST: " + v.toString()));
- cluster.close();
- }
-}