}
}
{
//test missing project param
final JobsTool tool = new JobsTool(getFrameworkInstance());
tool.internalResolver=new SingleProjectResolver() {
public boolean hasSingleProject() {
return false;
}
public String getSingleProjectName() {
return null;
}
};
try {
final String[] args = {"list", "-n", "test1"};
final CommandLine line = tool.parseArgs(args);
tool.validateOptions(line, args);
fail("should have thrown missing argument exception.");
} catch (CLIToolOptionsException e) {
assertNotNull(e);
assertTrue("wrong message:" + e.getMessage(), e.getMessage().startsWith(
"list action: -p/--project option is required"));
}
}
{
//test missing project param, defaulting to single project
final JobsTool tool = new JobsTool(getFrameworkInstance());
tool.internalResolver=new SingleProjectResolver() {
public boolean hasSingleProject() {
return true;
}
public String getSingleProjectName() {