}
public void testEquals()
throws Exception
{
ArrayType arrayType = new ArrayType(3, SimpleType.STRING);
assertTrue("null is not an array type", arrayType.equals(null) == false);
assertTrue("object is not an array type", arrayType.equals(new Object()) == false);
assertTrue("should be equal", arrayType.equals(arrayType));
ArrayType arrayType2 = new ArrayType(3, SimpleType.STRING);
assertTrue("should be equal, even though different instances", arrayType.equals(arrayType2));
assertTrue("should be equal, even though different instances", arrayType2.equals(arrayType));
arrayType2 = new ArrayType(2, SimpleType.STRING);
assertTrue("should not be equal, wrong number of dimensions", arrayType.equals(arrayType2) == false);
assertTrue("should not be equal, wrong number of dimensions", arrayType2.equals(arrayType) == false);
arrayType2 = new ArrayType(3, SimpleType.INTEGER);
assertTrue("should not be equal, wrong element type", arrayType.equals(arrayType2) == false);
assertTrue("should not be equal, wrong element type", arrayType2.equals(arrayType) == false);
}