writeToFile(appXml, appPath);
conf.set(OozieClient.COORDINATOR_APP_PATH, appPath);
conf.set(OozieClient.USER_NAME, getTestUser());
conf.set(OozieClient.GROUP_NAME, "other");
injectKerberosInfo(conf);
CoordSubmitCommand sc = new CoordSubmitCommand(conf, "UNIT_TESTING");
if (withDefaults) {
String defaults = "<configuration><property><name>startTime</name>" +
"<value>2009-02-01T01:00Z</value></property></configuration>";
writeToFile(defaults, getTestCaseDir() + File.separator + CoordSubmitCommand.CONFIG_DEFAULT);
String jobId = sc.call();
assertEquals(jobId.substring(jobId.length() - 2), "-C");
}
else {
try {
sc.call();
fail();
}
catch (CommandException ex) {
assertEquals(ErrorCode.E1004, ex.getErrorCode());
}