Class ExecutionTimesReport

java.lang.Object
com.carrotsearch.ant.tasks.junit4.listeners.ExecutionTimesReport
All Implemented Interfaces:
AggregatedEventListener

public class ExecutionTimesReport extends Object implements AggregatedEventListener
A report listener that emits per-suite execution times information useful for load balancing tests across JVMs.
  • Field Details

  • Constructor Details

    • ExecutionTimesReport

      public ExecutionTimesReport()
  • Method Details

    • setFile

      public void setFile(File hintsFile)
      Hints file (key-value pairs).
    • setHistoryLength

      public void setHistoryLength(int length)
      How many execution times to store per-suite? The history must be larger than 0.
    • onSuiteResult

      public void onSuiteResult(AggregatedSuiteResultEvent e)
      Remember execution time for all executed suites.
    • onEnd

      public void onEnd(AggregatedQuitEvent e)
      Write back to hints file.
    • setOuter

      public void setOuter(JUnit4 outer) throws org.apache.tools.ant.BuildException
      Description copied from interface: AggregatedEventListener
      Link to the container. Listener can throw BuildException if parameter validation doesn't succeed, for example.
      Specified by:
      setOuter in interface AggregatedEventListener
      Throws:
      org.apache.tools.ant.BuildException
    • readHints

      public static Map<String,List<Long>> readHints(File hints) throws IOException
      Read hints from a file.
      Throws:
      IOException
    • mergeHints

      public static void mergeHints(InputStream is, Map<String,List<Long>> hints) throws IOException
      Read hints from a file and merge with the given hints map.
      Throws:
      IOException
    • writeHints

      public static void writeHints(File file, Map<String,List<Long>> hints) throws IOException
      Writes back hints file.
      Throws:
      IOException
    • mergeHints

      public static Map<String,List<Long>> mergeHints(Collection<org.apache.tools.ant.types.ResourceCollection> resources, Collection<String> suiteNames)
      Read hints from all resources in a collection, retaining suiteNames. If suiteNames is null, everything is retained.