Interface JsonReportComparer.DiffAlgorithm

    • Method Detail

      • fileDiff

        void fileDiff​(java.lang.String first,
                      java.lang.String second,
                      java.lang.String message)
        Callback invoked by a JsonReportComparer whenever files from different reports but with matching names have different content.
        Parameters:
        first - the complete (i.e. path + file name) pathname of the first file
        second - the complete (i.e. path + file name) pathname of the second file
        message - the message reporting the difference
      • infoDiff

        void infoDiff​(java.lang.String key,
                      java.lang.String first,
                      java.lang.String second)
        Callback invoked by a JsonReportComparer whenever an analysis information key is mapped to two different values.
        Parameters:
        key - the information key
        first - the value in the first report
        second - the value in the second report
      • configurationDiff

        void configurationDiff​(java.lang.String key,
                               java.lang.String first,
                               java.lang.String second)
        Callback invoked by a JsonReportComparer whenever a configuration key is mapped to two different values.
        Parameters:
        key - the configuration key
        first - the value in the first report
        second - the value in the second report
      • shouldCompareConfigurations

        default boolean shouldCompareConfigurations()
        If true, analysis configurations (JsonReport.getConfiguration()) will be compared.
        Returns:
        whether or not configurations should be compared
      • shouldCompareRunInfos

        default boolean shouldCompareRunInfos()
        If true, run information (JsonReport.getInfo()) will be compared.
        Returns:
        whether or not run informations should be compared
      • shouldCompareWarnings

        default boolean shouldCompareWarnings()
        If true, warnings (JsonReport.getWarnings()) will be compared.
        Returns:
        whether or not warnings should be compared
      • shouldCompareFiles

        default boolean shouldCompareFiles()
        If true, files (JsonReport.getFiles()) will be compared.
        Returns:
        whether or not files should be compared
      • shouldCompareFileContents

        default boolean shouldCompareFileContents()
        If true, content of files produced by both analyses will be compared.
        Returns:
        whether or not file contents should be compared
      • shouldFailFast

        default boolean shouldFailFast()
        If true, comparison will halt after the first failed category (warnings, files, ...) without reporting the full diff.
        Returns:
        whether or not comparison should fail fast
      • isJsonGraph

        default boolean isJsonGraph​(java.lang.String path)
        Yields whether or not the file pointed by the given path should be considered a json graph.
        Parameters:
        path - the path pointing to the file
        Returns:
        true if that condition holds
      • isVisualizationFile

        default boolean isVisualizationFile​(java.lang.String path)
        Yields whether or not the file pointed by the given path is for visualizing results and can thus be skipped as its content depends solely on other files.
        Parameters:
        path - the path pointing to the file
        Returns:
        true if that condition holds
      • customFileCompare

        default boolean customFileCompare​(java.io.File expected,
                                          java.io.File actual)
        Custom comparison method for files that are neither json graphs nor visualization-only files.
        Parameters:
        expected - the file from the expected report
        actual - the file from the actual report
        Returns:
        whether or not a difference was found in the files
        Throws:
        java.lang.UnsupportedOperationException - if file comparisons are not supported for the given file type
      • verboseLabelDiff

        default boolean verboseLabelDiff()
        If true, the full diff between two labels will be reported when a difference is found. Otherwise, a simple message is reported.
        Returns:
        whether or not label diff reporting should be verbose