Package org.junit
Class ComparisonFailure.ComparisonCompactor
- java.lang.Object
-
- org.junit.ComparisonFailure.ComparisonCompactor
-
- Enclosing class:
- ComparisonFailure
private static class ComparisonFailure.ComparisonCompactor extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ComparisonFailure.ComparisonCompactor.DiffExtractor
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
actual
private int
contextLength
The maximum length forexpected
andactual
strings to show.private static java.lang.String
DIFF_END
private static java.lang.String
DIFF_START
private static java.lang.String
ELLIPSIS
private java.lang.String
expected
-
Constructor Summary
Constructors Constructor Description ComparisonCompactor(int contextLength, java.lang.String expected, java.lang.String actual)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
compact(java.lang.String message)
private java.lang.String
sharedPrefix()
private java.lang.String
sharedSuffix(java.lang.String prefix)
-
-
-
Field Detail
-
ELLIPSIS
private static final java.lang.String ELLIPSIS
- See Also:
- Constant Field Values
-
DIFF_END
private static final java.lang.String DIFF_END
- See Also:
- Constant Field Values
-
DIFF_START
private static final java.lang.String DIFF_START
- See Also:
- Constant Field Values
-
contextLength
private final int contextLength
The maximum length forexpected
andactual
strings to show. WhencontextLength
is exceeded, the Strings are shortened.
-
expected
private final java.lang.String expected
-
actual
private final java.lang.String actual
-
-
Constructor Detail
-
ComparisonCompactor
public ComparisonCompactor(int contextLength, java.lang.String expected, java.lang.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 valueactual
- the actual string value
-
-