BATCH-220: Committed the read part of chunking, without adding it to the StepExecutor. It should be noted that I used 'Chunker' instead of 'ChunkReader', since there's already precedence in the java world, and it isn't reading chunk so much as making a chunk out of items. I have also added skipCount to StepExecution, since it's reasonable that this type of data A) should be persisted and B) the domain object is the most logical place for this type of state.

This commit is contained in:
lucasward
2008-02-11 03:18:09 +00:00
parent 7a2cdadf8c
commit f7cface009
8 changed files with 35 additions and 28 deletions

View File

@@ -20,15 +20,15 @@ package org.springframework.batch.io.exception;
public class TransactionInvalidExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new TransactionInvalidException(msg);
return new WriteFailureException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new TransactionInvalidException(t);
return new WriteFailureException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new TransactionInvalidException(msg, t);
return new WriteFailureException(msg, t);
}
public void testNothing() throws Exception {

View File

@@ -20,15 +20,15 @@ package org.springframework.batch.io.exception;
public class TransactionValidExceptionTests extends AbstractExceptionTests {
public Exception getException(String msg) throws Exception {
return new TransactionValidException(msg);
return new ReadFailureException(msg);
}
public Exception getException(Throwable t) throws Exception {
return new TransactionValidException(t);
return new ReadFailureException(t);
}
public Exception getException(String msg, Throwable t) throws Exception {
return new TransactionValidException(msg, t);
return new ReadFailureException(msg, t);
}
public void testNothing() throws Exception {

View File

@@ -22,7 +22,7 @@ import java.util.List;
import junit.framework.TestCase;
import org.springframework.batch.io.exception.TransactionInvalidException;
import org.springframework.batch.io.exception.WriteFailureException;
import org.springframework.batch.repeat.context.RepeatContextSupport;
/**
@@ -161,7 +161,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
List throwables = new ArrayList() {
{
for (int i = 0; i < (EXCEPTION_LIMIT); i++) {
add(new TransactionInvalidException("below exception limit"));
add(new WriteFailureException("below exception limit"));
}
}
};
@@ -195,13 +195,13 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
List throwables = new ArrayList() {
{
for (int i = 0; i < (EXCEPTION_LIMIT); i++) {
add(new TransactionInvalidException("below exception limit"));
add(new WriteFailureException("below exception limit"));
}
}
};
throwables
.add(new TransactionInvalidException("above exception limit"));
.add(new WriteFailureException("above exception limit"));
RepeatContextSupport context = new RepeatContextSupport(null);
@@ -213,7 +213,7 @@ public class SimpleLimitExceptionHandlerTests extends TestCase {
assertTrue("exceptions up to limit are swallowed", true);
}
} catch (TransactionInvalidException expected) {
} catch (WriteFailureException expected) {
assertEquals("above exception limit", expected.getMessage());
}