public abstract class AbstractGremlinTest extends Object
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config |
protected GraphTraversalSource |
g |
protected Graph |
graph |
protected Optional<Class<? extends GraphComputer>> |
graphComputerClass |
protected GraphProvider |
graphProvider |
TestName |
name |
Constructor and Description |
---|
AbstractGremlinTest() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterLoadGraphWith(Graph g) |
static Consumer<Graph> |
assertVertexEdgeCounts(int expectedVertexCount,
int expectedEdgeCount) |
protected void |
beforeLoadGraphWith(Graph g) |
Object |
convertToEdgeId(Graph graph,
String outVertexName,
String edgeLabel,
String inVertexName) |
Object |
convertToEdgeId(String outVertexName,
String edgeLabel,
String inVertexName) |
Vertex |
convertToVertex(Graph graph,
String vertexName) |
Object |
convertToVertexId(Graph g,
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.
|
void |
printTraversalForm(Traversal traversal) |
void |
setup() |
void |
tearDown() |
void |
tryCommit(Graph g)
Utility method that commits if the graph supports transactions.
|
void |
tryCommit(Graph g,
Consumer<Graph> assertFunction)
Utility method that commits if the graph supports transactions and executes an assertion function before and
after the commit.
|
void |
tryRandomCommit(Graph g) |
void |
tryRollback(Graph g)
Utility method that rollsback if the graph supports transactions.
|
static void |
validateException(Throwable expected,
Throwable actual) |
protected Graph graph
protected GraphTraversalSource g
protected Optional<Class<? extends GraphComputer>> graphComputerClass
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 g, String vertexName)
g
- the graph to get the element id fromvertexName
- a unique string that will identify a graph element within a graphpublic Object convertToEdgeId(String outVertexName, String edgeLabel, String inVertexName)
public Object convertToEdgeId(Graph graph, String outVertexName, String edgeLabel, String inVertexName)
public void tryCommit(Graph g)
public void tryRandomCommit(Graph g)
public void tryCommit(Graph g, Consumer<Graph> assertFunction)
public void tryRollback(Graph g)
public void printTraversalForm(Traversal traversal)
public static Consumer<Graph> assertVertexEdgeCounts(int expectedVertexCount, int expectedEdgeCount)
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.