Package org.junit.internal
Class ArrayComparisonFailure
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- java.lang.AssertionError
-
- org.junit.internal.ArrayComparisonFailure
-
- All Implemented Interfaces:
Serializable
public class ArrayComparisonFailure extends AssertionError
Thrown when two array elements differ
-
-
Constructor Summary
Constructors Constructor Description ArrayComparisonFailure(String message, AssertionError cause, int index)Construct a newArrayComparisonFailurewith an error text and the array's dimension that was not equal
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDimension(int index)StringgetMessage()Returns the detail message string of this throwable.StringtoString()Returns a short description of this throwable.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace
-
-
-
-
Constructor Detail
-
ArrayComparisonFailure
public ArrayComparisonFailure(String message, AssertionError cause, int index)
Construct a newArrayComparisonFailurewith an error text and the array's dimension that was not equal- Parameters:
cause- the exception that caused the array's content to fail the assertion testindex- the array position of the objects that are not equal.- See Also:
Assert.assertArrayEquals(String, Object[], Object[])
-
-
Method Detail
-
addDimension
public void addDimension(int index)
-
getMessage
public String getMessage()
Description copied from class:ThrowableReturns the detail message string of this throwable.- Overrides:
getMessagein classThrowable- Returns:
- the detail message string of this
Throwableinstance (which may benull).
-
toString
public String toString()
Returns a short description of this throwable. The result is the concatenation of:- the name of the class of this object
- ": " (a colon and a space)
- the result of invoking this object's
Throwable.getLocalizedMessage()method
getLocalizedMessagereturnsnull, then just the class name is returned.
-
-