*
* @see SwarmActionFactory#getAction(int)
*/
public void testGetActionInt()
{
WaspAction action;
try
{
action = factory.getAction(-1);// -1 does not exist
fail("found action that should not be registered by the default factory: " + action);
}
catch (IllegalArgumentException e)
{
log.debug(e.getMessage());
}
String[] names = new String[] { "access", "access, inherit", "access, render",
"access, inherit, render", "access", "access, inherit", "access, render, enable",
"access, inherit, render, enable" };
for (int i = 0; i < 8; i++)
{
action = factory.getAction(i);
assertNotNull("action " + i + "was null", action);
assertEquals("iteration " + i, names[i], action.getName());
}
try
{
action = factory.getAction(8);// 8 does not exist
fail("found action that should not be registered by the default factory: " + action);