public abstract class AbstractGremlinTest extends Object
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config |
protected GraphTraversalSource |
g |
protected Graph |
graph |
protected GraphProvider |
graphProvider |
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) |
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) |
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 |
verifyUniqueStepIds(Traversal.Admin<?,?> traversal) |
protected static final boolean shouldTestIteratorLeak
protected Graph graph
protected GraphTraversalSource g
protected Configuration config
protected GraphProvider graphProvider
public 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 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)
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.