junitx.framework
Class ComparisonFailure
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Error
|
+--junit.framework.AssertionFailedError
|
+--junitx.framework.ComparisonFailure
- All Implemented Interfaces:
- java.io.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
Constructor Summary |
ComparisonFailure(java.lang.String message,
java.lang.String expected,
java.lang.String actual)
Constructs a ComparisonFailure object. |
Method Summary |
protected static java.lang.String |
createMessage(java.lang.String message,
java.lang.String expected,
java.lang.String actual)
Creates the message that is returned by the getMessage method. |
java.lang.String |
getMessage()
|
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ComparisonFailure
public ComparisonFailure(java.lang.String message,
java.lang.String expected,
java.lang.String actual)
- Constructs a ComparisonFailure object.
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in class java.lang.Throwable
createMessage
protected static java.lang.String createMessage(java.lang.String message,
java.lang.String expected,
java.lang.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 © 2002-2003 Vladimir R. Bossicard. All Rights Reserved.