IN PROGRESS - issue BATCH-340: Refactor JobRepository for greater clarity and consistency.

http://jira.springframework.org/browse/BATCH-340

improving test coverage
This commit is contained in:
robokaso
2008-02-19 17:14:47 +00:00
parent 4a38a4a218
commit ae45ec85c0
2 changed files with 3 additions and 12 deletions

View File

@@ -76,7 +76,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
+ "STATUS = ?, COMMIT_COUNT = ?, TASK_COUNT = ?, TASK_STATISTICS = ?, CONTINUABLE = ? , EXIT_CODE = ?, "
+ "EXIT_MESSAGE = ?, VERSION = ? where STEP_EXECUTION_ID = ? and VERSION = ?";
private static final String GET_STEP_EXECUTION = "SELECT STEP_EXECUTION_ID, JOB_EXECUTION_ID, START_TIME, END_TIME, STATUS, COMMIT_COUNT,"
private static final String GET_STEP_EXECUTION = "SELECT STEP_EXECUTION_ID, STEP_NAME, START_TIME, END_TIME, STATUS, COMMIT_COUNT,"
+ " TASK_COUNT, TASK_STATISTICS, CONTINUABLE, EXIT_CODE, EXIT_MESSAGE from %PREFIX%STEP_EXECUTION where STEP_NAME = ? and JOB_EXECUTION_ID = ?";
private static final int EXIT_MESSAGE_LENGTH = 250;

View File

@@ -96,8 +96,6 @@ public abstract class AbstractStepDaoTests extends AbstractTransactionalDataSour
stepExecution.setStatus(BatchStatus.STARTED);
stepExecution.setStartTime(new Date(System.currentTimeMillis()));
stepExecutionDao.saveStepExecution(stepExecution);
// step1.setLastExecution(stepExecution);
//stepInstanceDao.updateStepInstance(step1);
executionContext = new ExecutionContext();
executionContext.putString("1", "testString1");
@@ -217,15 +215,8 @@ public abstract class AbstractStepDaoTests extends AbstractTransactionalDataSour
assertEquals(executionContext, attributes);
}
public void testGetLastStepExecution() {
StepExecution lastExecution = new StepExecution(step1, jobExecution, null);
lastExecution.setStatus(BatchStatus.STARTED);
int JUMP_INTO_FUTURE = 1000; // makes sure start time is 'greatest'
lastExecution.setStartTime(new Date(System.currentTimeMillis() + JUMP_INTO_FUTURE));
stepExecutionDao.saveStepExecution(lastExecution);
// assertEquals(lastExecution, stepExecutionDao.getLastStepExecution(step1, jobExecution));
public void testGetStepExecution() {
assertEquals(stepExecution, stepExecutionDao.getStepExecution(jobExecution, step1));
}
}