Package org.springframework.batch.item.file

Examples of org.springframework.batch.item.file.FlatFileParseException


  }

  @Test
  public void testLimitExceed() {
    try {
      failurePolicy.shouldSkip(new FlatFileParseException("", ""), 2);
      fail();
    } catch (SkipLimitExceededException ex) {
      // expected
    }
  }
View Full Code Here


    assertFalse(failurePolicy.shouldSkip(new FileNotFoundException(), 2));
  }

  @Test
  public void testSkip() {
    assertTrue(failurePolicy.shouldSkip(new FlatFileParseException("", ""), 0));
  }
View Full Code Here

  }
 
  @Override
  public void onSkipInRead(Throwable t) {
    if(t instanceof FlatFileParseException) {
      FlatFileParseException ffpe = (FlatFileParseException) t;
      jdbcTemplate.update(
        "insert into skipped_product (line,line_number) values (?,?)",
        ffpe.getInput(),ffpe.getLineNumber()
        //multiResourceItemReader.getCurrentResource().getFilename(), ffpe.getInput(),ffpe.getLineNumber()
      );
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.item.file.FlatFileParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.