junitx.framework
Class ComparisonFailure

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Error
          extended by java.lang.AssertionError
              extended by junit.framework.AssertionFailedError
                  extended by 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

Constructor Summary
ComparisonFailure(String message, String expected, String actual)
          Constructs a ComparisonFailure object.
 
Method Summary
protected static String createMessage(String message, String expected, String actual)
          Creates the message that is returned by the getMessage method.
 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
 

Constructor Detail

ComparisonFailure

public ComparisonFailure(String message,
                         String expected,
                         String actual)
Constructs a ComparisonFailure object.

Method Detail

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:



Copyright © 2004-2011. All Rights Reserved.