nassertEquals(a,b)
relies on the
equals() method
of the class under test.
nThe effect is to evaluate a.equals(
b ).
nIt is up to the class under test to determine
a suitable equality
relation. JUnit uses whatever is
available.
nAny class under test that does not override the equals() method from class Object will get the default equals() behaviour – that is, object identity.
nIf a and b are of a primitive type such as int, boolean, etc., then the following is done for assertEquals(a,b)
:
na and b are converted to their equivalent object
type (Integer, Boolean, etc.), and then a.equals( b ) is evaluated.
n