use of org.springframework.orm.hibernate5.HibernateJdbcException in project spring-batch by spring-projects.
the class HibernateFailureJobFunctionalTests method testLaunchJob.
@Test
public void testLaunchJob() throws Exception {
validatePreConditions();
JobParameters params = new JobParametersBuilder().addString("key", "failureJob").toJobParameters();
writer.setFailOnFlush(2);
try {
jobLauncherTestUtils.launchJob(params);
} catch (HibernateJdbcException e) {
// RepeatContext:
throw e;
} catch (UncategorizedSQLException e) {
// assertEquals(1, writer.getErrors().size());
throw e;
}
int after = JdbcTestUtils.countRowsInTable(jdbcTemplate, "CUSTOMER");
assertEquals(4, after);
validatePostConditions();
}
Aggregations