Java 类org.springframework.batch.core.step.NoSuchStepException 实例源码

项目:spring-cloud-task    文件:DeployerStepExecutionHandlerTests.java   
@Test
public void testMissingStepExecution() throws Exception {
    when(this.environment.containsProperty(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID)).thenReturn(true);
    when(this.environment.containsProperty(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID)).thenReturn(true);
    when(this.environment.containsProperty(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME)).thenReturn(true);
    when(this.environment.getProperty(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_NAME)).thenReturn("foo");
    when(this.beanFactory.getBeanNamesForType(Step.class)).thenReturn(new String[] {"foo", "bar", "baz"});
    when(this.environment.getProperty(DeployerPartitionHandler.SPRING_CLOUD_TASK_STEP_EXECUTION_ID)).thenReturn("2");
    when(this.environment.getProperty(DeployerPartitionHandler.SPRING_CLOUD_TASK_JOB_EXECUTION_ID)).thenReturn("1");

    try {
        this.handler.run();
    }
    catch (NoSuchStepException nsse) {
        assertEquals("No StepExecution could be located for step execution id 2 within job execution 1", nsse.getMessage());
    }
}
项目:marklogic-spring-batch    文件:JobSupport.java   
@Override
public Step getStep(String stepName) throws NoSuchStepException {
    final Step step = steps.get(stepName);
    if (step == null) {
        throw new NoSuchStepException("Step ["+stepName+"] does not exist for job with name ["+getName()+"]");
    }
    return step;
}
项目:saos    文件:SaosJobServiceAdapter.java   
public Collection<StepExecution> listStepExecutionsForStep(String jobName,
        String stepName, int start, int count) throws NoSuchStepException {
    return simpleJobService.listStepExecutionsForStep(jobName, stepName,
            start, count);
}
项目:saos    文件:SaosJobServiceAdapter.java   
public int countStepExecutionsForStep(String jobName, String stepName)
        throws NoSuchStepException {
    return simpleJobService.countStepExecutionsForStep(jobName, stepName);
}