Class StacktraceTestToolkit

java.lang.Object
org.openjdk.jmc.flightrecorder.test.util.StacktraceTestToolkit

public class StacktraceTestToolkit extends Object
Utility for presenting aggregates stack traces in textual form.
  • Constructor Details

    • StacktraceTestToolkit

      public StacktraceTestToolkit()
  • Method Details

    • getTestResources

      public static IOResourceSet[] getTestResources() throws IOException
      Return the files that can be used for comparing old printouts.
      Returns:
      the test file need for comparing files.
      Throws:
      IOException - if the files could not be located.
    • getStacktracesDirectory

      public static File getStacktracesDirectory() throws IOException
      Return the directory where the stacktrace baseline files reside.
      Returns:
      the printout file directory
      Throws:
      IOException - if the directory could not be found
    • printStacktraces

      public static void printStacktraces(File sourceFile, File destinationFile) throws IOException, CouldNotLoadRecordingException
      Prints the aggregated stacktraces from of a recording to another file in text format.
      Parameters:
      sourceFile - the source recording file
      destinationFile - the destination file for the printing.
      Throws:
      IOException
      CouldNotLoadRecordingException
    • getStacktracesBaseline

      public static List<String> getStacktracesBaseline(IOResourceSet resourceSet) throws IOException, Exception
      Throws:
      IOException
      Exception
    • getLines

      public static List<String> getLines(String content)
      Get lines, including empty lines represented by empty string.
    • getAggregatedStacktraceLines

      public static List<String> getAggregatedStacktraceLines(IItemCollection items)
      Gets the aggregated stack traces from an item collection as a list of strings.
      Parameters:
      items - the item collection
      Returns:
      a list of strings representing the aggregated stack traces