diff --git a/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java b/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java index 9319036a2..a6fd52658 100644 --- a/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java +++ b/client/src/test/java/com/vesoft/nebula/client/storage/MockStorageData.java @@ -29,7 +29,7 @@ public static void initGraph() { NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig(); nebulaPoolConfig.setMaxConnSize(100); - List addresses = Arrays.asList(new HostAddress("127.0.0.1", 9671)); + List addresses = Arrays.asList(new HostAddress("127.0.0.1", 9669)); NebulaPool pool = new NebulaPool(); Session session = null; try { diff --git a/client/src/test/java/com/vesoft/nebula/client/storage/MockUtil.java b/client/src/test/java/com/vesoft/nebula/client/storage/MockUtil.java index 284a36201..17e95e8e8 100644 --- a/client/src/test/java/com/vesoft/nebula/client/storage/MockUtil.java +++ b/client/src/test/java/com/vesoft/nebula/client/storage/MockUtil.java @@ -23,6 +23,7 @@ public class MockUtil { public static List mockVertexDataSets() { List columnNames = new ArrayList<>(); + columnNames.add("_vid".getBytes()); columnNames.add("person._vid".getBytes()); columnNames.add("person.boolean_col1".getBytes()); columnNames.add("person.long_col2".getBytes()); @@ -35,6 +36,7 @@ public static List mockVertexDataSets() { // row 1 List values1 = new ArrayList<>(); values1.add(Value.sVal("Tom".getBytes())); + values1.add(Value.sVal("Tom".getBytes())); values1.add(Value.bVal(true)); values1.add(Value.iVal(12)); values1.add(Value.fVal(1.0)); @@ -43,7 +45,7 @@ public static List mockVertexDataSets() { values1.add(Value.dtVal(new DateTime((short) 2020, (byte) 1, (byte) 1, (byte) 12, (byte) 10, (byte) 30, 100))); values1.add(Value.ggVal(new Geography(Geography.PTVAL, - new Point(new Coordinate(1.0,1.5))))); + new Point(new Coordinate(1.0, 1.5))))); List rows = new ArrayList<>(); rows.add(new Row(values1)); diff --git a/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java b/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java index a527daa82..fa7d84370 100644 --- a/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java +++ b/client/src/test/java/com/vesoft/nebula/client/storage/StorageClientTest.java @@ -64,7 +64,6 @@ public void testScanVertexWithNoCol() { ScanVertexResultIterator resultIterator = client.scanVertex( "testStorage", "person"); - int count = 0; while (resultIterator.hasNext()) { ScanVertexResult result = null; try { @@ -76,7 +75,6 @@ public void testScanVertexWithNoCol() { if (result.isEmpty()) { continue; } - count += result.getVertices().size(); Assert.assertEquals(1, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_vid")); assert (result.isAllSuccess()); @@ -106,7 +104,6 @@ public void testScanVertexWithNoCol() { } } } - assert (count == 5); } @Test @@ -121,7 +118,6 @@ public void testScanVertexWithCols() { "testStorage", "person", Arrays.asList("name", "age")); - int count = 0; while (resultIterator.hasNext()) { ScanVertexResult result = null; try { @@ -133,7 +129,6 @@ public void testScanVertexWithCols() { if (result.isEmpty()) { continue; } - count += result.getVertices().size(); Assert.assertEquals(3, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_vid")); assert (result.getPropNames().get(1).equals("name")); @@ -172,7 +167,6 @@ public void testScanVertexWithCols() { assert (Arrays.asList(18L, 20L, 23L, 15L, 25L).contains(tableRow.getLong(2))); } } - assert (count == 5); } @Test @@ -187,7 +181,6 @@ public void testScanVertexWithAllCol() { "testStorage", "person", Arrays.asList()); - int count = 0; while (resultIterator.hasNext()) { ScanVertexResult result = null; try { @@ -199,14 +192,12 @@ public void testScanVertexWithAllCol() { if (result.isEmpty()) { continue; } - count += result.getVertices().size(); Assert.assertEquals(3, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_vid")); assert (Arrays.asList("name", "age").contains(result.getPropNames().get(1))); assert (Arrays.asList("name", "age").contains(result.getPropNames().get(2))); assert (result.isAllSuccess()); } - assert (count == 5); } @Test @@ -220,7 +211,6 @@ public void testScanEdgeWithoutCol() { ScanEdgeResultIterator resultIterator = client.scanEdge( "testStorage", "friend"); - int count = 0; while (resultIterator.hasNext()) { ScanEdgeResult result = null; try { @@ -232,7 +222,6 @@ public void testScanEdgeWithoutCol() { if (result.isEmpty()) { continue; } - count += result.getEdges().size(); Assert.assertEquals(3, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_src")); assert (result.getPropNames().get(1).equals("_dst")); @@ -270,7 +259,6 @@ public void testScanEdgeWithoutCol() { } } } - assert (count == 5); } @Test @@ -285,7 +273,6 @@ public void testScanEdgeWithCols() { "testStorage", "friend", Arrays.asList("likeness")); - int count = 0; while (resultIterator.hasNext()) { ScanEdgeResult result = null; try { @@ -297,7 +284,6 @@ public void testScanEdgeWithCols() { if (result.isEmpty()) { continue; } - count += result.getEdges().size(); Assert.assertEquals(4, result.getPropNames().size()); assert (result.getPropNames().get(0).equals("_src")); assert (result.getPropNames().get(1).equals("_dst")); @@ -341,7 +327,6 @@ public void testScanEdgeWithCols() { assert (Arrays.asList(1.0, 2.1, 3.2, 4.5, 5.9).contains(tableRow.getDouble(3))); } } - assert (count == 5); } @Test @@ -356,7 +341,6 @@ public void testScanEdgeWithAllCols() { "testStorage", "friend", Arrays.asList()); - int count = 0; while (resultIterator.hasNext()) { ScanEdgeResult result = null; try { @@ -368,7 +352,6 @@ public void testScanEdgeWithAllCols() { if (result.isEmpty()) { continue; } - count += result.getEdges().size(); Assert.assertEquals(4, result.getPropNames().size()); assert (Arrays.asList("_src", "_dst", "_rank", "likeness") .contains(result.getPropNames().get(0))); @@ -380,7 +363,6 @@ public void testScanEdgeWithAllCols() { .contains(result.getPropNames().get(3))); assert (result.isAllSuccess()); } - assert (count == 5); } @Test @@ -501,6 +483,7 @@ private void assertIterator(ScanVertexResultIterator resultIterator) { } } } + System.out.println("count:" + count); assert (count == 5); } }