Skip to content

Commit

Permalink
update ha java test
Browse files Browse the repository at this point in the history
  • Loading branch information
lipanpan03 committed Nov 21, 2023
1 parent 88ac26c commit 4a450ec
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public static void callProcedure(TuGraphDbRpcClient client) throws Exception {
String result = client.callProcedure("CPP", "sortstr", "gecfb", 1000, false, "default");
log.info("testCallProcedure : " + result);
assert ("bcefg".equals(result));
result = client.callProcedure("CPP", "sortstr", "gecfb", 1000, false, "default", host+":29093");
try {
result = client.callProcedure("CPP", "sortstr", "gecfb", 1000, false, "default", host+":29093");
} catch (Exception e) {
result = client.callProcedure("CPP", "sortstr", "gecfb", 1000, false, "default", host+":29094");
}
log.info("testCallProcedure : " + result);
assert ("bcefg".equals(result));
}
Expand All @@ -70,7 +74,11 @@ public static void listProcedures(TuGraphDbRpcClient client) throws Exception {
log.info("testListProcedures : " + result);
JSONArray array = JSONObject.parseArray(result);
assert array.size()==2;
result = client.listProcedures("CPP", "v1", "default", host+":29093");
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;
}
Expand Down Expand Up @@ -271,7 +279,11 @@ public static void haClientTest() throws Exception {
assert (jsonObject1.containsKey("count(n)"));
assert (jsonObject1.getIntValue("count(n)") == 13);

res2 = client.callCypher("MATCH (n:Person) RETURN count(n)", "default", 10, host+":29094");
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");
}
jsonObject1 = (JSONObject)JSONObject.parseArray(res2).get(0);
assert (jsonObject1.containsKey("count(n)"));
assert (jsonObject1.getIntValue("count(n)") == 13);
Expand Down

0 comments on commit 4a450ec

Please sign in to comment.