junitx.framework
Class ComparisonFailure
java.lang.Object
java.lang.Throwable
java.lang.Error
java.lang.AssertionError
junit.framework.AssertionFailedError
junitx.framework.ComparisonFailure
- All Implemented Interfaces:
- Serializable
public class ComparisonFailure
- extends junit.framework.AssertionFailedError
Thrown when an assert equals for Strings failed (class
junitx.framework.Assert).
Usage
To use this new class, you'll have to invoke the assertEquals method
(for String objects) of the junitx.framework.Assert class:
junitx.framework.Assert.assertEquals(message, expected, actual);
- Version:
- $Revision: 1.1 $ $Date: 2003/03/21 06:13:49 $
- Author:
- Vladimir R. Bossicard
- See Also:
- Serialized Form
ComparisonFailure
public ComparisonFailure(String message,
String expected,
String actual)
- Constructs a ComparisonFailure object.
getMessage
public String getMessage()
- Overrides:
getMessage
in class Throwable
createMessage
protected static String createMessage(String message,
String expected,
String actual)
- Creates the message that is returned by the getMessage method.
The message is optimized so that its 'actual' part does either:
- represent a word (delimited by stopper characters)
- contain 10 characters
Copyright © 2004-2011. All Rights Reserved.