Class MavenTestTimeExtractor

java.lang.Object
de.oktoflow.platform.cmdTools.MavenTestTimeExtractor

public class MavenTestTimeExtractor extends Object
Extracts Maven surefire test timings to CSV.
Author:
ChatGPT
  • Field Details

    • TEST_PATTERN

      private static final Pattern TEST_PATTERN
  • Constructor Details

    • MavenTestTimeExtractor

      public MavenTestTimeExtractor()
  • Method Details

    • main

      public static void main(String[] args)
      Extracts maven surefire test times.
      Parameters:
      args - the first file is the maven log file, the second the output CSV to be created
    • process

      private static void process(Path inputFile, Path outputFile, Pattern pattern, Pattern skipPattern, Function<Matcher,String> elapsedTimeFn, Function<Matcher,String> testClassFn)
      Processes the input file to the output file.
      Parameters:
      inputFile - the input file
      outputFile - the output file
      pattern - the test output regex
      skipPattern - optional skip pattern, skip input lines until this pattern is found, may be null
      elapsedTimeFn - a function that returns the elapsed time from a matching matcher
      testClassFn - a function that returns the test class name from a matching matcher
    • readTail

      public static void readTail(File inputFile, File outputFile)
      Alternative execution point, for env logs.
      Parameters:
      inputFile - the env log input file
      outputFile - the output file