BATCH-1064: Switched the semantics of INCOMPLETE and FAILED. Combined INCOMPLETE with STOPPED. INCOMPLETE jobs and steps can be restarted while COMPLETED and FAILED jobs and steps cannot.
This commit is contained in:
@@ -69,7 +69,7 @@ public class DatabaseShutdownFunctionalTests extends AbstractBatchLauncherTests
|
||||
}
|
||||
|
||||
assertFalse("Timed out waiting for job to end.", jobExecution.isRunning());
|
||||
assertEquals(BatchStatus.STOPPED, jobExecution.getStatus());
|
||||
assertEquals(BatchStatus.INCOMPLETE, jobExecution.getStatus());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GracefulShutdownFunctionalTests extends AbstractBatchLauncherTests
|
||||
}
|
||||
|
||||
assertFalse("Timed out waiting for job to end.", jobExecution.isRunning());
|
||||
assertEquals(BatchStatus.STOPPED, jobExecution.getStatus());
|
||||
assertEquals(BatchStatus.INCOMPLETE, jobExecution.getStatus());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.batch.core.BatchStatus.STARTED;
|
||||
import static org.springframework.batch.core.BatchStatus.STOPPED;
|
||||
import static org.springframework.batch.core.BatchStatus.FAILED;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -91,12 +91,12 @@ public class JobOperatorFunctionalTests {
|
||||
}
|
||||
|
||||
assertFalse(tested.getRunningExecutions(job.getName()).contains(executionId));
|
||||
assertTrue(tested.getSummary(executionId).contains(STOPPED.toString()));
|
||||
assertTrue(tested.getSummary(executionId).contains(FAILED.toString()));
|
||||
|
||||
// there is just a single step in the test job
|
||||
Map<Long, String> summaries = tested.getStepExecutionSummaries(executionId);
|
||||
assertEquals(1, summaries.size());
|
||||
assertTrue(summaries.values().toString().contains(STOPPED.toString()));
|
||||
assertTrue(summaries.values().toString().contains(FAILED.toString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RestartFunctionalTests extends AbstractBatchLauncherTests {
|
||||
int before = simpleJdbcTemplate.queryForInt("SELECT COUNT(*) FROM TRADE");
|
||||
|
||||
JobExecution jobExecution = runJobForRestartTest();
|
||||
assertEquals(BatchStatus.FAILED, jobExecution.getStatus());
|
||||
assertEquals(BatchStatus.INCOMPLETE, jobExecution.getStatus());
|
||||
|
||||
Throwable expected = jobExecution.getAllFailureExceptions().get(0);
|
||||
assertTrue("Not planned exception: " + expected.getMessage(), expected.getMessage().toLowerCase().indexOf(
|
||||
|
||||
@@ -166,7 +166,7 @@ public class JdbcJobRepositoryTests {
|
||||
cacheJobIds(execution);
|
||||
execution.setEndTime(new Timestamp(System.currentTimeMillis()));
|
||||
repository.update(execution);
|
||||
execution.setStatus(BatchStatus.FAILED);
|
||||
execution.setStatus(BatchStatus.INCOMPLETE);
|
||||
|
||||
int before = simpleJdbcTemplate.queryForInt("SELECT COUNT(*) FROM BATCH_JOB_INSTANCE");
|
||||
assertEquals(1, before);
|
||||
|
||||
Reference in New Issue
Block a user