BATCH-2002: Initial support for complex conditional replacements

This commit is contained in:
Chris Schaefer
2013-09-08 19:59:35 -04:00
committed by Michael Minella
parent 65d2df652a
commit e1f6de38e0
4 changed files with 123 additions and 8 deletions

View File

@@ -56,7 +56,10 @@ public class JobPropertySubstitutionTests {
@Test
public void testPropertySubstitutionSimple() throws Exception {
JobExecution jobExecution = jobLauncher.run(job,
new JobParametersBuilder().addString("testParam", "testParamValue").toJobParameters());
new JobParametersBuilder()
.addString("testParam", "testParamValue")
.addString("file.name.junit", "myfile2")
.toJobParameters());
assertEquals(ExitStatus.COMPLETED, jobExecution.getExitStatus());
}
@@ -122,9 +125,19 @@ public class JobPropertySubstitutionTests {
@BatchProperty
String processorProperty1;
@Inject
@BatchProperty
String processorProperty2;
@Inject
@BatchProperty
String processorProperty3;
@Override
public Object processItem(Object item) throws Exception {
assertEquals("testParamValue", processorProperty1);
assertEquals("myfile1.txt", processorProperty2);
assertEquals("/myfile2.txt", processorProperty3);
return item;
}