assertEquals(2, options.size());
// Load and verify printHelloWorld was loaded correctly.
CmdLineOption option = getOptionByName("printHelloWorld", options);
assertTrue(option instanceof AdvancedCmdLineOption);
AdvancedCmdLineOption advancedOption = (AdvancedCmdLineOption) option;
assertEquals("phw", advancedOption.getShortOption());
assertEquals("printHelloWorld", advancedOption.getLongOption());
assertEquals("Print Hello World", advancedOption.getDescription());
assertFalse(advancedOption.hasArgs());
assertEquals(1, advancedOption.getStaticArgs().size());
assertEquals("Hello World!", advancedOption.getStaticArgs().get(0));
assertEquals(1, advancedOption.getRequirementRules().size());
assertEquals("PrintMessageAction", ((ActionDependencyRule) advancedOption
.getRequirementRules().get(0)).getActionName());
assertEquals(Relation.OPTIONAL, ((ActionDependencyRule) advancedOption
.getRequirementRules().get(0)).getRelation());
// Load and verify printMessage was loaded correctly.
option = getOptionByName("printMessage", options);
assertTrue(option instanceof AdvancedCmdLineOption);
advancedOption = (AdvancedCmdLineOption) option;
assertEquals("pm", advancedOption.getShortOption());
assertEquals("printMessage", advancedOption.getLongOption());
assertEquals("Message to print out", advancedOption.getDescription());
assertEquals(true, advancedOption.hasArgs());
assertEquals("message", advancedOption.getArgsDescription());
assertEquals(1, advancedOption.getRequirementRules().size());
assertEquals("PrintMessageAction", ((ActionDependencyRule) advancedOption
.getRequirementRules().get(0)).getActionName());
assertEquals(Relation.REQUIRED, ((ActionDependencyRule) advancedOption
.getRequirementRules().get(0)).getRelation());
assertNotNull(advancedOption.getHandler());
assertTrue(advancedOption.getHandler() instanceof ApplyToActionHandler);
assertEquals(1, ((ApplyToActionHandler) advancedOption.getHandler())
.getApplyToActions().size());
assertEquals(findAction("PrintMessageAction", actions).getName(),
((ApplyToActionHandler) advancedOption.getHandler())
.getApplyToActions().get(0).getActionName());
assertEquals("setMessage",
((ApplyToActionHandler) advancedOption.getHandler())
.getApplyToActions().get(0).getMethodName());
}