BATCH-1213: Defaults in xsd override parent attributes

*Introduced CoreNamespacePostProcessor to handle injection of JobRepository and TransactionManager onto jobs and steps defined using the namespace.
 *Introduced JobParserJobFactoryBean used to instantiate a FlowJob via the namespace.
 *Modified defaulting behavior of jobRepository attribute.  Job's jobRepository now always overrides the Step's.
This commit is contained in:
dhgarrette
2009-05-18 23:54:18 +00:00
parent d7d3be4223
commit 9bdfdcbc43
19 changed files with 762 additions and 170 deletions

View File

@@ -61,20 +61,23 @@ public class RestartFunctionalTests extends AbstractBatchLauncherTests {
* finish successfully, because it continues execution where the previous
* run stopped (module throws exception after fixed number of processed
* records).
* @throws Throwable
*
* @throws Exception
*/
@Test
public void testRestart() throws Throwable {
public void testLaunchJob() throws Exception {
int before = simpleJdbcTemplate.queryForInt("SELECT COUNT(*) FROM TRADE");
JobExecution jobExecution = runJobForRestartTest();
assertEquals(BatchStatus.FAILED, jobExecution.getStatus());
Throwable expected = jobExecution.getAllFailureExceptions().get(0);
if(expected.getMessage().toLowerCase().indexOf(
"planned") < 0) {
throw expected;
Throwable ex = jobExecution.getAllFailureExceptions().get(0);
if (ex.getMessage().toLowerCase().indexOf("planned") < 0) {
if (ex instanceof Exception) {
throw (Exception) ex;
}
throw new RuntimeException(ex);
}
int medium = simpleJdbcTemplate.queryForInt("SELECT COUNT(*) FROM TRADE");
@@ -91,8 +94,12 @@ public class RestartFunctionalTests extends AbstractBatchLauncherTests {
// load the application context and launch the job
private JobExecution runJobForRestartTest() throws Exception {
return getLauncher().run(getJob(), new DefaultJobParametersConverter().getJobParameters(PropertiesConverter
.stringToProperties("run.id(long)=1,parameter=true,run.date=20070122,input.file=classpath:data/fixedLengthImportJob/input/20070122.teststream.ImportTradeDataStep.txt")));
return getLauncher()
.run(
getJob(),
new DefaultJobParametersConverter()
.getJobParameters(PropertiesConverter
.stringToProperties("run.id(long)=1,parameter=true,run.date=20070122,input.file=classpath:data/fixedLengthImportJob/input/20070122.teststream.ImportTradeDataStep.txt")));
}
}