Package org.junit

Class ComparisonFailure.ComparisonCompactor

java.lang.Object
org.junit.ComparisonFailure.ComparisonCompactor
Enclosing class:
ComparisonFailure

private static class ComparisonFailure.ComparisonCompactor extends Object
  • Field Details

    • ELLIPSIS

      private static final String ELLIPSIS
      See Also:
    • DIFF_END

      private static final String DIFF_END
      See Also:
    • DIFF_START

      private static final String DIFF_START
      See Also:
    • contextLength

      private final int contextLength
      The maximum length for expected and actual strings to show. When contextLength is exceeded, the Strings are shortened.
    • expected

      private final String expected
    • actual

      private final String actual
  • Constructor Details

    • ComparisonCompactor

      public ComparisonCompactor(int contextLength, String expected, String actual)
      Parameters:
      contextLength - the maximum length of context surrounding the difference between the compared strings. When context length is exceeded, the prefixes and suffixes are compacted.
      expected - the expected string value
      actual - the actual string value
  • Method Details

    • compact

      public String compact(String message)
    • sharedPrefix

      private String sharedPrefix()
    • sharedSuffix

      private String sharedSuffix(String prefix)