SunSPOT API V3.0


junit.framework
Class ComparisonFailure

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Error
          extended by junit.framework.AssertionFailedError
              extended by junit.framework.ComparisonFailure

public class ComparisonFailure
extends AssertionFailedError

Thrown when an assert equals for Strings failed. Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com


Constructor Summary
ComparisonFailure(String message, String expected, String actual)
          Constructs a comparison failure.
 
Method Summary
 String getMessage()
          Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.
 
Methods inherited from class java.lang.Throwable
printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComparisonFailure

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

Parameters:
message - the identifying message or null
expected - the expected string value
actual - the actual string value
Method Detail

getMessage

public String getMessage()
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual.

Overrides:
getMessage in class Throwable
Returns:
the error message string of this Throwable object if it was created with an error message string; or null if it was created with no error message.
See Also:
Throwable.getMessage()

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.