RESOLVED - issue BATCH-1342: Check for valid parameter arguments in CommandLineJobRunner

This commit is contained in:
dsyer
2009-08-10 11:57:08 +00:00
parent b90e320e31
commit 842b9dac7a
2 changed files with 16 additions and 2 deletions

View File

@@ -120,6 +120,16 @@ public class CommandLineJobRunnerTests {
assertEquals(new JobParameters(), StubJobLauncher.jobParameters);
}
@Test
public void testWithInvalidParameters() throws Throwable {
String[] args = new String[] { jobPath, jobName, "foo" };
CommandLineJobRunner.main(args);
assertEquals(1, StubSystemExiter.status);
String errorMessage = CommandLineJobRunner.getErrorMessage();
assertTrue("Wrong error message: " + errorMessage, errorMessage
.contains("in the form name=value"));
}
@Test
public void testRestart() throws Throwable {
String[] args = new String[] { jobPath, "-restart", jobName };