Class JsonReportComparer


  • public class JsonReportComparer
    extends java.lang.Object
    A class providing capabilities for finding differences between two JsonReports.
    • Constructor Detail

      • JsonReportComparer

        public JsonReportComparer()
    • Method Detail

      • compare

        public static boolean compare​(JsonReport first,
                                      JsonReport second,
                                      java.io.File firstFileRoot,
                                      java.io.File secondFileRoot)
                               throws java.io.IOException
        Compares the two reports. The JsonReportComparer.DiffReporter used during the comparison will dump the differences to System.err.
        Parameters:
        first - the first report
        second - the second report
        firstFileRoot - the root folder for the resolution of the file names in the first report (this should be either the workdir of that analysis or the folder where first lies)
        secondFileRoot - the root folder for the resolution of the file names in the second report (this should be either the workdir of that analysis or the folder where second lies)
        Returns:
        true if and only the two reports are equal
        Throws:
        java.io.IOException - if errors happen while opening or reading the files contained in the reports
      • compare

        public static boolean compare​(JsonReport first,
                                      JsonReport second,
                                      java.io.File firstFileRoot,
                                      java.io.File secondFileRoot,
                                      JsonReportComparer.DiffReporter reporter)
                               throws java.io.IOException
        Compares the two reports.
        Parameters:
        first - the first report
        second - the second report
        firstFileRoot - the root folder for the resolution of the file names in the first report (this should be either the workdir of that analysis or the folder where first lies)
        secondFileRoot - the root folder for the resolution of the file names in the second report (this should be either the workdir of that analysis or the folder where second lies)
        reporter - the JsonReportComparer.DiffReporter that will be used for dumping the differences found in the two reports
        Returns:
        true if and only the two reports are equal
        Throws:
        java.io.IOException - if errors happen while opening or reading the files contained in the reports