Package org.apache.tinkerpop.gremlin
Class AbstractGremlinTest
java.lang.Object
org.apache.tinkerpop.gremlin.AbstractGremlinTest
- Direct Known Subclasses:
AbstractGeneratorTest,AbstractGremlinProcessTest,CommunityGeneratorTest.ProcessorTest,DetachedEdgeTest,DetachedGraphTest,DetachedPropertyTest,DetachedVertexPropertyTest,DetachedVertexTest,DistributionGeneratorTest.ProcessorTest,EdgeTest.BasicEdgeTest,FeatureSupportTest.EdgeFunctionalityTest,FeatureSupportTest.ElementPropertyDataTypeFunctionalityTest,FeatureSupportTest.FeatureToStringTest,FeatureSupportTest.GraphFunctionalityTest,FeatureSupportTest.GraphVariablesFunctionalityTest,FeatureSupportTest.LogicalFeatureSupportTest,FeatureSupportTest.VertexFunctionalityTest,FeatureSupportTest.VertexPropertyFunctionalityTest,GraphConstructionTest,GraphTest,IoCustomTest,IoEdgeTest,IoGraphTest,IoPropertyTest,IoTest.GraphMLTest,IoTest.GraphSONLegacyTest,IoTest.GraphSONTest,IoTest.GraphSONV2Test,IoTest.GraphSONV3Test,IoTest.GryoTest,IoVertexTest,PropertyTest.BasicPropertyTest,PropertyTest.ElementGetValueExceptionConsistencyTest,PropertyTest.PropertyFeatureSupportTest,PropertyTest.PropertyValidationOnAddExceptionConsistencyTest,PropertyTest.PropertyValidationOnSetExceptionConsistencyTest,ReferenceEdgeTest,ReferenceGraphTest,ReferenceVertexPropertyTest,ReferenceVertexTest,SerializationTest.GraphSONV1Test,SerializationTest.GraphSONV2Test,SerializationTest.GraphSONV3Test,SerializationTest.GryoV1Test,SerializationTest.GryoV3Test,StarGraphTest,TransactionMultiThreadedTest,TransactionTest,VariablesTest.GraphVariablesFeatureSupportTest,VariablesTest.StringRepresentationTest,VariablesTest.VariableAsMapTest,VariablesTest.VariableExceptionConsistencyTest,VertexPropertyTest,VertexPropertyTest.BasicVertexProperty,VertexPropertyTest.VertexPropertyAddition,VertexPropertyTest.VertexPropertyProperties,VertexPropertyTest.VertexPropertyRemoval,VertexTest.AddEdgeTest,VertexTest.BasicVertexTest
Sets up g based on the current graph configuration and checks required features for the test.
- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.commons.configuration2.Configurationprotected GraphTraversalSourceprotected Graphprotected GraphProviderorg.junit.rules.TestNameprotected static final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidstatic voidassertVertexEdgeCounts(Graph graph, int expectedVertexCount, int expectedEdgeCount) protected voidconvertToEdge(String outVertexName, String edgeLabel, String inVertexName) convertToEdge(Graph graph, String outVertexName, String edgeLabel, String inVertexName) convertToEdgeId(String outVertexName, String edgeLabel, String inVertexName) convertToEdgeId(Graph graph, String outVertexName, String edgeLabel, String inVertexName) convertToVertex(String vertexName) convertToVertex(Graph graph, String vertexName) convertToVertexId(String vertexName) Looks up the identifier as generated by the current source graph being tested.convertToVertexId(Graph graph, String vertexName) Looks up the identifier as generated by the current source graph being tested.convertToVertexProperty(String vertexName, String propertyKey, Object propertyValue) convertToVertexProperty(Graph graph, String vertexName, String vertexPropertyKey) convertToVertexPropertyId(String vertexName, String vertexPropertyKey) convertToVertexPropertyId(Graph graph, String vertexName, String vertexPropertyKey) getAssertVertexEdgeCounts(int expectedVertexCount, int expectedEdgeCount) voidprintTraversalForm(Traversal traversal) voidsetup()voidtearDown()voidUtility method that commits if the graph supports transactions.voidUtility method that commits if the graph supports transactions and executes an assertion function before and after the commit.voidtryRollback(Graph graph) Utility method that rollsback if the graph supports transactions.static voidvalidateException(Throwable expected, Throwable actual) static voidverifyRootIdentification(Traversal.Admin<?, ?> traversal, boolean expectRoot) Ensures that theTraversaland all of its children is constructed in a fashion where the parent/child relationship is properly established.static voidverifyUniqueStepIds(Traversal.Admin<?, ?> traversal)
-
Field Details
-
shouldTestIteratorLeak
protected static final boolean shouldTestIteratorLeak -
graph
-
g
-
config
protected org.apache.commons.configuration2.Configuration config -
graphProvider
-
name
public org.junit.rules.TestName name
-
-
Constructor Details
-
AbstractGremlinTest
public AbstractGremlinTest()
-
-
Method Details
-
setup
- Throws:
Exception
-
beforeLoadGraphWith
- Throws:
Exception
-
afterLoadGraphWith
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
convertToVertexId
Looks up the identifier as generated by the current source graph being tested.- Parameters:
vertexName- a unique string that will identify a graph element within a graph- Returns:
- the id as generated by the graph
-
convertToVertexId
Looks up the identifier as generated by the current source graph being tested.- Parameters:
graph- the graph to get the element id fromvertexName- a unique string that will identify a graph element within a graph- Returns:
- the id as generated by the graph
-
convertToVertex
-
convertToVertex
-
convertToVertexPropertyId
public GraphTraversal<Vertex,Object> convertToVertexPropertyId(String vertexName, String vertexPropertyKey) -
convertToVertexPropertyId
-
convertToVertexProperty
public GraphTraversal<Vertex,VertexProperty<Object>> convertToVertexProperty(Graph graph, String vertexName, String vertexPropertyKey) -
convertToVertexProperty
public VertexProperty convertToVertexProperty(String vertexName, String propertyKey, Object propertyValue) -
convertToEdge
-
convertToEdge
-
convertToEdgeId
-
convertToEdgeId
-
tryCommit
Utility method that commits if the graph supports transactions. -
tryCommit
Utility method that commits if the graph supports transactions and executes an assertion function before and after the commit. It assumes that the assertion should be true before and after the commit. -
tryRollback
Utility method that rollsback if the graph supports transactions. -
printTraversalForm
-
assertVertexEdgeCounts
public static void assertVertexEdgeCounts(Graph graph, int expectedVertexCount, int expectedEdgeCount) -
getAssertVertexEdgeCounts
-
validateException
-
verifyUniqueStepIds
-
verifyRootIdentification
Ensures that theTraversaland all of its children is constructed in a fashion where the parent/child relationship is properly established.
-