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.
|
GraphTraversal<Vertex,VertexProperty<Object>> |
convertToVertexProperty(Graph graph,
String vertexName,
String vertexPropertyKey) |
GraphTraversal<Vertex,Object> |
convertToVertexPropertyId(Graph g,
String vertexName,
String vertexPropertyKey) |
GraphTraversal<Vertex,Object> |
convertToVertexPropertyId(String vertexName,
String vertexPropertyKey) |
boolean |
isComputerTest() |
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) |
static void |
verifyUniqueStepIds(Traversal.Admin<?,?> traversal) |
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 GraphTraversal<Vertex,Object> convertToVertexPropertyId(String vertexName, String vertexPropertyKey)
public GraphTraversal<Vertex,Object> convertToVertexPropertyId(Graph g, String vertexName, String vertexPropertyKey)
public GraphTraversal<Vertex,VertexProperty<Object>> convertToVertexProperty(Graph graph, String vertexName, String vertexPropertyKey)
public 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 boolean isComputerTest()
public static Consumer<Graph> assertVertexEdgeCounts(int expectedVertexCount, int expectedEdgeCount)
public static void verifyUniqueStepIds(Traversal.Admin<?,?> traversal)
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.