Skip to content

Commit

Permalink
modify java client ha test in listProcedures
Browse files Browse the repository at this point in the history
  • Loading branch information
lipanpan03 committed Nov 21, 2023
1 parent 4a450ec commit a543aef
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,10 @@ public static void listProcedures(TuGraphDbRpcClient client) throws Exception {
log.info("testListProcedures : " + result);
JSONArray array = JSONObject.parseArray(result);
assert array.size()==2;
try {
result = client.listProcedures("CPP", "v1", "default", host+":29093");
} catch (Exception e) {
result = client.listProcedures("CPP", "v1", "default", host+":29094");
}
array = JSONObject.parseArray(result);
assert array.size()==2;
String result2 = client.listProcedures("CPP", "v1", "default", host+":29093");
String result3 = client.listProcedures("CPP", "v1", "default", host+":29094");
JSONArray array2 = JSONObject.parseArray(result2), array3 = JSONObject.parseArray(result3);
assert array2.size()==2 || array3.size()==2;
}

public static void deleteProcedure(TuGraphDbRpcClient client) throws Exception {
Expand Down Expand Up @@ -274,16 +271,13 @@ public static void haClientTest() throws Exception {
importDataFromFile(client);

// query after importing data
Thread.sleep(10000);
String res2 = client.callCypher("MATCH (n:Person) RETURN count(n)", "default", 10);
JSONObject jsonObject1 = (JSONObject)JSONObject.parseArray(res2).get(0);
assert (jsonObject1.containsKey("count(n)"));
assert (jsonObject1.getIntValue("count(n)") == 13);

try {
res2 = client.callCypher("MATCH (n:Person) RETURN count(n)", "default", 10, host+":29094");
} catch (Exception e) {
res2 = client.callCypher("MATCH (n:Person) RETURN count(n)", "default", 10, host+":29093");
}
res2 = client.callCypher("MATCH (n:Person) RETURN count(n)", "default", 10, host+":29094");
jsonObject1 = (JSONObject)JSONObject.parseArray(res2).get(0);
assert (jsonObject1.containsKey("count(n)"));
assert (jsonObject1.getIntValue("count(n)") == 13);
Expand Down

0 comments on commit a543aef

Please sign in to comment.