Class AbstractGremlinTest

    • Field Detail

      • shouldTestIteratorLeak

        protected static final boolean shouldTestIteratorLeak
      • graph

        protected Graph graph
      • config

        protected org.apache.commons.configuration2.Configuration config
      • name

        public org.junit.rules.TestName name
    • Constructor Detail

      • AbstractGremlinTest

        public AbstractGremlinTest()
    • Method Detail

      • convertToVertexId

        public 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
      • convertToVertexId

        public 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
      • convertToVertex

        public Vertex convertToVertex​(String vertexName)
      • convertToVertex

        public Vertex convertToVertex​(Graph graph,
                                      String vertexName)
      • convertToEdge

        public Edge convertToEdge​(String outVertexName,
                                  String edgeLabel,
                                  String inVertexName)
      • tryCommit

        public void tryCommit​(Graph graph)
        Utility method that commits if the graph supports transactions.
      • tryCommit

        public 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.
      • tryRollback

        public void tryRollback​(Graph graph)
        Utility method that rollsback if the graph supports transactions.
      • printTraversalForm

        public void printTraversalForm​(Traversal traversal)
      • assertVertexEdgeCounts

        public static void assertVertexEdgeCounts​(Graph graph,
                                                  int expectedVertexCount,
                                                  int expectedEdgeCount)
      • getAssertVertexEdgeCounts

        public static Consumer<Graph> getAssertVertexEdgeCounts​(int expectedVertexCount,
                                                                int expectedEdgeCount)
      • validateException

        public static void validateException​(Throwable expected,
                                             Throwable actual)
      • verifyUniqueStepIds

        public static void verifyUniqueStepIds​(Traversal.Admin<?,​?> traversal)
      • verifyRootIdentification

        public static void verifyRootIdentification​(Traversal.Admin<?,​?> traversal,
                                                    boolean expectRoot)
        Ensures that the Traversal and all of its children is constructed in a fashion where the parent/child relationship is properly established.