Package org.springframework.batch.core

Examples of org.springframework.batch.core.Step


    };

    factory.setItemReader(reader);
    factory.setStreams(new ItemStream[] { stream, reader });

    Step step = factory.getObject();

    step.execute(stepExecution);

    assertTrue(opened);
    assertTrue(closed);
    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
  }
View Full Code Here


    Object advised = proxy.getProxy();

    factory.setItemReader((ItemReader<? extends String>) advised);
    factory.setStreams(new ItemStream[] { (ItemStream) advised });

    Step step = factory.getObject();

    step.execute(stepExecution);

    assertTrue(opened);
    assertTrue(closed);
    assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
  }
View Full Code Here


  @Override
  protected Step createPartitionStep() {
    // Creating a partitioned step for the JSR needs to create two steps...the partitioned step and the step being executed.
    Step executedStep = null;

    if (hasChunkElement()) {
      Assert.isTrue(!hasTasklet(), "Step [" + getName()
          + "] has both a <chunk/> element and a 'ref' attribute  referencing a Tasklet.");

      validateFaultTolerantSettings();

      if (isFaultTolerant()) {
        executedStep = createFaultTolerantStep();
      }
      else {
        executedStep = createSimpleStep();
      }
    }
    else if (hasTasklet()) {
      executedStep = createTaskletStep();
    }

    ((JsrPartitionHandler) super.getPartitionHandler()).setStep(executedStep);

    JsrPartitionStepBuilder builder = new JsrSimpleStepBuilder<I, O>(new StepBuilder(executedStep.getName())).partitioner(executedStep);

    enhanceCommonStep(builder);

    if (getPartitionHandler() != null) {
      builder.partitionHandler(getPartitionHandler());
View Full Code Here

    JobExecution jobExecution = repository.createJobExecution("job", new JobParameters());
    StepExecution stepExecution = jobExecution.createStepExecution(factory.getName());
    repository.add(stepExecution);

    Step step = factory.getObject();

    step.execute(stepExecution);
    assertEquals(BatchStatus.FAILED, stepExecution.getStatus());

    assertEquals("[]", writer.getCommitted().toString());
  }
View Full Code Here

      public void onWriteError(Exception ex, List<? extends String> item) {
        listened.add(ex);
      }
    } });

    Step step = factory.getObject();

    job.setSteps(Collections.singletonList(step));

    JobExecution jobExecution = repository.createJobExecution(job.getName(), new JobParameters());
View Full Code Here

    TestItemListenerWriter itemWriter = new TestItemListenerWriter();
    factory.setItemWriter(itemWriter);
    factory.setItemProcessor(itemWriter);

    Step step = factory.getObject();

    job.setSteps(Collections.singletonList(step));

    JobExecution jobExecution = repository.createJobExecution(job.getName(), new JobParameters());
View Full Code Here

    TestItemListenerWriter itemWriter = new TestItemListenerWriter();
    factory.setListeners(new StepListener[] { itemWriter });
    factory.setItemWriter(itemWriter);

    Step step = factory.getObject();

    job.setSteps(Collections.singletonList(step));

    JobExecution jobExecution = repository.createJobExecution(job.getName(), new JobParameters());
View Full Code Here

        written.add(item);
        return null;
      }
    });

    Step step = factory.getObject();

    job.setSteps(Collections.singletonList(step));

    JobExecution jobExecution = repository.createJobExecution(job.getName(), new JobParameters());
View Full Code Here

    flow.setStateTransitions(transitions);
    flow.afterPropertiesSet();
    job.setFlow(flow);
    job.afterPropertiesSet();

    Step step = job.getStep("step2");
    assertNotNull(step);
    assertEquals("step2", step.getName());
  }
View Full Code Here

    flow.afterPropertiesSet();
    job.setFlow(flow);
    job.setName(flow.getName());
    job.afterPropertiesSet();

    Step step = job.getStep("step");
    assertNotNull(step);
    assertEquals("step", step.getName());
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.Step

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.