diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/InfrastructureException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/InfrastructureException.java similarity index 97% rename from spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/InfrastructureException.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/InfrastructureException.java index 4241e6e09..1c363f44b 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/InfrastructureException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/InfrastructureException.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.batch.io.exception; +package org.springframework.batch.core; /** * Indicates to the framework that a critical error has occurred and processing diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java index 1a159e1cb..231a137d4 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java @@ -16,7 +16,6 @@ package org.springframework.batch.core; -import org.springframework.batch.io.exception.InfrastructureException; /** * Exception to indicate the the job has been interrupted. The exception state diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/JobSupport.java b/spring-batch-core/src/test/java/org/springframework/batch/core/JobSupport.java index 3db5a401b..f4e1baf2a 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/JobSupport.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/JobSupport.java @@ -22,7 +22,6 @@ import java.util.List; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.Step; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.beans.factory.BeanNameAware; import org.springframework.util.ClassUtils; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/StepSupport.java b/spring-batch-core/src/test/java/org/springframework/batch/core/StepSupport.java index 7ee5b418b..a4e329968 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/StepSupport.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/StepSupport.java @@ -18,7 +18,6 @@ package org.springframework.batch.core; import org.springframework.batch.core.JobInterruptedException; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.beans.factory.BeanNameAware; /** diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/job/SimpleJob.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/job/SimpleJob.java index e4a242ae8..912915900 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/job/SimpleJob.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/job/SimpleJob.java @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.List; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobExecutionException; import org.springframework.batch.core.JobInstance; @@ -30,7 +31,6 @@ import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.execution.listener.CompositeJobListener; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.batch.repeat.ExitStatus; /** diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepExecutionDao.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepExecutionDao.java index 325c6cefa..ce4bfb77a 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepExecutionDao.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/repository/dao/JdbcStepExecutionDao.java @@ -13,10 +13,10 @@ import org.apache.commons.lang.SerializationUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.repeat.ExitStatus; import org.springframework.beans.factory.InitializingBean; diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/AbstractStep.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/AbstractStep.java index 8a15a1c8e..bd9db3476 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/AbstractStep.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/AbstractStep.java @@ -15,10 +15,10 @@ */ package org.springframework.batch.execution.step; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobInterruptedException; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; -import org.springframework.batch.io.exception.InfrastructureException; /** * A {@link Step} implementation that provides common behaviour to subclasses. diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java index 3c6c4847c..9296368f4 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/ItemOrientedStep.java @@ -20,6 +20,7 @@ import java.util.Date; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobInterruptedException; import org.springframework.batch.core.StepContribution; @@ -34,7 +35,6 @@ import org.springframework.batch.execution.step.support.SimpleExitStatusExceptio import org.springframework.batch.execution.step.support.StepExecutionSynchronizer; import org.springframework.batch.execution.step.support.StepInterruptionPolicy; import org.springframework.batch.execution.step.support.ThreadStepInterruptionPolicy; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.batch.item.ExecutionContext; import org.springframework.batch.item.ItemReader; import org.springframework.batch.item.ItemStream; diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/TaskletStep.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/TaskletStep.java index 8899f711e..842e92b9f 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/TaskletStep.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/TaskletStep.java @@ -20,6 +20,7 @@ import java.util.Date; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobInterruptedException; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; @@ -27,7 +28,6 @@ import org.springframework.batch.core.StepListener; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.tasklet.Tasklet; import org.springframework.batch.execution.listener.CompositeStepListener; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.batch.repeat.ExitStatus; import org.springframework.beans.factory.BeanNameAware; import org.springframework.beans.factory.InitializingBean; diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/LimitCheckingItemSkipPolicy.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/LimitCheckingItemSkipPolicy.java index b0e9ab5c3..d72df01be 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/LimitCheckingItemSkipPolicy.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/LimitCheckingItemSkipPolicy.java @@ -27,7 +27,7 @@ import org.springframework.batch.common.SubclassExceptionClassifier; import org.springframework.batch.core.ItemSkipPolicy; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; -import org.springframework.batch.io.exception.FlatFileParsingException; +import org.springframework.batch.item.file.FlatFileParseException; /** *
@@ -35,14 +35,14 @@ import org.springframework.batch.io.exception.FlatFileParsingException; * based upon how many items have been skipped. This is extremely useful * behavior, as it allows you to skip records, but will throw a * {@link SkipLimitExceededException} if a set limit has been exceeded. For - * example, it is generally advisable to skip {@link FlatFileParsingException}s, + * example, it is generally advisable to skip {@link FlatFileParseException}s, * however, if the vast majority of records are causing exceptions, the file is * likely bad. *
* ** Furthermore, it is also likely that you only want to skip certain exceptions. - * {@link FlatFileParsingException} is a good example of an exception you will + * {@link FlatFileParseException} is a good example of an exception you will * likely want to skip, but a {@link FileNotFoundException} should cause * immediate termination of the {@link Step}. Because it would be impossible * for a general purpose policy to determine all the types of exceptions that diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/SkipLimitExceededException.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/SkipLimitExceededException.java index edf516d0c..b10b6609b 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/SkipLimitExceededException.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/step/support/SkipLimitExceededException.java @@ -15,7 +15,7 @@ */ package org.springframework.batch.execution.step.support; -import org.springframework.batch.io.exception.InfrastructureException; +import org.springframework.batch.core.InfrastructureException; /** * Exception indicating that the skip limit for a particular {@Step} has diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/JobSupport.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/JobSupport.java index d848de0e7..f48b890dc 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/JobSupport.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/JobSupport.java @@ -19,10 +19,10 @@ package org.springframework.batch.execution.job; import java.util.ArrayList; import java.util.List; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.Step; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.beans.factory.BeanNameAware; import org.springframework.util.ClassUtils; diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/SimpleJobTests.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/SimpleJobTests.java index cd5532db9..3754f47ae 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/SimpleJobTests.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/job/SimpleJobTests.java @@ -22,6 +22,7 @@ import java.util.List; import junit.framework.TestCase; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.ItemSkipPolicy; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobExecutionException; @@ -41,7 +42,6 @@ import org.springframework.batch.execution.repository.dao.MapStepExecutionDao; import org.springframework.batch.execution.repository.dao.StepExecutionDao; import org.springframework.batch.execution.step.AbstractStep; import org.springframework.batch.execution.step.support.NeverSkipItemSkipPolicy; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.batch.item.AbstractItemReader; import org.springframework.batch.item.ItemReader; import org.springframework.batch.item.ItemWriter; diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/ItemOrientedStepTests.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/ItemOrientedStepTests.java index f1602fe3e..be45f14c7 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/ItemOrientedStepTests.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/ItemOrientedStepTests.java @@ -23,6 +23,7 @@ import java.util.List; import junit.framework.TestCase; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobInterruptedException; @@ -39,7 +40,6 @@ import org.springframework.batch.execution.repository.dao.MapStepExecutionDao; import org.springframework.batch.execution.step.support.JobRepositorySupport; import org.springframework.batch.execution.step.support.SimpleItemHandler; import org.springframework.batch.execution.step.support.StepInterruptionPolicy; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.batch.item.AbstractItemReader; import org.springframework.batch.item.AbstractItemWriter; import org.springframework.batch.item.ExecutionContext; diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/StepSupport.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/StepSupport.java index a4d792eea..c6046dd69 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/StepSupport.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/StepSupport.java @@ -15,10 +15,10 @@ */ package org.springframework.batch.execution.step; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobInterruptedException; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.beans.factory.BeanNameAware; /** diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/TaskletStepTests.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/TaskletStepTests.java index ad8eb520a..8bbc18bd6 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/TaskletStepTests.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/TaskletStepTests.java @@ -6,6 +6,7 @@ import java.util.List; import junit.framework.TestCase; import org.springframework.batch.core.BatchStatus; +import org.springframework.batch.core.InfrastructureException; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobInstance; import org.springframework.batch.core.JobInterruptedException; @@ -16,7 +17,6 @@ import org.springframework.batch.core.listener.StepListenerSupport; import org.springframework.batch.core.tasklet.Tasklet; import org.springframework.batch.execution.job.JobSupport; import org.springframework.batch.execution.step.support.JobRepositorySupport; -import org.springframework.batch.io.exception.InfrastructureException; import org.springframework.batch.repeat.ExitStatus; public class TaskletStepTests extends TestCase { diff --git a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/SkipLimitReadFailurePolicyTests.java b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/SkipLimitReadFailurePolicyTests.java index 574876575..fedd01466 100644 --- a/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/SkipLimitReadFailurePolicyTests.java +++ b/spring-batch-execution/src/test/java/org/springframework/batch/execution/step/support/SkipLimitReadFailurePolicyTests.java @@ -21,7 +21,7 @@ import java.util.List; import junit.framework.TestCase; -import org.springframework.batch.io.exception.FlatFileParsingException; +import org.springframework.batch.item.file.FlatFileParseException; /** * @author Lucas Ward @@ -35,14 +35,14 @@ public class SkipLimitReadFailurePolicyTests extends TestCase { super.setUp(); List skippableExceptions = new ArrayList(); - skippableExceptions.add(FlatFileParsingException.class); + skippableExceptions.add(FlatFileParseException.class); failurePolicy = new LimitCheckingItemSkipPolicy(1, skippableExceptions); } public void testLimitExceed(){ try{ - failurePolicy.shouldSkip(new FlatFileParsingException("", ""), 2); + failurePolicy.shouldSkip(new FlatFileParseException("", ""), 2); fail(); } catch(SkipLimitExceededException ex){ @@ -55,7 +55,7 @@ public class SkipLimitReadFailurePolicyTests extends TestCase { } public void testSkip(){ - assertTrue(failurePolicy.shouldSkip(new FlatFileParsingException("",""), 0)); + assertTrue(failurePolicy.shouldSkip(new FlatFileParseException("",""), 0)); } } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ConfigurationException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ConfigurationException.java deleted file mode 100644 index d68344f41..000000000 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ConfigurationException.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2006-2007 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.batch.io.exception; - -/** - * This exception is thrown when there is a critical configuration error and the - * current job or module execution cannot continue. - * - * @author Kerry O'Brien - */ -public class ConfigurationException extends InfrastructureException { - private static final long serialVersionUID = 759498454063502984L; - - /** - * @param msg - * @param ex - */ - public ConfigurationException(String msg, Throwable ex) { - super(msg, ex); - } - - /** - * @param msg - */ - public ConfigurationException(String msg) { - super(msg); - } - - /** - * @param nested - */ - public ConfigurationException(Throwable nested) { - super(nested); - } -} diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ReadFailureException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ReadFailureException.java deleted file mode 100644 index bce06b5d8..000000000 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ReadFailureException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2006-2007 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.batch.io.exception; - -import org.springframework.batch.item.ItemReader; - -/** - * This exception indicates an error encountered while reading. It should generally - * be thrown by classes that implement the {@link ItemReader} interface. - * - * @author Lucas Ward - */ -public class ReadFailureException extends InfrastructureException { - - private static final long serialVersionUID = 4113323182216735223L; - - public ReadFailureException(String msg, Throwable ex) { - super(msg, ex); - } - - public ReadFailureException(String msg) { - super(msg); - } - - public ReadFailureException(Throwable nested) { - super(nested); - } -} diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/WriteFailureException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/WriteFailureException.java deleted file mode 100644 index ed462aa46..000000000 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/WriteFailureException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2006-2007 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.batch.io.exception; - -import org.springframework.batch.item.ItemWriter; - -/** - * Exception thrown after encountering an error during a write. It should - * generally be thrown by classes that implement the {@link ItemWriter} - * interface. - * - * @author Lucas Ward - */ -public class WriteFailureException extends InfrastructureException { - private static final long serialVersionUID = -1933213086873834098L; - - private final Object item; - - public WriteFailureException(String msg, Throwable ex, Object item) { - super(msg, ex); - this.item = item; - } - - public WriteFailureException(String msg) { - this(msg, null, null); - } - - public WriteFailureException(Throwable nested) { - this("", nested, null); - } - - public WriteFailureException(String msg, Object item){ - this(msg, null, item); - } - - public WriteFailureException(Throwable nested, Object item){ - this("", nested, item); - } - - public Object getItem() { - return item; - } -} diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/package.html b/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/package.html deleted file mode 100644 index d4fdd596b..000000000 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/package.html +++ /dev/null @@ -1,7 +0,0 @@ - -
--Infrastructure implementations of io exception concerns. -
- - diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/package.html b/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/package.html deleted file mode 100644 index 83e05d744..000000000 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - --Infrastructure implementations of io concerns. -
- - diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemReader.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemReader.java index fe36b123b..ba0c81bcc 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemReader.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/ItemReader.java @@ -41,7 +41,7 @@ public interface ItemReader { * * @throws Exception if an underlying resource is unavailable. */ - Object read() throws Exception, UnexpectedInputException, NoWorkFoundException; + Object read() throws Exception, UnexpectedInputException, NoWorkFoundException, ParseException; /** * Mark the stream so that it can be reset later and the items backed out.line.
+ * Yields the tokens resulting from the splitting of the supplied line.
*
* @param line the line to be tokenized
*
@@ -143,8 +139,7 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer {
}
lastCut = i + 1;
- }
- else if (isQuoteCharacter(currentChar)) {
+ } else if (isQuoteCharacter(currentChar)) {
inQuoted = !inQuoted;
}
@@ -154,9 +149,9 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer {
}
/**
- * If the string is quoted strip (possibly with whitespace outside the
- * quotes (which will be stripped), replace escaped quotes inside the
- * string. Quotes are escaped with double instances of the quote character.
+ * If the string is quoted strip (possibly with whitespace outside the quotes (which will be stripped), replace
+ * escaped quotes inside the string. Quotes are escaped with double instances of the quote character.
+ *
* @param string
* @return the same string but stripped and unescaped if necessary
*/
@@ -166,7 +161,7 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer {
value = StringUtils.replace(value, "" + quoteCharacter + quoteCharacter, "" + quoteCharacter);
int endLength = value.length() - 1;
// used to deal with empty quoted values
- if(endLength == 0) {
+ if (endLength == 0) {
endLength = 1;
}
string = value.substring(1, endLength);
@@ -176,9 +171,9 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer {
/**
* Is this string surrounded by quite characters?
+ *
* @param value
- * @return true if the value starts and ends with the
- * {@link #quoteCharacter}
+ * @return true if the value starts and ends with the {@link #quoteCharacter}
*/
private boolean isQuoted(String value) {
if (value.startsWith(quoteString) && value.endsWith(quoteString)) {
@@ -191,8 +186,7 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer {
* Is the supplied character the delimiter character?
*
* @param c the character to be checked
- * @return true if the supplied character is the delimiter
- * character
+ * @return true if the supplied character is the delimiter character
* @see DelimitedLineTokenizer#DelimitedLineTokenizer(char)
*/
private boolean isDelimiterCharacter(char c) {
@@ -203,8 +197,7 @@ public class DelimitedLineTokenizer extends AbstractLineTokenizer {
* Is the supplied character a quote character?
*
* @param c the character to be checked
- * @return true if the supplied character is an quote
- * character
+ * @return true if the supplied character is an quote character
* @see #setQuoteCharacter(char)
*/
protected boolean isQuoteCharacter(char c) {
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/SpringValidator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/SpringValidator.java
index e6e4a1100..9a65f2887 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/SpringValidator.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/SpringValidator.java
@@ -20,7 +20,6 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.batch.io.exception.ValidationException;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.FieldError;
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ValidationException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/ValidationException.java
similarity index 62%
rename from spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ValidationException.java
rename to spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/ValidationException.java
index dc8b2fd77..d58fe913b 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/ValidationException.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/ValidationException.java
@@ -14,21 +14,34 @@
* limitations under the License.
*/
-package org.springframework.batch.io.exception;
+package org.springframework.batch.item.validator;
+import org.springframework.batch.item.ItemReaderException;
/**
* This exception should be thrown when there are validation errors.
+ *
+ * @author Ben Hale
*/
-public class ValidationException extends ReadFailureException {
- private static final long serialVersionUID = 7926495144451758088L;
-
- public ValidationException(String message) {
- super(message);
- }
+public class ValidationException extends ItemReaderException {
+ /**
+ * Create a new {@link ValidationException} based on a message and another exception.
+ *
+ * @param message the message for this exception
+ * @param cause the other exception
+ */
public ValidationException(String message, Throwable cause) {
super(message, cause);
}
+ /**
+ * Create a new {@link ValidationException} based on a message.
+ *
+ * @param message the message for this exception
+ */
+ public ValidationException(String message) {
+ super(message);
+ }
+
}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/Validator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/Validator.java
index 0d1830e3b..bc4b97b97 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/Validator.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/validator/Validator.java
@@ -16,7 +16,6 @@
package org.springframework.batch.item.validator;
-import org.springframework.batch.io.exception.ValidationException;
/**
* Interface used to validate objects.
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AbstractMethodInvokingDelegator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AbstractMethodInvokingDelegator.java
index 7864f2828..0058469f9 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AbstractMethodInvokingDelegator.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/AbstractMethodInvokingDelegator.java
@@ -19,7 +19,6 @@ package org.springframework.batch.support;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.springframework.batch.io.exception.DynamicMethodInvocationException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
import org.springframework.util.MethodInvoker;
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/DynamicMethodInvocationException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DynamicMethodInvocationException.java
similarity index 92%
rename from spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/DynamicMethodInvocationException.java
rename to spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DynamicMethodInvocationException.java
index f47b9a7e6..a8f5ad838 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/io/exception/DynamicMethodInvocationException.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/DynamicMethodInvocationException.java
@@ -1,4 +1,4 @@
-package org.springframework.batch.io.exception;
+package org.springframework.batch.support;
import org.springframework.util.MethodInvoker;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/AbstractExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/common/AbstractExceptionTests.java
similarity index 96%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/AbstractExceptionTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/common/AbstractExceptionTests.java
index 620655a4e..e6828d386 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/AbstractExceptionTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/common/AbstractExceptionTests.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.batch.io.exception;
+package org.springframework.batch.common;
import junit.framework.TestCase;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/ConfigurationExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/ConfigurationExceptionTests.java
deleted file mode 100644
index 038537143..000000000
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/ConfigurationExceptionTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.io.exception;
-
-
-public class ConfigurationExceptionTests extends AbstractExceptionTests {
-
- public Exception getException(String msg) throws Exception {
- return new ConfigurationException(msg);
- }
-
- public Exception getException(Throwable t) throws Exception {
- return new ConfigurationException(t);
- }
-
- public Exception getException(String msg, Throwable t) throws Exception {
- return new ConfigurationException(msg, t);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/InfrastructureExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/InfrastructureExceptionTests.java
deleted file mode 100644
index 3c483a5ee..000000000
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/InfrastructureExceptionTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.io.exception;
-
-
-public class InfrastructureExceptionTests extends AbstractExceptionTests {
-
- public Exception getException(String msg) throws Exception {
- return new InfrastructureException(msg);
- }
-
- public Exception getException(Throwable t) throws Exception {
- return new InfrastructureException(t);
- }
-
- public Exception getException(String msg, Throwable t) throws Exception {
- return new InfrastructureException(msg, t);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/TransactionInvalidExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/TransactionInvalidExceptionTests.java
deleted file mode 100644
index 116b82347..000000000
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/TransactionInvalidExceptionTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.io.exception;
-
-
-public class TransactionInvalidExceptionTests extends AbstractExceptionTests {
-
- public Exception getException(String msg) throws Exception {
- return new WriteFailureException(msg);
- }
-
- public Exception getException(Throwable t) throws Exception {
- return new WriteFailureException(t);
- }
-
- public Exception getException(String msg, Throwable t) throws Exception {
- return new WriteFailureException(msg, t);
- }
-
- public void testNothing() throws Exception {
- // fool coverage tools...
- }
-}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/TransactionValidExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/TransactionValidExceptionTests.java
deleted file mode 100644
index 6e855a36e..000000000
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/TransactionValidExceptionTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.io.exception;
-
-
-public class TransactionValidExceptionTests extends AbstractExceptionTests {
-
- public Exception getException(String msg) throws Exception {
- return new ReadFailureException(msg);
- }
-
- public Exception getException(Throwable t) throws Exception {
- return new ReadFailureException(t);
- }
-
- public Exception getException(String msg, Throwable t) throws Exception {
- return new ReadFailureException(msg, t);
- }
-
- public void testNothing() throws Exception {
- // fool coverage tools...
- }
-}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ItemStreamExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ItemStreamExceptionTests.java
index 44ee20a32..4b86ee4c9 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ItemStreamExceptionTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ItemStreamExceptionTests.java
@@ -16,7 +16,7 @@
package org.springframework.batch.item;
-import org.springframework.batch.io.exception.AbstractExceptionTests;
+import org.springframework.batch.common.AbstractExceptionTests;
public class ItemStreamExceptionTests extends AbstractExceptionTests {
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/MarkFailedExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/MarkFailedExceptionTests.java
index 32a73a2c1..456ad386c 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/MarkFailedExceptionTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/MarkFailedExceptionTests.java
@@ -16,7 +16,7 @@
package org.springframework.batch.item;
-import org.springframework.batch.io.exception.AbstractExceptionTests;
+import org.springframework.batch.common.AbstractExceptionTests;
public class MarkFailedExceptionTests extends AbstractExceptionTests {
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ResetFailedExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ResetFailedExceptionTests.java
index b85d0ea6c..6fab892fb 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ResetFailedExceptionTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/ResetFailedExceptionTests.java
@@ -16,7 +16,7 @@
package org.springframework.batch.item;
-import org.springframework.batch.io.exception.AbstractExceptionTests;
+import org.springframework.batch.common.AbstractExceptionTests;
public class ResetFailedExceptionTests extends AbstractExceptionTests {
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemReaderAdapterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemReaderAdapterTests.java
index 55303441e..aaeab5328 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemReaderAdapterTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemReaderAdapterTests.java
@@ -3,8 +3,7 @@ package org.springframework.batch.item.adapter;
import java.util.ArrayList;
import java.util.List;
-import org.springframework.batch.io.sample.domain.FooService;
-import org.springframework.batch.item.adapter.ItemReaderAdapter;
+import org.springframework.batch.item.sample.FooService;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
/**
@@ -23,8 +22,7 @@ public class ItemReaderAdapterTests extends AbstractDependencyInjectionSpringCon
}
/**
- * Regular usage scenario - items are retrieved from the service injected
- * invoker points to.
+ * Regular usage scenario - items are retrieved from the service injected invoker points to.
*/
public void testNext() throws Exception {
List returnedItems = new ArrayList();
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemWriterAdapterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemWriterAdapterTests.java
index 2887edb70..b4649506e 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemWriterAdapterTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/ItemWriterAdapterTests.java
@@ -2,10 +2,9 @@ package org.springframework.batch.item.adapter;
import java.util.List;
-import org.springframework.batch.io.sample.domain.Foo;
-import org.springframework.batch.io.sample.domain.FooService;
import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.item.adapter.ItemWriterAdapter;
+import org.springframework.batch.item.sample.Foo;
+import org.springframework.batch.item.sample.FooService;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
/**
@@ -16,41 +15,39 @@ import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
public class ItemWriterAdapterTests extends AbstractDependencyInjectionSpringContextTests {
private ItemWriter processor;
-
+
private FooService fooService;
-
protected String getConfigPath() {
return "delegating-item-writer.xml";
}
/**
- * Regular usage scenario - input object should be passed to
- * the service the injected invoker points to.
+ * Regular usage scenario - input object should be passed to the service the injected invoker points to.
*/
public void testProcess() throws Exception {
Foo foo;
while ((foo = fooService.generateFoo()) != null) {
processor.write(foo);
}
-
+
List input = fooService.getGeneratedFoos();
List processed = fooService.getProcessedFoos();
assertEquals(input.size(), processed.size());
assertFalse(fooService.getProcessedFoos().isEmpty());
-
+
for (int i = 0; i < input.size(); i++) {
assertSame(input.get(i), processed.get(i));
}
-
+
}
-
- //setter for auto-injection
+
+ // setter for auto-injection
public void setProcessor(ItemWriter processor) {
this.processor = processor;
}
- //setter for auto-injection
+ // setter for auto-injection
public void setFooService(FooService fooService) {
this.fooService = fooService;
}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/PropertyExtractingDelegatingItemProccessorIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/PropertyExtractingDelegatingItemProccessorIntegrationTests.java
index 2d0ff581a..f3508a2b8 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/PropertyExtractingDelegatingItemProccessorIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/adapter/PropertyExtractingDelegatingItemProccessorIntegrationTests.java
@@ -2,9 +2,8 @@ package org.springframework.batch.item.adapter;
import java.util.List;
-import org.springframework.batch.io.sample.domain.Foo;
-import org.springframework.batch.io.sample.domain.FooService;
-import org.springframework.batch.item.adapter.PropertyExtractingDelegatingItemWriter;
+import org.springframework.batch.item.sample.Foo;
+import org.springframework.batch.item.sample.FooService;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
/**
@@ -12,32 +11,31 @@ import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
*
* @author Robert Kasanicky
*/
-public class PropertyExtractingDelegatingItemProccessorIntegrationTests
- extends AbstractDependencyInjectionSpringContextTests {
-
+public class PropertyExtractingDelegatingItemProccessorIntegrationTests extends
+ AbstractDependencyInjectionSpringContextTests {
+
private PropertyExtractingDelegatingItemWriter processor;
-
+
private FooService fooService;
-
+
protected String getConfigPath() {
return "pe-delegating-item-writer.xml";
}
-
+
/**
- * Regular usage scenario - input object should be passed to
- * the service the injected invoker points to.
+ * Regular usage scenario - input object should be passed to the service the injected invoker points to.
*/
public void testProcess() throws Exception {
Foo foo;
while ((foo = fooService.generateFoo()) != null) {
processor.write(foo);
}
-
+
List input = fooService.getGeneratedFoos();
List processed = fooService.getProcessedFooNameValuePairs();
assertEquals(input.size(), processed.size());
assertFalse(fooService.getProcessedFooNameValuePairs().isEmpty());
-
+
for (int i = 0; i < input.size(); i++) {
Foo inputFoo = (Foo) input.get(i);
Foo outputFoo = (Foo) processed.get(i);
@@ -45,7 +43,7 @@ public class PropertyExtractingDelegatingItemProccessorIntegrationTests
assertEquals(inputFoo.getValue(), outputFoo.getValue());
assertEquals(0, outputFoo.getId());
}
-
+
}
public void setProcessor(PropertyExtractingDelegatingItemWriter processor) {
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractDataSourceItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractDataSourceItemReaderIntegrationTests.java
index 8a3fa4c48..7f9d47d93 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractDataSourceItemReaderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractDataSourceItemReaderIntegrationTests.java
@@ -1,10 +1,10 @@
package org.springframework.batch.item.database;
-import org.springframework.batch.io.sample.domain.Foo;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.Skippable;
+import org.springframework.batch.item.sample.Foo;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
import org.springframework.util.Assert;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractJdbcItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractJdbcItemReaderIntegrationTests.java
index 378ec1539..e9b8e50ec 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractJdbcItemReaderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/AbstractJdbcItemReaderIntegrationTests.java
@@ -1,9 +1,9 @@
package org.springframework.batch.item.database;
-import org.springframework.batch.io.sample.domain.Foo;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
+import org.springframework.batch.item.sample.Foo;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/BatchSqlUpdateItemWriterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/BatchSqlUpdateItemWriterTests.java
index 0db3c6740..5e0cddc4a 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/BatchSqlUpdateItemWriterTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/BatchSqlUpdateItemWriterTests.java
@@ -27,8 +27,6 @@ import java.util.Map;
import junit.framework.TestCase;
import org.easymock.MockControl;
-import org.springframework.batch.item.database.BatchSqlUpdateItemWriter;
-import org.springframework.batch.item.database.ItemPreparedStatementSetter;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.synch.RepeatSynchronizationManager;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/CompositeKeyFooDao.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/CompositeKeyFooDao.java
index 429aa4df5..ec136e734 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/CompositeKeyFooDao.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/CompositeKeyFooDao.java
@@ -19,7 +19,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
-import org.springframework.batch.io.sample.domain.Foo;
+import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/DrivingQueryItemReaderTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/DrivingQueryItemReaderTests.java
index 9fd37f1d7..6daa708da 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/DrivingQueryItemReaderTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/DrivingQueryItemReaderTests.java
@@ -6,13 +6,11 @@ import java.util.Properties;
import junit.framework.TestCase;
-import org.springframework.batch.io.sample.domain.Foo;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.NoWorkFoundException;
-import org.springframework.batch.item.database.DrivingQueryItemReader;
-import org.springframework.batch.item.database.KeyGenerator;
+import org.springframework.batch.item.sample.Foo;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.Assert;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooDao.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooDao.java
index e90770d85..30781fc23 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooDao.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooDao.java
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.item.database;
-import org.springframework.batch.io.sample.domain.Foo;
+import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.JdbcTemplate;
/**
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooInputSource.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooInputSource.java
index 04da4cd70..a73badfb5 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooInputSource.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooInputSource.java
@@ -3,7 +3,6 @@ package org.springframework.batch.item.database;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
-import org.springframework.batch.item.database.DrivingQueryItemReader;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.jdbc.core.JdbcTemplate;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooRowMapper.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooRowMapper.java
index 95d3db0ac..f985ce468 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooRowMapper.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/FooRowMapper.java
@@ -3,7 +3,7 @@ package org.springframework.batch.item.database;
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.springframework.batch.io.sample.domain.Foo;
+import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.RowMapper;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateAwareItemWriterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateAwareItemWriterTests.java
index b3588fa6e..18ba1922c 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateAwareItemWriterTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateAwareItemWriterTests.java
@@ -25,7 +25,6 @@ import junit.framework.TestCase;
import org.springframework.batch.item.ClearFailedException;
import org.springframework.batch.item.FlushFailedException;
import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.item.database.HibernateAwareItemWriter;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.synch.RepeatSynchronizationManager;
import org.springframework.dao.DataAccessException;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java
index d652bb842..a9d5a5bcd 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderIntegrationTests.java
@@ -4,7 +4,6 @@ import org.hibernate.SessionFactory;
import org.hibernate.StatelessSession;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.database.HibernateCursorItemReader;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.orm.hibernate3.LocalSessionFactoryBean;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderStatefulIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderStatefulIntegrationTests.java
index aadef26ad..305a3b386 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderStatefulIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/HibernateCursorItemReaderStatefulIntegrationTests.java
@@ -1,7 +1,6 @@
package org.springframework.batch.item.database;
import org.hibernate.Session;
-import org.springframework.batch.item.database.HibernateCursorItemReader;
/**
* Tests for {@link HibernateCursorItemReader} using standard hibernate {@link Session}.
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/IbatisItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/IbatisItemReaderIntegrationTests.java
index 08136dd85..d23cf5c59 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/IbatisItemReaderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/IbatisItemReaderIntegrationTests.java
@@ -1,7 +1,6 @@
package org.springframework.batch.item.database;
import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.database.IbatisDrivingQueryItemReader;
import org.springframework.batch.item.database.support.IbatisKeyGenerator;
import org.springframework.core.io.ClassPathResource;
import org.springframework.orm.ibatis.SqlMapClientFactoryBean;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderIntegrationTests.java
index 68e6bcc47..005a6152a 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/JdbcCursorItemReaderIntegrationTests.java
@@ -1,7 +1,6 @@
package org.springframework.batch.item.database;
import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.database.JdbcCursorItemReader;
/**
* Tests for {@link JdbcCursorItemReader}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/MultipleColumnJdbcDrivingQueryItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/MultipleColumnJdbcDrivingQueryItemReaderIntegrationTests.java
index d31d73b0e..aa6a8a567 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/MultipleColumnJdbcDrivingQueryItemReaderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/MultipleColumnJdbcDrivingQueryItemReaderIntegrationTests.java
@@ -16,7 +16,6 @@
package org.springframework.batch.item.database;
import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.database.DrivingQueryItemReader;
import org.springframework.batch.item.database.support.MultipleColumnJdbcKeyGenerator;
/**
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleColumnJdbcDrivingQueryItemReaderIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleColumnJdbcDrivingQueryItemReaderIntegrationTests.java
index 480a6a26f..3052e6846 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleColumnJdbcDrivingQueryItemReaderIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleColumnJdbcDrivingQueryItemReaderIntegrationTests.java
@@ -1,7 +1,6 @@
package org.springframework.batch.item.database;
import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.database.DrivingQueryItemReader;
import org.springframework.batch.item.database.support.SingleColumnJdbcKeyGenerator;
public class SingleColumnJdbcDrivingQueryItemReaderIntegrationTests extends AbstractJdbcItemReaderIntegrationTests {
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleKeyFooDao.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleKeyFooDao.java
index f3d2bcba3..2cc2f2ec9 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleKeyFooDao.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/SingleKeyFooDao.java
@@ -3,7 +3,7 @@ package org.springframework.batch.item.database;
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.springframework.batch.io.sample.domain.Foo;
+import org.springframework.batch.item.sample.Foo;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/ColumnMapExecutionContextRowMapperTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/ColumnMapExecutionContextRowMapperTests.java
index 6e3c94f87..391fcaf8b 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/ColumnMapExecutionContextRowMapperTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/ColumnMapExecutionContextRowMapperTests.java
@@ -12,7 +12,6 @@ import junit.framework.TestCase;
import org.easymock.MockControl;
import org.springframework.batch.item.ExecutionContext;
-import org.springframework.batch.item.database.support.ColumnMapExecutionContextRowMapper;
import org.springframework.core.CollectionFactory;
import org.springframework.jdbc.core.PreparedStatementSetter;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/MultipleColumnJdbcKeyGeneratorIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/MultipleColumnJdbcKeyGeneratorIntegrationTests.java
index 7a3101d1d..2431082db 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/MultipleColumnJdbcKeyGeneratorIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/MultipleColumnJdbcKeyGeneratorIntegrationTests.java
@@ -12,9 +12,6 @@ import java.util.Properties;
import java.util.Map.Entry;
import org.springframework.batch.item.ExecutionContext;
-import org.springframework.batch.item.database.support.ColumnMapExecutionContextRowMapper;
-import org.springframework.batch.item.database.support.ExecutionContextRowMapper;
-import org.springframework.batch.item.database.support.MultipleColumnJdbcKeyGenerator;
import org.springframework.core.CollectionFactory;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/SingleColumnJdbcKeyGeneratorIntegrationTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/SingleColumnJdbcKeyGeneratorIntegrationTests.java
index cabfad7a8..34939aa61 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/SingleColumnJdbcKeyGeneratorIntegrationTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/database/support/SingleColumnJdbcKeyGeneratorIntegrationTests.java
@@ -3,7 +3,6 @@ package org.springframework.batch.item.database.support;
import java.util.List;
import org.springframework.batch.item.ExecutionContext;
-import org.springframework.batch.item.database.support.SingleColumnJdbcKeyGenerator;
import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;
/**
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemReaderBasicTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemReaderBasicTests.java
index 6b8208230..2a9c1ab69 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemReaderBasicTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileItemReaderBasicTests.java
@@ -21,7 +21,6 @@ import java.io.InputStream;
import junit.framework.TestCase;
-import org.springframework.batch.io.exception.FlatFileParsingException;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStreamException;
import org.springframework.batch.item.ReaderNotOpenException;
@@ -120,7 +119,7 @@ public class FlatFileItemReaderBasicTests extends TestCase {
itemReader.open(executionContext);
itemReader.read();
fail("Expected ParsingException");
- } catch (FlatFileParsingException e) {
+ } catch (FlatFileParseException e) {
assertEquals(e.getInput(), TEST_STRING);
assertEquals(e.getLineNumber(), 1);
}
@@ -137,7 +136,7 @@ public class FlatFileItemReaderBasicTests extends TestCase {
itemReader.open(executionContext);
itemReader.read();
fail("Expected ParsingException");
- } catch (FlatFileParsingException e) {
+ } catch (FlatFileParseException e) {
assertEquals(e.getInput(), TEST_STRING);
assertEquals(e.getLineNumber(), 1);
}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/FlatFileParsingExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileParseExceptionTests.java
similarity index 69%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/FlatFileParsingExceptionTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileParseExceptionTests.java
index f480d77e5..c3a0941f6 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/FlatFileParsingExceptionTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/file/FlatFileParseExceptionTests.java
@@ -14,25 +14,23 @@
* limitations under the License.
*/
-package org.springframework.batch.io.exception;
+package org.springframework.batch.item.file;
+
+import org.springframework.batch.common.AbstractExceptionTests;
-public class FlatFileParsingExceptionTests extends AbstractExceptionTests {
+public class FlatFileParseExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
- return new FlatFileParsingException(msg, "bar");
- }
-
- public Exception getException(Throwable t) throws Exception {
- return new FlatFileParsingException(t, "bar");
+ return new FlatFileParseException(msg, "bar");
}
public Exception getException(String msg, Throwable t) throws Exception {
- return new FlatFileParsingException(msg, t, "bar", 100);
+ return new FlatFileParseException(msg, t, "bar", 100);
}
public void testMessageInputLineCount() throws Exception {
- FlatFileParsingException exception = new FlatFileParsingException("foo", "bar", 100);
+ FlatFileParseException exception = new FlatFileParseException("foo", "bar", 100);
assertEquals("foo", exception.getMessage());
assertEquals("bar", exception.getInput());
assertEquals(100, exception.getLineNumber());
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Customer.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Customer.java
similarity index 97%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Customer.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Customer.java
index 495d39a3b..71276499d 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Customer.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Customer.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.batch.io.sample.domain;
+package org.springframework.batch.item.sample;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Foo.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Foo.java
similarity index 94%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Foo.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Foo.java
index bfce33945..a494e9c00 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Foo.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Foo.java
@@ -1,4 +1,4 @@
-package org.springframework.batch.io.sample.domain;
+package org.springframework.batch.item.sample;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/FooService.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/FooService.java
similarity index 95%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/FooService.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/FooService.java
index 0e655374f..8f8265670 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/FooService.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/FooService.java
@@ -1,4 +1,4 @@
-package org.springframework.batch.io.sample.domain;
+package org.springframework.batch.item.sample;
import java.util.ArrayList;
import java.util.List;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/LineItem.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/LineItem.java
similarity index 97%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/LineItem.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/LineItem.java
index f8717f82e..6f7cb1f85 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/LineItem.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/LineItem.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.batch.io.sample.domain;
+package org.springframework.batch.item.sample;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Order.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Order.java
similarity index 97%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Order.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Order.java
index a780233d5..b28df20c9 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Order.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Order.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.batch.io.sample.domain;
+package org.springframework.batch.item.sample;
import java.util.Date;
import java.util.List;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Shipper.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Shipper.java
similarity index 96%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Shipper.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Shipper.java
index 0edcb77c0..be79908a6 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/sample/domain/Shipper.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/sample/Shipper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.batch.io.sample.domain;
+package org.springframework.batch.item.sample;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/FileUtilsTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/FileUtilsTests.java
index d43adaa96..19223df3c 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/FileUtilsTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/support/FileUtilsTests.java
@@ -7,7 +7,6 @@ import java.io.IOException;
import junit.framework.TestCase;
-import org.springframework.batch.item.support.FileUtils;
import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.util.Assert;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/CompositeItemTransformerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/CompositeItemTransformerTests.java
index 71496532b..33e880642 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/CompositeItemTransformerTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/CompositeItemTransformerTests.java
@@ -5,8 +5,6 @@ import java.util.ArrayList;
import junit.framework.TestCase;
import org.easymock.MockControl;
-import org.springframework.batch.item.transform.CompositeItemTransformer;
-import org.springframework.batch.item.transform.ItemTransformer;
/**
* Tests for {@link CompositeItemTransformer}.
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/ItemTransformerItemWriterTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/ItemTransformerItemWriterTests.java
index 6b1189b96..49b1ccf71 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/ItemTransformerItemWriterTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/transform/ItemTransformerItemWriterTests.java
@@ -4,8 +4,6 @@ import junit.framework.TestCase;
import org.easymock.MockControl;
import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.item.transform.ItemTransformer;
-import org.springframework.batch.item.transform.ItemTransformerItemWriter;
/**
* Tests for {@link ItemTransformerItemWriter}.
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/SpringValidatorTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/SpringValidatorTests.java
index debe4da50..c629809a0 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/SpringValidatorTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/SpringValidatorTests.java
@@ -18,7 +18,6 @@ package org.springframework.batch.item.validator;
import junit.framework.TestCase;
-import org.springframework.batch.io.exception.ValidationException;
import org.springframework.validation.Errors;
import org.springframework.validation.Validator;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/ValidatingItemReaderTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/ValidatingItemReaderTests.java
index 11eb635b4..5d0633ae5 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/ValidatingItemReaderTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/ValidatingItemReaderTests.java
@@ -18,11 +18,8 @@ package org.springframework.batch.item.validator;
import junit.framework.TestCase;
import org.easymock.MockControl;
-import org.springframework.batch.io.exception.ValidationException;
import org.springframework.batch.item.AbstractItemReader;
import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.validator.ValidatingItemReader;
-import org.springframework.batch.item.validator.Validator;
/**
* @author Lucas Ward
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/ValidationExceptionTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/ValidationExceptionTests.java
similarity index 95%
rename from spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/ValidationExceptionTests.java
rename to spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/ValidationExceptionTests.java
index f5a8fbebb..3fbef212c 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/io/exception/ValidationExceptionTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/item/validator/ValidationExceptionTests.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.batch.io.exception;
+package org.springframework.batch.item.validator;
import org.springframework.batch.repeat.exception.AbstractExceptionTests;
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/handler/SimpleLimitExceptionHandlerTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/handler/SimpleLimitExceptionHandlerTests.java
index 25715e653..fe6723f5e 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/handler/SimpleLimitExceptionHandlerTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/repeat/exception/handler/SimpleLimitExceptionHandlerTests.java
@@ -22,7 +22,6 @@ import java.util.List;
import junit.framework.TestCase;
-import org.springframework.batch.io.exception.WriteFailureException;
import org.springframework.batch.repeat.context.RepeatContextSupport;
/**
@@ -45,8 +44,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
}
}
- public void testInitializeWithNullContextAndNullException()
- throws Exception {
+ public void testInitializeWithNullContextAndNullException() throws Exception {
try {
handler.handleException(null, null);
} catch (NullPointerException e) {
@@ -55,8 +53,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
}
/**
- * Other than nominated exception type should be rethrown, ignoring the
- * exception limit.
+ * Other than nominated exception type should be rethrown, ignoring the exception limit.
*
* @throws Exception
*/
@@ -71,15 +68,13 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
handler.handleException(new RepeatContextSupport(null), throwable);
fail("Exception swallowed.");
} catch (RuntimeException expected) {
- assertTrue("Exception is rethrown, ignoring the exception limit",
- true);
+ assertTrue("Exception is rethrown, ignoring the exception limit", true);
assertSame(expected, throwable);
}
}
/**
- * TransactionInvalidException should only be rethrown below the exception
- * limit.
+ * TransactionInvalidException should only be rethrown below the exception limit.
*
* @throws Exception
*/
@@ -89,16 +84,14 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
handler.setType(RuntimeException.class);
try {
- handler.handleException(new RepeatContextSupport(null),
- new RuntimeException("foo"));
+ handler.handleException(new RepeatContextSupport(null), new RuntimeException("foo"));
} catch (RuntimeException expected) {
fail("Unexpected exception.");
}
}
/**
- * TransactionInvalidException should only be rethrown below the exception
- * limit.
+ * TransactionInvalidException should only be rethrown below the exception limit.
*
* @throws Exception
*/
@@ -122,13 +115,11 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
}
/**
- * TransactionInvalidException should only be rethrown below the exception
- * limit.
+ * TransactionInvalidException should only be rethrown below the exception limit.
*
* @throws Exception
*/
- public void testLimitedExceptionThrownFromSiblingsWhenUsingParent()
- throws Exception {
+ public void testLimitedExceptionThrownFromSiblingsWhenUsingParent() throws Exception {
Throwable throwable = new RuntimeException("foo");
final int MORE_THAN_ZERO = 1;
@@ -150,9 +141,8 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
}
/**
- * TransactionInvalidExceptions are swallowed until the exception limit is
- * exceeded. After the limit is exceeded exceptions are rethrown as
- * BatchCriticalExceptions
+ * TransactionInvalidExceptions are swallowed until the exception limit is exceeded. After the limit is exceeded
+ * exceptions are rethrown as BatchCriticalExceptions
*/
public void testExceptionNotThrownBelowLimit() throws Exception {
@@ -162,7 +152,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
List throwables = new ArrayList() {
{
for (int i = 0; i < (EXCEPTION_LIMIT); i++) {
- add(new WriteFailureException("below exception limit"));
+ add(new RuntimeException("below exception limit"));
}
}
};
@@ -184,9 +174,8 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
}
/**
- * TransactionInvalidExceptions are swallowed until the exception limit is
- * exceeded. After the limit is exceeded exceptions are rethrown as
- * BatchCriticalExceptions
+ * TransactionInvalidExceptions are swallowed until the exception limit is exceeded. After the limit is exceeded
+ * exceptions are rethrown as BatchCriticalExceptions
*/
public void testExceptionThrownAboveLimit() throws Exception {
@@ -196,13 +185,12 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
List throwables = new ArrayList() {
{
for (int i = 0; i < (EXCEPTION_LIMIT); i++) {
- add(new WriteFailureException("below exception limit"));
+ add(new RuntimeException("below exception limit"));
}
}
};
- throwables
- .add(new WriteFailureException("above exception limit"));
+ throwables.add(new RuntimeException("above exception limit"));
RepeatContextSupport context = new RepeatContextSupport(null);
@@ -214,7 +202,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
assertTrue("exceptions up to limit are swallowed", true);
}
- } catch (WriteFailureException expected) {
+ } catch (RuntimeException expected) {
assertEquals("above exception limit", expected.getMessage());
}
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AbstractDelegatorTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AbstractDelegatorTests.java
index 42e7a5a3f..571bf5ca0 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AbstractDelegatorTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/AbstractDelegatorTests.java
@@ -2,9 +2,8 @@ package org.springframework.batch.support;
import junit.framework.TestCase;
-import org.springframework.batch.io.exception.DynamicMethodInvocationException;
-import org.springframework.batch.io.sample.domain.Foo;
-import org.springframework.batch.io.sample.domain.FooService;
+import org.springframework.batch.item.sample.Foo;
+import org.springframework.batch.item.sample.FooService;
import org.springframework.util.Assert;
/**
diff --git a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DefaultPropertEditorRegistrarTests.java b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DefaultPropertEditorRegistrarTests.java
index ece9989b5..89238be01 100644
--- a/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DefaultPropertEditorRegistrarTests.java
+++ b/spring-batch-infrastructure/src/test/java/org/springframework/batch/support/DefaultPropertEditorRegistrarTests.java
@@ -21,8 +21,6 @@ import java.util.Properties;
import junit.framework.TestCase;
-import org.springframework.batch.support.DefaultPropertyEditorRegistrar;
-import org.springframework.batch.support.IntArrayPropertyEditor;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.propertyeditors.CustomNumberEditor;
import org.springframework.beans.propertyeditors.PropertiesEditor;
diff --git a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/adapter/delegating-item-provider.xml b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/adapter/delegating-item-provider.xml
index 7d678ac84..2841adac7 100644
--- a/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/adapter/delegating-item-provider.xml
+++ b/spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/adapter/delegating-item-provider.xml
@@ -7,6 +7,6 @@