}
}
public void testSelectColors() throws Exception
{
Facade facade = FacadeUtil.getHome().create();
IDClass[] ids = new IDClass[]{new IDClass(555), new IDClass(666), new IDClass(777)};
try
{
facade.createChild(ids[0]);
ColorEnum min = ColorEnum.RED.valueOf(0);
facade.setColor(ids[0], min);
facade.createChild(ids[1]);
ColorEnum avg = ColorEnum.RED.valueOf(1);
facade.setColor(ids[1], avg);
facade.createChild(ids[2]);
ColorEnum max = ColorEnum.RED.valueOf(2);
facade.setColor(ids[2], max);
ColorEnum color = facade.selectMinColor();
assertEquals(min, color);
color = facade.selectMaxColor();
assertEquals(max, color);
color = facade.selectAvgColor();
assertEquals(avg, color);
}
finally
{
for(int i = 0; i < ids.length; ++i)
facade.removeChild(ids[i]);
}
}