Re-organise parallel job to run quicker (not football job any more).
This commit is contained in:
@@ -2,7 +2,6 @@ package org.springframework.batch.sample;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.batch.sample.item.processor.StagingItemProcessor;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
@@ -16,21 +15,12 @@ public class FootballJobFunctionalTests extends
|
||||
}
|
||||
|
||||
protected String[] getConfigLocations() {
|
||||
return new String[] { "jobs/parallelJob.xml##" };
|
||||
return new String[] { "jobs/footballJob.xml##" };
|
||||
}
|
||||
|
||||
protected void validatePostConditions() throws Exception {
|
||||
int count;
|
||||
count = jdbcTemplate.queryForInt(
|
||||
"SELECT COUNT(*) from BATCH_STAGING where PROCESSED=?",
|
||||
new Object[] {StagingItemProcessor.NEW});
|
||||
assertEquals(0, count);
|
||||
int total = jdbcTemplate.queryForInt(
|
||||
"SELECT COUNT(*) from BATCH_STAGING");
|
||||
count = jdbcTemplate.queryForInt(
|
||||
"SELECT COUNT(*) from BATCH_STAGING where PROCESSED=?",
|
||||
new Object[] {StagingItemProcessor.DONE});
|
||||
assertEquals(total, count);
|
||||
int count = jdbcTemplate.queryForInt("SELECT COUNT(*) from PLAYER_SUMMARY");
|
||||
assertTrue(count>0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.springframework.batch.sample;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.batch.sample.item.processor.StagingItemProcessor;
|
||||
import org.springframework.jdbc.core.JdbcOperations;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
public class ParallelJobFunctionalTests extends
|
||||
AbstractValidatingBatchLauncherTests {
|
||||
|
||||
private JdbcOperations jdbcTemplate;
|
||||
|
||||
public void setDataSource(DataSource dataSource) {
|
||||
this.jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
protected String[] getConfigLocations() {
|
||||
return new String[] { "jobs/parallelJob.xml" };
|
||||
}
|
||||
|
||||
protected void validatePostConditions() throws Exception {
|
||||
int count;
|
||||
count = jdbcTemplate.queryForInt(
|
||||
"SELECT COUNT(*) from BATCH_STAGING where PROCESSED=?",
|
||||
new Object[] {StagingItemProcessor.NEW});
|
||||
assertEquals(0, count);
|
||||
int total = jdbcTemplate.queryForInt(
|
||||
"SELECT COUNT(*) from BATCH_STAGING");
|
||||
count = jdbcTemplate.queryForInt(
|
||||
"SELECT COUNT(*) from BATCH_STAGING where PROCESSED=?",
|
||||
new Object[] {StagingItemProcessor.DONE});
|
||||
assertEquals(total, count);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user