Package org.springframework.batch.item

Examples of org.springframework.batch.item.ExecutionContext


  private void start(String foo) {

    JobSynchronizationManager.close();
    jobExecution = new JobExecution(123L);

    ExecutionContext executionContext = new ExecutionContext();
    executionContext.put("foo", foo);
    executionContext.put("parent", bar);

    jobExecution.setExecutionContext(executionContext);
    JobSynchronizationManager.register(jobExecution);

    beanCount = beanFactory.getBeanDefinitionCount();
View Full Code Here


    assertEquals("bar-bar", compound.getName());

    JobSynchronizationManager.close();
    jobExecution = new JobExecution(123L);

    ExecutionContext executionContext = new ExecutionContext();
    executionContext.put("foo", "spam");

    jobExecution.setExecutionContext(executionContext);
    JobSynchronizationManager.register(jobExecution);

    assertEquals("spam-bar", compound.getName());
View Full Code Here

  }

  @Test
  public void testExecutionContext() throws Exception {
    StepExecution stepExecution = new StepExecution("foo", new JobExecution(11L), 1L);
    ExecutionContext executionContext = new ExecutionContext();
    executionContext.put("name", "spam");
    stepExecution.setExecutionContext(executionContext);
    proxied.execute(stepExecution);
    assertTrue(TestStep.getContext().attributeNames().length > 0);
    String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
    assertNotNull(collaborator);
View Full Code Here

  private void start(String foo) {

    StepSynchronizationManager.close();
    stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);

    ExecutionContext executionContext = new ExecutionContext();
    executionContext.put("foo", foo);
    executionContext.put("parent", bar);

    stepExecution.setExecutionContext(executionContext);
    StepSynchronizationManager.register(stepExecution);

    beanCount = beanFactory.getBeanDefinitionCount();
View Full Code Here

    assertEquals("bar-bar", compound.getName());

    StepSynchronizationManager.close();
    stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);

    ExecutionContext executionContext = new ExecutionContext();
    executionContext.put("foo", "spam");

    stepExecution.setExecutionContext(executionContext);
    StepSynchronizationManager.register(stepExecution);

    assertEquals("spam-bar", compound.getName());
View Full Code Here

  }

  @Test
  public void testExecutionContext() throws Exception {
    JobExecution stepExecution = new JobExecution(11L);
    ExecutionContext executionContext = new ExecutionContext();
    executionContext.put("name", "spam");
    stepExecution.setExecutionContext(executionContext);
    proxied.execute(stepExecution);
    assertTrue(TestJob.getContext().attributeNames().length > 0);
    String collaborator = (String) TestJob.getContext().getAttribute("collaborator");
    assertNotNull(collaborator);
View Full Code Here

  @Override
  public void writeCredit(CustomerCredit customerCredit) throws Exception {

    if (!opened) {
      open(new ExecutionContext());
    }

    String line = "" + customerCredit.getName() + separator
        + customerCredit.getCredit();
View Full Code Here

    StepSynchronizationManager.close();
    TestStep.reset();
    stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);

    ExecutionContext executionContext = new ExecutionContext();
    executionContext.put("foo", "bar");

    stepExecution.setExecutionContext(executionContext);
    StepSynchronizationManager.register(stepExecution);

    beanCount = beanFactory.getBeanDefinitionCount();
View Full Code Here

  }

  @Test
  public void testExecutionContext() throws Exception {
    assertNotNull(execution.getExecutionContext());
    ExecutionContext context = new ExecutionContext();
    context.putString("foo", "bar");
    execution.setExecutionContext(context);
    assertEquals("bar", execution.getExecutionContext().getString("foo"));
  }
View Full Code Here

  }

  private int doTest(String name, String test) throws Exception {
    @SuppressWarnings("unchecked")
    ItemStreamReader<String> reader = (ItemStreamReader<String>) applicationContext.getBean(name);
    reader.open(new ExecutionContext());
    StopWatch stopWatch = new StopWatch(test);
    stopWatch.start();
    int count = 0;
    while (reader.read() != null) {
      // do nothing
View Full Code Here

TOP

Related Classes of org.springframework.batch.item.ExecutionContext

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.