assertEquals(3, actions.size());
// Load and verify PrintMessageAction was loaded correctly.
CmdLineAction action = findAction("PrintMessageAction", actions);
assertTrue(action instanceof PrintMessageAction);
PrintMessageAction pma = (PrintMessageAction) action;
assertEquals("Prints out a given message", pma.getDescription());
ActionMessagePrinter printer = new ActionMessagePrinter();
try {
pma.execute(printer);
fail("Should have thrown IllegalArgumentException");
} catch (IllegalArgumentException e) { /* do nothing */ }
assertEquals(0, printer.getPrintedMessages().size());
// Load and verify PrintHelloWorldAction was loaded correctly.
action = findAction("PrintHelloWorldAction", actions);
assertTrue(action instanceof PrintMessageAction);
pma = (PrintMessageAction) action;
assertEquals("Prints out 'Hello World'", pma.getDescription());
assertEquals("Hello World", pma.getMessage());
pma.execute(printer);
assertEquals(1, printer.getPrintedMessages().size());
assertEquals(pma.getMessage(), printer.getPrintedMessages().get(0));
}