Upgrade to Spring Integration RC2
This commit is contained in:
@@ -13,6 +13,7 @@ import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.UnexpectedJobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -54,12 +55,11 @@ public class StagingItemReaderTests {
|
||||
new JobParameters(), "testJob")));
|
||||
writer.beforeStep(stepExecution);
|
||||
writer.write(Arrays.asList(new String[] { "FOO", "BAR", "SPAM", "BUCKET" }));
|
||||
reader.beforeStep(stepExecution);
|
||||
reader.setJobId(jobId);
|
||||
}
|
||||
|
||||
@AfterTransaction
|
||||
public void onTearDownAfterTransaction() throws Exception {
|
||||
reader.destroy();
|
||||
simpleJdbcTemplate.update("DELETE FROM BATCH_STAGING");
|
||||
}
|
||||
|
||||
@@ -118,7 +118,13 @@ public class StagingItemReaderTests {
|
||||
String.class, id);
|
||||
assertEquals(StagingItemWriter.NEW, before);
|
||||
|
||||
Object item = reader.read();
|
||||
Object item;
|
||||
try {
|
||||
item = reader.read();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new UnexpectedJobExecutionException("Reader error", e);
|
||||
}
|
||||
assertEquals("FOO", item);
|
||||
|
||||
transactionStatus.setRollbackOnly();
|
||||
|
||||
Reference in New Issue
Block a user