From 0a1c4f49db2a6d64d9eb26943acd596d4e1b7be8 Mon Sep 17 00:00:00 2001 From: robokaso Date: Fri, 14 Mar 2008 15:22:26 +0000 Subject: [PATCH] RESOLVED - issue BATCH-459: unused StepExecution methods http://jira.springframework.org/browse/BATCH-459 removed unused methods --- .../batch/core/StepExecution.java | 41 ------------------ .../batch/core/StepExecutionTests.java | 42 ------------------- 2 files changed, 83 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java index 586a5f431..bbba651b5 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java @@ -50,8 +50,6 @@ public class StepExecution extends Entity { private int skipCount = 0; - private int retryCount = 0; - private Date startTime = new Date(System.currentTimeMillis()); private Date endTime = null; @@ -93,20 +91,6 @@ public class StepExecution extends Entity { this(step, jobExecution, null); } - /** - * Increments the number of commits in this execution - */ - public void incrementCommitCount() { - commitCount++; - } - - /** - * Increments the number of items in this execution - */ - public void incrementItemCount() { - itemCount++; - } - /** * Returns the {@link ExecutionContext} for this execution * @@ -179,15 +163,6 @@ public class StepExecution extends Entity { this.itemCount = itemCount; } - /** - * Sets the current number of rollbacks for this execution - * - * @param rollbackCount the current number of rollbacks for this execution - */ - public void setRollbackCount(int rollbackCount) { - this.rollbackCount = rollbackCount; - } - /** * Returns the current number of rollbacks for this execution * @@ -358,26 +333,10 @@ public class StepExecution extends Entity { this.terminateOnly = true; } - public void setSkipCount(int skipCount) { - this.skipCount = skipCount; - } - public int getSkipCount() { return skipCount; } - public void incrementSkipCount() { - skipCount++; - } - - public void setRetryCount(int retryCount) { - this.retryCount = retryCount; - } - - public int getRetryCount() { - return retryCount; - } - /** * Convenience method to get the current job parameters. * diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/StepExecutionTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/StepExecutionTests.java index 006a6a965..45ce975c6 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/StepExecutionTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/StepExecutionTests.java @@ -101,39 +101,6 @@ public class StepExecutionTests extends TestCase { assertEquals(ExitStatus.FINISHED, execution.getExitStatus()); } - /** - * Test method for - * {@link org.springframework.batch.core.StepExecution#incrementCommitCount()}. - */ - public void testIncrementCommitCount() { - int before = execution.getCommitCount().intValue(); - execution.incrementCommitCount(); - int after = execution.getCommitCount().intValue(); - assertEquals(before + 1, after); - } - - /** - * Test method for - * {@link org.springframework.batch.core.StepExecution#incrementItemCount()}. - */ - public void testIncrementLuwCount() { - int before = execution.getItemCount().intValue(); - execution.incrementItemCount(); - int after = execution.getItemCount().intValue(); - assertEquals(before + 1, after); - } - - /** - * Test method for - * {@link org.springframework.batch.core.StepExecution#rollback()}. - */ - public void testIncrementRollbackCount() { - int before = execution.getRollbackCount().intValue(); - execution.rollback(); - int after = execution.getRollbackCount().intValue(); - assertEquals(before + 1, after); - } - /** * Test method for * {@link org.springframework.batch.core.StepExecution#getCommitCount()}. @@ -151,15 +118,6 @@ public class StepExecutionTests extends TestCase { execution.setItemCount(123); assertEquals(123, execution.getItemCount().intValue()); } - - /** - * Test method for - * {@link org.springframework.batch.core.StepExecution#getRollbackCount()}. - */ - public void testGetRollbackCount() { - execution.setRollbackCount(123); - assertEquals(123, execution.getRollbackCount().intValue()); - } public void testGetJobExecution() throws Exception { assertNotNull(execution.getJobExecution());