Package org.springframework.batch.core.step

Examples of org.springframework.batch.core.step.StepSupport


    assertEquals(stepExecution1, stepExecution2);
  }

  @Test
  public void testEqualsWithNull() throws Exception {
    Entity stepExecution = newStepExecution(new StepSupport("stepName"), new Long(11));
    assertFalse(stepExecution.equals(null));
  }
View Full Code Here


    assertFalse(stepExecution.equals(null));
  }

  @Test
  public void testEqualsWithNullIdentifiers() throws Exception {
    Entity stepExecution = newStepExecution(new StepSupport("stepName"), new Long(11));
    assertFalse(stepExecution.equals(blankExecution));
  }
View Full Code Here

    assertFalse(stepExecution.equals(blankExecution));
  }

  @Test
  public void testEqualsWithNullJob() throws Exception {
    Entity stepExecution = newStepExecution(new StepSupport("stepName"), new Long(11));
    assertFalse(stepExecution.equals(blankExecution));
  }
View Full Code Here

    assertTrue(execution.equals(execution));
  }

  @Test
  public void testEqualsWithDifferent() throws Exception {
    Entity stepExecution = newStepExecution(new StepSupport("foo"), new Long(13));
    assertFalse(execution.equals(stepExecution));
  }
View Full Code Here

    assertFalse(execution.equals(stepExecution));
  }

  @Test
  public void testEqualsWithNullStepId() throws Exception {
    Step step = new StepSupport("name");
    execution = newStepExecution(step, new Long(31));
    assertEquals("name", execution.getStepName());
    StepExecution stepExecution = newStepExecution(step, new Long(31));
    assertEquals(stepExecution.getJobExecutionId(), execution.getJobExecutionId());
    assertTrue(execution.equals(stepExecution));
View Full Code Here

    }
  };

  @Before
  public void setUp() throws Exception {
    handler.setStep(new StepSupport() {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException {
        count++;
        stepExecutions.add(stepExecution.getStepName());
      }
View Full Code Here

  /**
   * Test method for {@link SimpleJob#setSteps(java.util.List)}.
   */
  @Test
  public void testSetSteps() {
    job.setSteps(Collections.singletonList((Step) new StepSupport("step")));
    job.execute(jobExecution);
    assertEquals(1, jobExecution.getStepExecutions().size());
  }
View Full Code Here

   * {@link SimpleJob#addStep(org.springframework.batch.core.Step)}.
   */
  @Test
  public void testAddStep() {
    job.setSteps(Collections.<Step> emptyList());
    job.addStep(new StepSupport("step"));
    job.execute(jobExecution);
    assertEquals(1, jobExecution.getStepExecutions().size());
  }
View Full Code Here

    execution = jobRepository.createJobExecution("job", new JobParameters());
  }

  @Test
  public void testStepFailure() throws Exception {
    job.setSteps(Arrays.<Step> asList(new StepSupport("step")));
    job.execute(execution);
    assertEquals(BatchStatus.FAILED, execution.getStatus());
  }
View Full Code Here

    assertEquals(BatchStatus.FAILED, execution.getStatus());
  }

  @Test
  public void testStepStatusUnknown() throws Exception {
    job.setSteps(Arrays.<Step> asList(new StepSupport("step1") {
      @Override
      public void execute(StepExecution stepExecution) throws JobInterruptedException,
          UnexpectedJobExecutionException {
        // This is what happens if the repository meta-data cannot be updated
        stepExecution.setStatus(BatchStatus.UNKNOWN);
        stepExecution.setTerminateOnly();
      }
    }, new StepSupport("step2")));
    job.execute(execution);
    assertEquals(BatchStatus.UNKNOWN, execution.getStatus());
    assertEquals(1, execution.getStepExecutions().size());
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.step.StepSupport

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.