assertNotNull(gl.toString());
}
public void testMethods()
{
final GroupList gl = new GroupList();
try
{
gl.add(null);
}
catch (NullPointerException npe)
{
// expected, ignored
}
final RelationalGroup g1 = new RelationalGroup();
gl.add(g1);
gl.add(g1);
assertTrue(gl.size() == 1); // the old instance gets removed and replaced by the new group
gl.add(new RelationalGroup());
assertTrue(gl.size() == 1); // the old instance gets removed and replaced by the new group
final RelationalGroup g2 = new RelationalGroup();
g2.addField("Test");
final RelationalGroup g3 = new RelationalGroup();
g3.addField("Failure");
// group g2 and g3 are unreleated, g2 is no child or parent of g3
gl.add(g2);
try
{
gl.add(g3);
fail();
}
catch (IllegalArgumentException iea)
{
// expected, ignored
}
assertEquals(2, gl.size());
}