Review process. Split step package into item and tasklet.

This commit is contained in:
dsyer
2008-03-14 10:50:53 +00:00
parent 39755ea3a6
commit de2715614b
51 changed files with 91 additions and 64 deletions

View File

@@ -42,7 +42,7 @@ import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.repository.support.dao.StepExecutionDao;
import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.core.step.NeverSkipItemSkipPolicy;
import org.springframework.batch.core.step.item.NeverSkipItemSkipPolicy;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;

View File

@@ -29,8 +29,8 @@ import org.springframework.batch.core.job.JobSupport;
import org.springframework.batch.core.repository.support.dao.JobExecutionDao;
import org.springframework.batch.core.repository.support.dao.JobInstanceDao;
import org.springframework.batch.core.repository.support.dao.StepExecutionDao;
import org.springframework.batch.core.step.ExitStatusExceptionClassifier;
import org.springframework.batch.core.step.StepSupport;
import org.springframework.batch.core.step.item.ExitStatusExceptionClassifier;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.dao.OptimisticLockingFailureException;

View File

@@ -16,7 +16,7 @@ import org.springframework.batch.core.StepListener;
import org.springframework.batch.core.job.JobSupport;
import org.springframework.batch.core.listener.StepListenerSupport;
import org.springframework.batch.core.step.TaskletStep;
import org.springframework.batch.core.tasklet.Tasklet;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.ExitStatus;
public class TaskletStepTests extends TestCase {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import java.util.ArrayList;
import java.util.Arrays;
@@ -38,7 +38,10 @@ import org.springframework.batch.core.repository.support.dao.MapJobExecutionDao;
import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.step.JobRepositorySupport;
import org.springframework.batch.core.step.item.ItemOrientedStep;
import org.springframework.batch.core.step.item.SimpleItemHandler;
import org.springframework.batch.core.step.item.StepInterruptionPolicy;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.item.ExecutionContext;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.MarkFailedException;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import java.util.ArrayList;
import java.util.List;
@@ -27,7 +27,8 @@ import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.JobSupport;
import org.springframework.batch.core.launch.EmptyItemWriter;
import org.springframework.batch.core.step.RepeatOperationsStepFactoryBean;
import org.springframework.batch.core.step.JobRepositorySupport;
import org.springframework.batch.core.step.item.RepeatOperationsStepFactoryBean;
import org.springframework.batch.item.support.ListItemReader;
import org.springframework.batch.repeat.ExitStatus;
import org.springframework.batch.repeat.RepeatCallback;

View File

@@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.launch.support.ExitCodeMapper;
import org.springframework.batch.core.repository.NoSuchJobException;
import org.springframework.batch.core.step.item.ExitStatusExceptionClassifier;
import org.springframework.batch.core.step.item.SimpleExitStatusExceptionClassifier;
import org.springframework.batch.repeat.ExitStatus;
import junit.framework.TestCase;

View File

@@ -13,10 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import junit.framework.TestCase;
import org.springframework.batch.core.step.item.SimpleRetryExceptionHandler;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.exception.SimpleLimitExceptionHandler;
@@ -51,7 +52,7 @@ public class SimpleRetryExceptionHandlerTests extends TestCase {
/**
* Test method for
* {@link org.springframework.batch.core.step.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
* {@link org.springframework.batch.core.step.item.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
*/
public void testRethrowWhenRetryExhausted() {
@@ -76,7 +77,7 @@ public class SimpleRetryExceptionHandlerTests extends TestCase {
/**
* Test method for
* {@link org.springframework.batch.core.step.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
* {@link org.springframework.batch.core.step.item.SimpleRetryExceptionHandler#handleException(org.springframework.batch.repeat.RepeatContext, java.lang.Throwable)}.
*/
public void testNoRethrowWhenRetryNotExhausted() {

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import java.util.ArrayList;
import java.util.Arrays;
@@ -34,6 +34,7 @@ import org.springframework.batch.core.repository.support.SimpleJobRepository;
import org.springframework.batch.core.repository.support.dao.MapJobExecutionDao;
import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.AbstractStep;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import java.io.FileNotFoundException;
import java.util.ArrayList;
@@ -21,6 +21,8 @@ import java.util.List;
import junit.framework.TestCase;
import org.springframework.batch.core.step.item.LimitCheckingItemSkipPolicy;
import org.springframework.batch.core.step.item.SkipLimitExceededException;
import org.springframework.batch.item.file.FlatFileParseException;
/**

View File

@@ -1,4 +1,4 @@
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import java.util.ArrayList;
import java.util.Collection;
@@ -11,6 +11,9 @@ import org.springframework.batch.core.JobInstance;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.job.JobSupport;
import org.springframework.batch.core.step.JobRepositorySupport;
import org.springframework.batch.core.step.item.ItemOrientedStep;
import org.springframework.batch.core.step.item.SkipLimitStepFactoryBean;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemReader;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import java.util.ArrayList;
import java.util.Arrays;
@@ -32,8 +32,8 @@ import org.springframework.batch.core.repository.support.SimpleJobRepository;
import org.springframework.batch.core.repository.support.dao.MapJobExecutionDao;
import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.step.StatefulRetryStepFactoryBean;
import org.springframework.batch.core.step.item.ItemOrientedStep;
import org.springframework.batch.core.step.item.StatefulRetryStepFactoryBean;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemRecoverer;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import junit.framework.TestCase;
@@ -29,8 +29,9 @@ import org.springframework.batch.core.repository.support.SimpleJobRepository;
import org.springframework.batch.core.repository.support.dao.MapJobExecutionDao;
import org.springframework.batch.core.repository.support.dao.MapJobInstanceDao;
import org.springframework.batch.core.repository.support.dao.MapStepExecutionDao;
import org.springframework.batch.core.step.ItemOrientedStep;
import org.springframework.batch.core.step.SimpleItemHandler;
import org.springframework.batch.core.step.item.ItemOrientedStep;
import org.springframework.batch.core.step.item.SimpleItemHandler;
import org.springframework.batch.core.step.item.StepExecutionSynchronizer;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.AbstractItemWriter;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;

View File

@@ -13,11 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.step;
package org.springframework.batch.core.step.item;
import junit.framework.TestCase;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.step.item.ThreadStepInterruptionPolicy;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.context.RepeatContextSupport;

View File

@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.batch.core.tasklet;
package org.springframework.batch.core.step.tasklet;
import org.springframework.batch.core.tasklet.TaskletAdapter;
import org.springframework.batch.core.step.tasklet.TaskletAdapter;
import org.springframework.batch.repeat.ExitStatus;
import junit.framework.TestCase;
@@ -46,7 +46,7 @@ public class TaskletAdapterTests extends TestCase {
}
/**
* Test method for {@link org.springframework.batch.core.tasklet.TaskletAdapter#execute()}.
* Test method for {@link org.springframework.batch.core.step.tasklet.TaskletAdapter#execute()}.
* @throws Exception
*/
public void testExecuteWithExitStatus() throws Exception {
@@ -54,7 +54,7 @@ public class TaskletAdapterTests extends TestCase {
}
/**
* Test method for {@link org.springframework.batch.core.tasklet.TaskletAdapter#mapResult(java.lang.Object)}.
* Test method for {@link org.springframework.batch.core.step.tasklet.TaskletAdapter#mapResult(java.lang.Object)}.
*/
public void testMapResultWithNull() throws Exception {
tasklet.setTargetMethod("process");
@@ -62,7 +62,7 @@ public class TaskletAdapterTests extends TestCase {
}
/**
* Test method for {@link org.springframework.batch.core.tasklet.TaskletAdapter#mapResult(java.lang.Object)}.
* Test method for {@link org.springframework.batch.core.step.tasklet.TaskletAdapter#mapResult(java.lang.Object)}.
*/
public void testMapResultWithNonNull() throws Exception {
tasklet.setTargetMethod("process");