concept incorrect line in category spring
appears as: n incorrect line, incorrect lines, incorrect line

This is an excerpt from Manning's book Spring Batch in Action.
Should a whole batch fail because of one badly formatted line? Not always. The decision to skip an incorrect line or an incorrect item is declarative in Spring Batch. It’s all about configuration.
You can now launch the job with an input file containing incorrectly formatted lines, and you’ll see that Spring Batch keeps on running the job as long as the number of skipped items doesn’t exceed the skip limit. Assuming the ZIP archive contains incorrect lines, you can add a test method to your test, as shown in the following listing.
Listing 1.11. Testing the job correctly skips incorrect lines with a new test method
@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"/import-products-job-context.xml","/test- context.xml"}) public class ImportProductsIntegrationTest { (...) @Test public void importProductsWithErrors() throws Exception { int initial = jdbcTemplate.queryForInt("select count(1) from product"); jobLauncher.run(job, new JobParametersBuilder() .addString("inputResource", "classpath:/input/products_with_errors.zip") .addString("targetDirectory", "./target/importproductsbatch/") .addString("targetFile","products.txt") .addLong("timestamp", System.currentTimeMillis()) .toJobParameters() ); int nbOfNewProducts = 6; Assert.assertEquals( initial+nbOfNewProducts, jdbcTemplate.queryForInt("select count(1) from product") ); } }