Package org.springframework.batch.repeat.callback

Examples of org.springframework.batch.repeat.callback.NestedRepeatCallback


  @Test
  public void testNestedSession() throws Exception {
    RepeatTemplate outer = getRepeatTemplate();
    RepeatTemplate inner = getRepeatTemplate();
    outer.iterate(new NestedRepeatCallback(inner, new RepeatCallback() {
            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++;
        assertNotNull(context);
        assertNotSame("Nested batch should have new session", context, context.getParent());
View Full Code Here


  @Test
  public void testNestedSessionTerminatesBeforeIteration() throws Exception {
    RepeatTemplate outer = getRepeatTemplate();
    RepeatTemplate inner = getRepeatTemplate();
    outer.iterate(new NestedRepeatCallback(inner, new RepeatCallback() {
            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++;
        assertEquals(2, count);
        fail("Nested batch should not have been executed");
View Full Code Here

  @Test
  public void testOuterContextPreserved() throws Exception {
    RepeatTemplate outer = getRepeatTemplate();
    outer.setCompletionPolicy(new SimpleCompletionPolicy(2));
    RepeatTemplate inner = getRepeatTemplate();
    outer.iterate(new NestedRepeatCallback(inner, new RepeatCallback() {
            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++;
        assertNotNull(context);
        assertNotSame("Nested batch should have new session", context, context.getParent());
View Full Code Here

    final RepeatTemplate chunkTemplate = new RepeatTemplate();
    // The policy is resettable so we only have to resolve this dependency
    // once
    chunkTemplate.setCompletionPolicy(new SimpleCompletionPolicy(2));

    RepeatStatus result = repeatTemplate.iterate(new NestedRepeatCallback(chunkTemplate, callback) {

            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++; // for test assertion
        return super.doInIteration(context);
View Full Code Here

    // The policy is resettable so we only have to resolve this dependency
    // once
    chunkTemplate.setCompletionPolicy(new SimpleCompletionPolicy(2));
    chunkTemplate.setTaskExecutor(new SimpleAsyncTaskExecutor());

    RepeatStatus result = repeatTemplate.iterate(new NestedRepeatCallback(chunkTemplate, callback) {

            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++; // for test assertion
        return super.doInIteration(context);
View Full Code Here

  public void testNestedSession() throws Exception {

    RepeatTemplate outer = getRepeatTemplate();
    RepeatTemplate inner = new RepeatTemplate();

    outer.iterate(new NestedRepeatCallback(inner, new RepeatCallback() {
            @Override
      public RepeatStatus doInIteration(RepeatContext context) throws Exception {
        count++;
        assertNotNull(context);
        assertNotSame("Nested batch should have new session", context, context.getParent());
View Full Code Here

TOP

Related Classes of org.springframework.batch.repeat.callback.NestedRepeatCallback

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.