Package org.springframework.batch.core

Examples of org.springframework.batch.core.Step


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

    Step step = job.getStep("foo");
    assertNull(step);
  }
View Full Code Here


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

    Step step = job.getStep("end0");
    assertNull(step);
  }
View Full Code Here

        list.add("foo");
        return RepeatStatus.FINISHED;
      }
    });

    Step step = factory.getObject();
    step.execute(new StepExecution(step.getName(), jobExecution));

    assertEquals(1, list.size());
  }
View Full Code Here

    }

    protected void assertStepDoNotExist(String jobName, String... stepNames) {
        for (String stepName : stepNames) {
            try {
                final Step step = stepRegistry.getStep(jobName, stepName);
                fail("Step with name [" + stepName + "] for job [" + jobName + "] should " +
                        "not have been found but got [" + step + "]");
            } catch (NoSuchJobException e) {
                fail("Job with name [" + jobName + "] should have been found.");
            } catch (NoSuchStepException e) {
View Full Code Here

  public void testStepParserBeanName() throws Exception {
    ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
        "org/springframework/batch/core/configuration/xml/StepParserBeanNameTests-context.xml");
    Map<String, Step> beans = ctx.getBeansOfType(Step.class);
    assertTrue("'s1' bean not found", beans.containsKey("s1"));
    Step s1 = (Step) ctx.getBean("s1");
    assertEquals("wrong name", "s1", s1.getName());
  }
View Full Code Here

  public void testStepParserCommitInterval() throws Exception {
    ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
        "org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml");
    Map<String, Step> beans = ctx.getBeansOfType(Step.class);
    assertTrue("'s1' bean not found", beans.containsKey("s1"));
    Step s1 = (Step) ctx.getBean("s1");
    CompletionPolicy completionPolicy = getCompletionPolicy(s1);
    assertTrue(completionPolicy instanceof SimpleCompletionPolicy);
    assertEquals(25, ReflectionTestUtils.getField(completionPolicy, "chunkSize"));
  }
View Full Code Here

  public void testStepParserCompletionPolicy() throws Exception {
    ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
        "org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml");
    Map<String, Step> beans = ctx.getBeansOfType(Step.class);
    assertTrue("'s1' bean not found", beans.containsKey("s1"));
    Step s1 = (Step) ctx.getBean("s1");
    CompletionPolicy completionPolicy = getCompletionPolicy(s1);
    assertTrue(completionPolicy instanceof DummyCompletionPolicy);
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  private List<StepExecutionListener> getListeners(String stepName, ApplicationContext ctx) throws Exception {
    assertTrue(ctx.containsBean(stepName));
    Step step = (Step) ctx.getBean(stepName);
    assertTrue(step instanceof TaskletStep);
    Object compositeListener = ReflectionTestUtils.getField(step, "stepExecutionListener");
    Object composite = ReflectionTestUtils.getField(compositeListener, "list");
    List<StepExecutionListener> list = (List<StepExecutionListener>) ReflectionTestUtils
        .getField(composite, "list");
View Full Code Here

    return list.get(0);
  }

  private DefaultTransactionAttribute getTransactionAttribute(ApplicationContext ctx, String stepName) {
    assertTrue(ctx.containsBean(stepName));
    Step step = (Step) ctx.getBean(stepName);
    assertTrue(step instanceof TaskletStep);
    Object transactionAttribute = ReflectionTestUtils.getField(step, "transactionAttribute");
    return (DefaultTransactionAttribute) transactionAttribute;
  }
View Full Code Here

    assertTrue(getTasklet("s10", ctx) instanceof DummyTasklet);
  }

  private Tasklet getTasklet(String stepName, ApplicationContext ctx) {
    assertTrue(ctx.containsBean(stepName));
    Step step = (Step) ctx.getBean(stepName);
    assertTrue(step instanceof TaskletStep);
    Object tasklet = ReflectionTestUtils.getField(step, "tasklet");
    assertTrue(tasklet instanceof Tasklet);
    return (Tasklet) tasklet;
  }
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.