BATCH-859: fixed failing tests
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user