BATCH-1628: Extend to all params, and add javadocs

This commit is contained in:
dsyer
2010-11-08 12:42:51 +00:00
parent e37a402b2e
commit 362bd5648c
2 changed files with 37 additions and 14 deletions

View File

@@ -136,6 +136,22 @@ public class CommandLineJobRunnerTests {
assertEquals(new JobParameters(), StubJobLauncher.jobParameters);
}
@Test
public void testWithStdinCommandLine() throws Throwable {
System.setIn(new InputStream() {
char[] input = (jobPath+"\n"+jobName+"\nfoo=bar\nspam=bucket").toCharArray();
int index = 0;
public int read() {
return index<input.length-1 ? (int) input[index++] : -1;
}
});
CommandLineJobRunner.main(new String[0]);
assertEquals(0, StubSystemExiter.status);
assertEquals(2, StubJobLauncher.jobParameters.getParameters().size());
}
@Test
public void testWithStdinParameters() throws Throwable {
String[] args = new String[] { jobPath, jobName };