Package it.unive.lisa.outputs.compare
Class JsonReportComparer
- java.lang.Object
-
- it.unive.lisa.outputs.compare.JsonReportComparer
-
public class JsonReportComparer extends java.lang.ObjectA class providing capabilities for finding differences between twoJsonReports.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceJsonReportComparer.DiffReporterAn object that provides callbacks for reporting differences when comparingJsonReports.static classJsonReportComparer.REPORT_TYPEAn enumeration defining the different type of reports that can be issued.static classJsonReportComparer.REPORTED_COMPONENTAn enumeration defining the different components of aJsonReport, in order to distinguish which one of them caused a difference being reported.
-
Constructor Summary
Constructors Constructor Description JsonReportComparer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancompare(JsonReport first, JsonReport second, java.io.File firstFileRoot, java.io.File secondFileRoot)Compares the two reports.static booleancompare(JsonReport first, JsonReport second, java.io.File firstFileRoot, java.io.File secondFileRoot, JsonReportComparer.DiffReporter reporter)Compares the two reports.
-
-
-
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. TheJsonReportComparer.DiffReporterused during the comparison will dump the differences toSystem.err.- Parameters:
first- the first reportsecond- the second reportfirstFileRoot- 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 wherefirstlies)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 wheresecondlies)- Returns:
trueif 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 reportsecond- the second reportfirstFileRoot- 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 wherefirstlies)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 wheresecondlies)reporter- theJsonReportComparer.DiffReporterthat will be used for dumping the differences found in the two reports- Returns:
trueif and only the two reports are equal- Throws:
java.io.IOException- if errors happen while opening or reading the files contained in the reports
-
-