ttomcat-1778514358873.zip-extract/_dependencies/maven/junit_junit-4.13.2/junit/framework/ComparisonFailure.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/junit_junit-4.13.2/junit/framework/ComparisonFailure.java
Status
scanned
Type
file
Name
ComparisonFailure.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text
Tag

      
    
Rootfs path

      
    
Size
1432 (1.4 KB)
MD5
5c104185083a17a31457ef283198f1a6
SHA1
3ff2c3de9860df06e8fe3166bd51be99d12dd11c
SHA256
9437c270d8debddf1ca650ccafc67405e2b6b63ec6432d12ad2cc69217d7f479
SHA512

      
    
SHA1_git
66433ef3e87bda66061b2f31a91d2fa4bf2558ef
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
ComparisonFailure.java | 1.4 KB |

package junit.framework; /** * Thrown when an assert equals for Strings failed. * * Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com */ public class ComparisonFailure extends AssertionFailedError { private static final int MAX_CONTEXT_LENGTH = 20; private static final long serialVersionUID = 1L; private String fExpected; private String fActual; /** * Constructs a comparison failure. * * @param message the identifying message or null * @param expected the expected string value * @param actual the actual string value */ public ComparisonFailure(String message, String expected, String actual) { super(message); fExpected = expected; fActual = actual; } /** * Returns "..." in place of common prefix and "..." in * place of common suffix between expected and actual. * * @see Throwable#getMessage() */ @Override public String getMessage() { return new ComparisonCompactor(MAX_CONTEXT_LENGTH, fExpected, fActual).compact(super.getMessage()); } /** * Gets the actual string value * * @return the actual string value */ public String getActual() { return fActual; } /** * Gets the expected string value * * @return the expected string value */ public String getExpected() { return fExpected; } }
Email Start line End line
alex@purpletech.com 6 6