Add test case for MOVE VERTEX BATCH
@@ -60,6 +60,48 @@ public class OMoveVertexStatementExecutionTest {
rs.close();
+ rs = db.query("select expand(out()) from " + vertexClassName2);
+ Assert.assertTrue(rs.hasNext());
+ rs.next();
+ Assert.assertFalse(rs.hasNext());
+ rs.close();
+
+ rs = db.query("select expand(in()) from " + vertexClassName1);
+ Assert.assertTrue(rs.hasNext());
+ rs.next();
+ Assert.assertFalse(rs.hasNext());
+ rs.close();
+
+ }
+
+ @Test
+ public void testMoveVertexBatch() {
+ String vertexClassName1 = "testMoveVertexBatchV1";
+ String vertexClassName2 = "testMoveVertexBatchV2";
+ String edgeClassName = "testMoveVertexBatchE";
+ db.createVertexClass(vertexClassName1);
+ db.createVertexClass(vertexClassName2);
+ db.createEdgeClass(edgeClassName);
+
+ db.command("create vertex " + vertexClassName1 + " set name = 'a'");
+ db.command("create vertex " + vertexClassName1 + " set name = 'b'");
+ db.command("create edge " + edgeClassName + " from (select from " + vertexClassName1 + " where name = 'a' ) to (select from "
+ + vertexClassName1 + " where name = 'b' )");
+
+ db.command("MOVE VERTEX (select from " + vertexClassName1 + " where name = 'a') to class:" + vertexClassName2 + " BATCH 2");
+ OResultSet rs = db.query("select from " + vertexClassName1);
+ Assert.assertTrue(rs.hasNext());
+ rs.next();
+ Assert.assertFalse(rs.hasNext());
+ rs.close();
+
+ rs = db.query("select from " + vertexClassName2);
+ Assert.assertTrue(rs.hasNext());
+ rs.next();
+ Assert.assertFalse(rs.hasNext());
+ rs.close();
+
+
rs = db.query("select expand(out()) from " + vertexClassName2);
Assert.assertTrue(rs.hasNext());
rs.next();
