Skip to content

Commit

Permalink
Add call cypher result interface (#16)
Browse files Browse the repository at this point in the history
* add cypher result interface

* add cypher result interface

* add cypher result interface

* add cypher result interface

* fix cypher result

* fix cypher result

* fix cypher result

* modify version

* modify header

* modify header
  • Loading branch information
lipanpan03 authored Jun 6, 2024
1 parent 059fda2 commit ec0441e
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 39 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</licenses>

<properties>
<revision>1.4.1</revision>
<revision>1.4.2</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<netty.version>4.1.44.Final</netty.version>
<lombok.version>1.18.28</lombok.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.ArrayList;

public class TuGraphDbRpcClientTest {
static Logger log = LoggerFactory.getLogger(TuGraphDbRpcClientTest.class);
Expand All @@ -15,11 +14,13 @@ public static void deleteProcedure(TuGraphDbRpcClient client) {
log.info("----------------testDeleteProcedure--------------------");
try {
boolean result = client.deleteProcedure("CPP", "sortstr", "default");
log.info("deleteProcedure : " + result);
log.info("deleteProcedure sortstr : " + result);
assert (result);
// should throw TuGraphDbRpcException
result = client.deleteProcedure("CPP", "scan_graph", "default");
log.info("loadProcedure : " + result);
log.info("deleteProcedure scan_graph : " + result);
result = client.deleteProcedure("CPP", "multi_file", "default");
log.info("deleteProcedure multi_file : " + result);
} catch (Exception e) {
log.info("catch Exception : " + e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ static void importDataFromContent(Logger log, TuGraphDbRpcClient client, boolean
JSONObject jsonObject = jsonArray.getJSONObject(0);
assert (jsonObject.containsKey("COUNT(n)"));
assert (jsonObject.getIntValue("COUNT(n)") == 13);
res = client.callCypher("MATCH (n) RETURN n,n.name LIMIT 3", "default", 10, true);
log.info("MATCH (n) RETURN n,n.name LIMIT 3 : " + res);
}

static void importSchemaFromFile(Logger log, TuGraphDbRpcClient client, boolean isHa) throws Exception {
Expand Down Expand Up @@ -190,7 +192,7 @@ static void importDataFromFile(Logger log, TuGraphDbRpcClient client, boolean is
assert (jsonObject.containsKey("COUNT(n)"));
assert (jsonObject.getIntValue("COUNT(n)") == 13);

res = client.callCypher("match(n) -[r]->(m) return count(r)", "default", 1000);
res = client.callCypher("match (n)-[r]->(m) return count(r)", "default", 1000);
log.info("match(n) -[r]->(m) return count(r) : " + res);
jsonArray = JSONArray.parseArray(res);
assert (jsonArray.size() == 1);
Expand Down
Loading

0 comments on commit ec0441e

Please sign in to comment.