You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by pl...@apache.org on 2015/10/12 17:11:13 UTC

[14/27] incubator-tinkerpop git commit: Include test for manual transactions in sessions of Gremlin Server.

Include test for manual transactions in sessions of Gremlin Server.


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

Branch: refs/heads/TINKERPOP3-865
Commit: d86705cce455b082b765340f597d7a092883db2f
Parents: d13c2d0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Oct 8 16:41:19 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Oct 8 16:41:19 2015 -0400

----------------------------------------------------------------------
 .../server/GremlinDriverIntegrateTest.java      | 33 ++++++++++++++++++++
 1 file changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d86705cc/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index 288aa3a..4196b95 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@ -96,6 +96,7 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
                 break;
             case "shouldExecuteScriptInSessionOnTransactionalGraph":
             case "shouldExecuteSessionlessScriptOnTransactionalGraph":
+            case "shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph":
                 deleteDirectory(new File("/tmp/neo4j"));
                 settings.graphs.put("graph", "conf/neo4j-empty.properties");
                 break;
@@ -563,6 +564,38 @@ public class GremlinDriverIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
+    public void shouldExecuteScriptInSessionOnTransactionalWithManualTransactionsGraph() throws Exception {
+        assumeNeo4jIsPresent();
+
+        final Cluster cluster = Cluster.build().create();
+        final Client client = cluster.connect(name.getMethodName());
+
+        client.submit("graph.tx().onReadWrite(Transaction.READ_WRITE_BEHAVIOR.MANUAL);null").all().get();
+        client.submit("graph.tx().open()").all().get();
+
+        final Vertex vertexBeforeTx = client.submit("v=graph.addVertex(\"name\",\"stephen\")").all().get().get(0).getVertex();
+        assertEquals("stephen", vertexBeforeTx.values("name").next());
+
+        final Vertex vertexFromV = client.submit("graph.vertices().next()").all().get().get(0).getVertex();
+        assertEquals("stephen", vertexFromV.values("name").next());
+
+        final Vertex vertexFromBinding = client.submit("v").all().get().get(0).getVertex();
+        assertEquals("stephen", vertexFromBinding.values("name").next());
+
+        client.submit("v.property(\"color\",\"blue\")").all().get();
+        client.submit("graph.tx().commit()").all().get();
+        client.submit("graph.tx().open()").all().get();
+
+        final Vertex vertexAfterTx = client.submit("graph.vertices().next()").all().get().get(0).getVertex();
+        assertEquals("stephen", vertexAfterTx.values("name").next());
+        assertEquals("blue", vertexAfterTx.values("color").next());
+
+        client.submit("graph.tx().rollback()").all().get();
+
+        cluster.close();
+    }
+
+    @Test
     public void shouldExecuteSessionlessScriptOnTransactionalGraph() throws Exception {
         assumeNeo4jIsPresent();