1 package junit.framework; 2 3 8 public class ComparisonFailure extends AssertionFailedError { 9 private static final int MAX_CONTEXT_LENGTH= 20; 10 private static final long serialVersionUID= 1L; 11 12 private String fExpected; 13 private String fActual; 14 15 21 public ComparisonFailure (String message, String expected, String actual) { 22 super (message); 23 fExpected= expected; 24 fActual= actual; 25 } 26 27 33 @Override 34 public String getMessage() { 35 return new ComparisonCompactor(MAX_CONTEXT_LENGTH, fExpected, fActual).compact(super.getMessage()); 36 } 37 38 42 public String getActual() { 43 return fActual; 44 } 45 49 public String getExpected() { 50 return fExpected; 51 } 52 } | Popular Tags |