Class ReflectionBasedNeo4jClient
java.lang.Object
org.evomaster.client.java.controller.internal.db.neo4j.ReflectionBasedNeo4jClient
Talks to the SUT's Neo4j driver through reflection, so that EvoMaster never has a compile-time
dependency on
neo4j-java-driver and cannot clash with whichever version the SUT ships.
Mirrors the approach of ReflectionBasedRedisClient: every Class.forName /
getMethod / invoke lives here, behind an ordinary typed API, so its callers hold
no reflection of their own.
Only primitive projections cross this boundary (ids, label and type names, property maps), never
the driver's own Node / Relationship types, which keeps the reflected surface down
to Session.run, Result.list, Record.get and Value.as*.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<?>voidvoidEmpties the database: every node and every relationship attached to it.Reads the fieldkeyout of aRecord.List<?>runAndList(Object session, String cypher) Runs a read-only Cypher query and returns its records.List<?>Runs a parameterised Cypher query and returns its records.session()Opens a session.
-
Constructor Details
-
ReflectionBasedNeo4jClient
- Parameters:
driver- the SUT'sorg.neo4j.driver.Driver
-
-
Method Details
-
session
Opens a session. The caller is responsible for passing it toclose(Object). -
close
-
runAndList
Runs a read-only Cypher query and returns its records. -
runAndList
Runs a parameterised Cypher query and returns its records. Values travel as a parameter map rather than being interpolated into the query text, which avoids quoting and typing problems.- Parameters:
parameters- keys are parameter names without the leading$, values are the values to bind to them
-
detachDeleteAll
public void detachDeleteAll()Empties the database: every node and every relationship attached to it. -
get
Reads the fieldkeyout of aRecord. -
asString
-
asList
-
asMap
-