Class FeatureReader


  • public class FeatureReader
    extends Object
    Reads the Gherkin feature files of gremlin-test and extracts Gremlin examples.
    • Constructor Detail

      • FeatureReader

        public FeatureReader()
    • Method Detail

      • parseFlat

        public static List<String> parseFlat​(String featureDir)
                                      throws IOException
        Parses features to a List of Gremlin strings.
        Parameters:
        featureDir - The root directory where feature files can be found including subdirectories
        Throws:
        IOException
      • parseFlat

        public static List<String> parseFlat​(String featureDir,
                                             List<org.javatuples.Pair<Pattern,​BiFunction<String,​String,​String>>> parameterMatchers)
                                      throws IOException
        Parses features to a List of Gremlin strings.
        Parameters:
        featureDir - The root directory where feature files can be found including subdirectories
        parameterMatchers - list of pattern/functions that will transform a parameter from its Gherkin form to another format triggering that new formatted string to be inserted into the Gremlin itself
        Throws:
        IOException
      • parseGrouped

        public static Map<String,​List<String>> parseGrouped​(String featureDir)
                                                           throws IOException
        Parses features to a Map structure of the test name as the key with a List of Gremlin strings for the value.
        Parameters:
        featureDir - The root directory where feature files can be found including subdirectories
        Throws:
        IOException
      • parseGrouped

        public static Map<String,​List<String>> parseGrouped​(String featureDir,
                                                                  List<org.javatuples.Pair<Pattern,​BiFunction<String,​String,​String>>> parameterMatchers)
                                                           throws IOException
        Parses features to a Map structure of the test name as the key with a List of Gremlin strings for the value.
        Parameters:
        featureDir - The root directory where feature files can be found including subdirectories
        parameterMatchers - list of pattern/functions that will transform a parameter from its Gherkin form to another format triggering that new formatted string to be inserted into the Gremlin itself
        Throws:
        IOException