public abstract class AbstractGremlinTest extends Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.configuration2.Configuration |
config |
protected GraphTraversalSource |
g |
protected Graph |
graph |
protected GraphProvider |
graphProvider |
org.junit.rules.TestName |
name |
protected static boolean |
shouldTestIteratorLeak |
Constructor and Description |
---|
AbstractGremlinTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterLoadGraphWith(Graph g) |
static void |
assertVertexEdgeCounts(Graph graph,
int expectedVertexCount,
int expectedEdgeCount) |
protected void |
beforeLoadGraphWith(Graph g) |
Edge |
convertToEdge(Graph graph,
String outVertexName,
String edgeLabel,
String inVertexName) |
Edge |
convertToEdge(String outVertexName,
String edgeLabel,
String inVertexName) |
Object |
convertToEdgeId(Graph graph,
String outVertexName,
String edgeLabel,
String inVertexName) |
Object |
convertToEdgeId(String outVertexName,
String edgeLabel,
String inVertexName) |
Vertex |
convertToVertex(Graph graph,
String vertexName) |
Vertex |
convertToVertex(String vertexName) |
Object |
convertToVertexId(Graph graph,
String vertexName)
Looks up the identifier as generated by the current source graph being tested.
|
Object |
convertToVertexId(String vertexName)
Looks up the identifier as generated by the current source graph being tested.
|
GraphTraversal<Vertex,VertexProperty<Object>> |
convertToVertexProperty(Graph graph,
String vertexName,
String vertexPropertyKey) |
VertexProperty |
convertToVertexProperty(String vertexName,
String propertyKey,
Object propertyValue) |
GraphTraversal<Vertex,Object> |
convertToVertexPropertyId(Graph graph,
String vertexName,
String vertexPropertyKey) |
GraphTraversal<Vertex,Object> |
convertToVertexPropertyId(String vertexName,
String vertexPropertyKey) |
static Consumer<Graph> |
getAssertVertexEdgeCounts(int expectedVertexCount,
int expectedEdgeCount) |
void |
printTraversalForm(Traversal traversal) |
void |
setup() |
void |
tearDown() |
void |
tryCommit(Graph graph)
Utility method that commits if the graph supports transactions.
|
void |
tryCommit(Graph graph,
Consumer<Graph> assertFunction)
Utility method that commits if the graph supports transactions and executes an assertion function before and
after the commit.
|
void |
tryRollback(Graph graph)
Utility method that rollsback if the graph supports transactions.
|
static void |
validateException(Throwable expected,
Throwable actual) |
static void |
verifyRootIdentification(Traversal.Admin<?,?> traversal,
boolean expectRoot)
Ensures that the
Traversal and all of its children is constructed in a fashion where the parent/child
relationship is properly established. |
static void |
verifyUniqueStepIds(Traversal.Admin<?,?> traversal) |
protected static final boolean shouldTestIteratorLeak
protected Graph graph
protected GraphTraversalSource g
protected org.apache.commons.configuration2.Configuration config
protected GraphProvider graphProvider
public org.junit.rules.TestName name
public Object convertToVertexId(String vertexName)
vertexName
- a unique string that will identify a graph element within a graphpublic Object convertToVertexId(Graph graph, String vertexName)
graph
- the graph to get the element id fromvertexName
- a unique string that will identify a graph element within a graphpublic GraphTraversal<Vertex,Object> convertToVertexPropertyId(String vertexName, String vertexPropertyKey)
public GraphTraversal<Vertex,Object> convertToVertexPropertyId(Graph graph, String vertexName, String vertexPropertyKey)
public GraphTraversal<Vertex,VertexProperty<Object>> convertToVertexProperty(Graph graph, String vertexName, String vertexPropertyKey)
public VertexProperty convertToVertexProperty(String vertexName, String propertyKey, Object propertyValue)
public Edge convertToEdge(String outVertexName, String edgeLabel, String inVertexName)
public Edge convertToEdge(Graph graph, String outVertexName, String edgeLabel, String inVertexName)
public Object convertToEdgeId(String outVertexName, String edgeLabel, String inVertexName)
public Object convertToEdgeId(Graph graph, String outVertexName, String edgeLabel, String inVertexName)
public void tryCommit(Graph graph)
public void tryCommit(Graph graph, Consumer<Graph> assertFunction)
public void tryRollback(Graph graph)
public void printTraversalForm(Traversal traversal)
public static void assertVertexEdgeCounts(Graph graph, int expectedVertexCount, int expectedEdgeCount)
public static Consumer<Graph> getAssertVertexEdgeCounts(int expectedVertexCount, int expectedEdgeCount)
public static void verifyUniqueStepIds(Traversal.Admin<?,?> traversal)
public static void verifyRootIdentification(Traversal.Admin<?,?> traversal, boolean expectRoot)
Traversal
and all of its children is constructed in a fashion where the parent/child
relationship is properly established.Copyright © 2013–2022 Apache Software Foundation. All rights reserved.