BATCH-859: fixed failing tests

This commit is contained in:
trisberg
2008-10-28 20:00:56 +00:00
parent a3ba1913f2
commit 1fa38d4c20
7 changed files with 85 additions and 23 deletions

View File

@@ -45,8 +45,8 @@ public class SkipSampleFunctionalTests extends AbstractValidatingBatchLauncherTe
// 5 input records, 1 skipped => 4 written to output
assertEquals(before + 4, after);
// no item was processed twice (no rollback occurred despite error on write)
assertEquals(after, writer.getItems().size());
// no item was processed twice (one rollback occurred due to validation error)
assertEquals(after - 1, writer.getItems().size());
}
}

View File

@@ -42,13 +42,13 @@ public class ItemTrackingItemWriterTests {
}
@Test
public void testValidationFailure() throws Exception {
writer.setValidationFailure(2);
public void testWriteFailure() throws Exception {
writer.setWriteFailure(2);
try {
writer.write(Arrays.asList("a", "b", "c"));
fail("Expected ValidationException");
fail("Expected Write Failure Exception");
}
catch (ValidationException e) {
catch (RuntimeException e) {
// expected
}
// the failed item is removed
@@ -57,9 +57,9 @@ public class ItemTrackingItemWriterTests {
assertEquals(5, writer.getItems().size());
try {
writer.write(Arrays.asList("f", "b", "g"));
fail("Expected ValidationException");
fail("Expected RuntimeException");
}
catch (ValidationException e) {
catch (RuntimeException e) {
// expected
}
// barf immediately if a failure is detected