JUnit-addons
version 1.4

junitx.framework
Class ArrayAssert

java.lang.Object
  |
  +--junitx.framework.ArrayAssert

public class ArrayAssert
extends java.lang.Object

A set of assert methods specially targetted to asserting arrays.

Version:
$Revision: 1.11 $ $Date: 2003/04/14 01:06:32 $
Author:
Vladimir R. Bossicard

Method Summary
static void assertEquals(boolean[] expected, boolean[] actual)
          Asserts that two arrays are equal.
static void assertEquals(byte[] expected, byte[] actual)
          Asserts that two arrays are equal.
static void assertEquals(char[] expected, char[] actual)
          Asserts that two arrays are equal.
static void assertEquals(double[] expected, double[] actual, double delta)
          Asserts that two arrays are equal.
static void assertEquals(float[] expected, float[] actual, float delta)
          Asserts that two arrays are equal.
static void assertEquals(int[] expected, int[] actual)
          Asserts that two arrays are equal.
static void assertEquals(long[] expected, long[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.Object[] expected, java.lang.Object[] actual)
          Asserts that two arrays are equal.
static void assertEquals(short[] expected, short[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, boolean[] expected, boolean[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, byte[] expected, byte[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, char[] expected, char[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, double[] expected, double[] actual, double delta)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, float[] expected, float[] actual, float delta)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, int[] expected, int[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, long[] expected, long[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, java.lang.Object[] expected, java.lang.Object[] actual)
          Asserts that two arrays are equal.
static void assertEquals(java.lang.String message, short[] expected, short[] actual)
          Asserts that two arrays are equal.
static void assertEquivalenceArrays(java.lang.Object[] expected, java.lang.Object[] actual)
          Assertion that both arrays has the same elements, but not necessarily in the same order.
static void assertEquivalenceArrays(java.lang.String message, java.lang.Object[] expected, java.lang.Object[] actual)
          Asserts that two arrays have the same elements, but not necessarily in the same order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assertEquals

public static void assertEquals(java.lang.String message,
                                java.lang.Object[] expected,
                                java.lang.Object[] actual)
Asserts that two arrays are equal. Throws an AssertionFailedError if they are not. Two arrays are considered equals if:


assertEquals

public static void assertEquals(java.lang.Object[] expected,
                                java.lang.Object[] actual)
Asserts that two arrays are equal. Throws an AssertionFailedError if they are not.


assertEquals

public static void assertEquals(double[] expected,
                                double[] actual,
                                double delta)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - a double array of expected values
actual - a double array of actual values
delta - tolerated delta

assertEquals

public static void assertEquals(java.lang.String message,
                                double[] expected,
                                double[] actual,
                                double delta)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - a double array of expected values
actual - a double array of actual values
delta - tolerated delta

assertEquals

public static void assertEquals(java.lang.String message,
                                float[] expected,
                                float[] actual,
                                float delta)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - a float array of expected values
actual - a float array of actual values
delta - tolerated delta

assertEquals

public static void assertEquals(float[] expected,
                                float[] actual,
                                float delta)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - a float array of expected values
actual - a float array of actual values
delta - tolerated delta

assertEquals

public static void assertEquals(java.lang.String message,
                                long[] expected,
                                long[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - a long array of expected values
actual - a long array of actual values

assertEquals

public static void assertEquals(long[] expected,
                                long[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - a long array of expected values
actual - a long array of actual values

assertEquals

public static void assertEquals(java.lang.String message,
                                int[] expected,
                                int[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - an int array of expected values
actual - an int array of actual values

assertEquals

public static void assertEquals(int[] expected,
                                int[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - an int array of expected values
actual - an int array of actual values

assertEquals

public static void assertEquals(java.lang.String message,
                                short[] expected,
                                short[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - a short array of expected values
actual - a short array of actual values

assertEquals

public static void assertEquals(short[] expected,
                                short[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - a short array of expected values
actual - a short array of actual values

assertEquals

public static void assertEquals(java.lang.String message,
                                char[] expected,
                                char[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - a short array of expected values
actual - a short array of actual values

assertEquals

public static void assertEquals(char[] expected,
                                char[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - a short array of expected values
actual - a short array of actual values

assertEquals

public static void assertEquals(java.lang.String message,
                                boolean[] expected,
                                boolean[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - a short array of expected values
actual - a short array of actual values

assertEquals

public static void assertEquals(boolean[] expected,
                                boolean[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - a short array of expected values
actual - a short array of actual values

assertEquals

public static void assertEquals(java.lang.String message,
                                byte[] expected,
                                byte[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
message - message to display when arrays are not equal
expected - a byte array of expected values
actual - a byte array of actual values

assertEquals

public static void assertEquals(byte[] expected,
                                byte[] actual)
Asserts that two arrays are equal. Two arrays are considered equal if:

Parameters:
expected - a byte array of expected values
actual - a byte array of actual values

assertEquivalenceArrays

public static void assertEquivalenceArrays(java.lang.String message,
                                           java.lang.Object[] expected,
                                           java.lang.Object[] actual)
Asserts that two arrays have the same elements, but not necessarily in the same order. If order is important then use assertEquals(). If a difference is found, the object is listed by calling its toString() method. Arrays are equal if both are null. Equality of objects uses the equals method.

Parameters:
message - message to display when arrays are not equal
expected - an Object array of expected values
actual - an Object array of actual values
See Also:
assertEquals(String message, Object[] expected, Object[] actual)

assertEquivalenceArrays

public static void assertEquivalenceArrays(java.lang.Object[] expected,
                                           java.lang.Object[] actual)
Assertion that both arrays has the same elements, but not necessarily in the same order. If order is important then use assertEquals(). If a difference is found, the object is listed by calling its toString() method. Arrays are equal if both are null. Equality of objects uses the equals method.

Parameters:
expected - an Object array of expected values
actual - an Object array of actual values
See Also:
assertEquals(String message, Object[] expected, Object[] actual)

JUnit-addons
version 1.4

Copyright © 2002-2003 Vladimir R. Bossicard. All Rights Reserved.