Tidy up base classes in batch-test

This commit is contained in:
dsyer
2008-11-08 16:10:14 +00:00
parent 5746df5b42
commit aaa7c03b2b
5 changed files with 42 additions and 113 deletions

View File

@@ -7,15 +7,16 @@ import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.test.AbstractFlowJobTests;
import org.springframework.batch.test.AbstractJobTests;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.jdbc.SimpleJdbcTestUtils;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/jobs/nonSequentialDecisionJob.xml" })
public class NonSequentialDecisionJobFunctionalTests extends AbstractFlowJobTests {
public class NonSequentialDecisionJobFunctionalTests extends AbstractJobTests {
private SimpleJdbcTemplate simpleJdbcTemplate;
@@ -23,11 +24,13 @@ public class NonSequentialDecisionJobFunctionalTests extends AbstractFlowJobTest
public void testWithSkips() throws Exception {
simpleJdbcTemplate.update("DELETE from ERROR_LOG");
simpleJdbcTemplate.update("DELETE from PLAYER_SUMMARY");
simpleJdbcTemplate.update("DELETE from PLAYERS");
simpleJdbcTemplate.update("DELETE from GAMES");
assertEquals(BatchStatus.COMPLETED, this.launchJob().getStatus());
assertEquals(1, simpleJdbcTemplate.queryForInt("SELECT COUNT(*) from ERROR_LOG"));
assertEquals(9, simpleJdbcTemplate.queryForInt("SELECT COUNT(*) from PLAYER_SUMMARY"));
assertEquals(1, SimpleJdbcTestUtils.countRowsInTable(simpleJdbcTemplate, "ERROR_LOG"));
assertEquals(9, SimpleJdbcTestUtils.countRowsInTable(simpleJdbcTemplate, "PLAYER_SUMMARY"));
}
@Autowired

View File

@@ -7,27 +7,31 @@ import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.test.AbstractFlowJobTests;
import org.springframework.batch.test.AbstractJobTests;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.jdbc.SimpleJdbcTestUtils;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/jobs/nonSequentialJob.xml" })
public class NonSequentialJobFunctionalTests extends AbstractFlowJobTests {
public class NonSequentialJobFunctionalTests extends AbstractJobTests {
private SimpleJdbcTemplate simpleJdbcTemplate;
@Test
public void testWithSkips() throws Exception {
simpleJdbcTemplate.update("DELETE from ERROR_LOG");
simpleJdbcTemplate.update("DELETE from PLAYER_SUMMARY");
simpleJdbcTemplate.update("DELETE from PLAYERS");
simpleJdbcTemplate.update("DELETE from GAMES");
assertEquals(BatchStatus.COMPLETED, this.launchJob().getStatus());
assertEquals(1, simpleJdbcTemplate.queryForInt("SELECT COUNT(*) from ERROR_LOG"));
assertEquals(9, simpleJdbcTemplate.queryForInt("SELECT COUNT(*) from PLAYER_SUMMARY"));
assertEquals(1, SimpleJdbcTestUtils.countRowsInTable(simpleJdbcTemplate, "ERROR_LOG"));
assertEquals(9, SimpleJdbcTestUtils.countRowsInTable(simpleJdbcTemplate, "PLAYER_SUMMARY"));
}
@Autowired