Package org.apache.tinkerpop.gremlin
Class AbstractGremlinTest
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.AbstractGremlinTest
 
- 
- Direct Known Subclasses:
- AbstractGeneratorTest,- AbstractGremlinProcessTest,- AddVertexTest,- CommunityGeneratorTest.ProcessorTest,- DetachedEdgeTest,- DetachedGraphTest,- DetachedPropertyTest,- DetachedVertexPropertyTest,- DetachedVertexTest,- DistributionGeneratorTest.ProcessorTest,- DropTest,- 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.GraphSONV2D0Test,- IoTest.GraphSONV3D0Test,- IoTest.GryoTest,- IoVertexTest,- MergeEdgeTest,- MergeVertexTest,- PropertyTest.BasicPropertyTest,- PropertyTest.ElementGetValueExceptionConsistencyTest,- PropertyTest.PropertyFeatureSupportTest,- PropertyTest.PropertyValidationOnAddExceptionConsistencyTest,- PropertyTest.PropertyValidationOnSetExceptionConsistencyTest,- ReferenceEdgeTest,- ReferenceGraphTest,- ReferenceVertexPropertyTest,- ReferenceVertexTest,- SerializationTest.GraphSONV1d0Test,- SerializationTest.GraphSONV2d0Test,- SerializationTest.GraphSONV3d0Test,- SerializationTest.GryoV1d0Test,- SerializationTest.GryoV3d0Test,- StarGraphTest,- TransactionTest,- VariablesTest.GraphVariablesFeatureSupportTest,- VariablesTest.StringRepresentationTest,- VariablesTest.VariableAsMapTest,- VariablesTest.VariableExceptionConsistencyTest,- VertexPropertyTest,- VertexPropertyTest.BasicVertexProperty,- VertexPropertyTest.VertexPropertyAddition,- VertexPropertyTest.VertexPropertyProperties,- VertexPropertyTest.VertexPropertyRemoval,- VertexTest.AddEdgeTest,- VertexTest.BasicVertexTest
 
 public abstract class AbstractGremlinTest extends Object Sets up g based on the current graph configuration and checks required features for the test.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected org.apache.commons.configuration2.Configurationconfigprotected GraphTraversalSourcegprotected Graphgraphprotected GraphProvidergraphProviderorg.junit.rules.TestNamenameprotected static booleanshouldTestIteratorLeak
 - 
Constructor SummaryConstructors Constructor Description AbstractGremlinTest()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterLoadGraphWith(Graph g)static voidassertVertexEdgeCounts(Graph graph, int expectedVertexCount, int expectedEdgeCount)protected voidbeforeLoadGraphWith(Graph g)EdgeconvertToEdge(String outVertexName, String edgeLabel, String inVertexName)EdgeconvertToEdge(Graph graph, String outVertexName, String edgeLabel, String inVertexName)ObjectconvertToEdgeId(String outVertexName, String edgeLabel, String inVertexName)ObjectconvertToEdgeId(Graph graph, String outVertexName, String edgeLabel, String inVertexName)VertexconvertToVertex(String vertexName)VertexconvertToVertex(Graph graph, String vertexName)ObjectconvertToVertexId(String vertexName)Looks up the identifier as generated by the current source graph being tested.ObjectconvertToVertexId(Graph graph, String vertexName)Looks up the identifier as generated by the current source graph being tested.VertexPropertyconvertToVertexProperty(String vertexName, String propertyKey, Object propertyValue)GraphTraversal<Vertex,VertexProperty<Object>>convertToVertexProperty(Graph graph, String vertexName, String vertexPropertyKey)GraphTraversal<Vertex,Object>convertToVertexPropertyId(String vertexName, String vertexPropertyKey)GraphTraversal<Vertex,Object>convertToVertexPropertyId(Graph graph, String vertexName, String vertexPropertyKey)static Consumer<Graph>getAssertVertexEdgeCounts(int expectedVertexCount, int expectedEdgeCount)voidprintTraversalForm(Traversal traversal)voidsetup()voidtearDown()voidtryCommit(Graph graph)Utility method that commits if the graph supports transactions.voidtryCommit(Graph graph, Consumer<Graph> assertFunction)Utility 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 Detail- 
shouldTestIteratorLeakprotected static final boolean shouldTestIteratorLeak 
 - 
graphprotected Graph graph 
 - 
gprotected GraphTraversalSource g 
 - 
configprotected org.apache.commons.configuration2.Configuration config 
 - 
graphProviderprotected GraphProvider graphProvider 
 - 
namepublic org.junit.rules.TestName name 
 
- 
 - 
Method Detail- 
convertToVertexIdpublic Object convertToVertexId(String vertexName) 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
 
 - 
convertToVertexIdpublic Object convertToVertexId(Graph graph, String vertexName) Looks up the identifier as generated by the current source graph being tested.- Parameters:
- graph- the graph to get the element id from
- vertexName- a unique string that will identify a graph element within a graph
- Returns:
- the id as generated by the graph
 
 - 
convertToVertexPropertyIdpublic GraphTraversal<Vertex,Object> convertToVertexPropertyId(String vertexName, String vertexPropertyKey) 
 - 
convertToVertexPropertyIdpublic GraphTraversal<Vertex,Object> convertToVertexPropertyId(Graph graph, String vertexName, String vertexPropertyKey) 
 - 
convertToVertexPropertypublic GraphTraversal<Vertex,VertexProperty<Object>> convertToVertexProperty(Graph graph, String vertexName, String vertexPropertyKey) 
 - 
convertToVertexPropertypublic VertexProperty convertToVertexProperty(String vertexName, String propertyKey, Object propertyValue) 
 - 
convertToEdgepublic Edge convertToEdge(String outVertexName, String edgeLabel, String inVertexName) 
 - 
convertToEdgepublic Edge convertToEdge(Graph graph, String outVertexName, String edgeLabel, String inVertexName) 
 - 
convertToEdgeIdpublic Object convertToEdgeId(String outVertexName, String edgeLabel, String inVertexName) 
 - 
convertToEdgeIdpublic Object convertToEdgeId(Graph graph, String outVertexName, String edgeLabel, String inVertexName) 
 - 
tryCommitpublic void tryCommit(Graph graph) Utility method that commits if the graph supports transactions.
 - 
tryCommitpublic 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. It assumes that the assertion should be true before and after the commit.
 - 
tryRollbackpublic void tryRollback(Graph graph) Utility method that rollsback if the graph supports transactions.
 - 
printTraversalFormpublic void printTraversalForm(Traversal traversal) 
 - 
assertVertexEdgeCountspublic static void assertVertexEdgeCounts(Graph graph, int expectedVertexCount, int expectedEdgeCount) 
 - 
getAssertVertexEdgeCountspublic static Consumer<Graph> getAssertVertexEdgeCounts(int expectedVertexCount, int expectedEdgeCount) 
 - 
verifyUniqueStepIdspublic static void verifyUniqueStepIds(Traversal.Admin<?,?> traversal) 
 - 
verifyRootIdentificationpublic static void verifyRootIdentification(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.
 
- 
 
-