Package org.springframework.batch.core.job.flow

Examples of org.springframework.batch.core.job.flow.FlowExecution


        StateTransition.createStateTransition(new StubState("step1"), ExitStatus.COMPLETED.getExitCode(), "step3"),
        StateTransition.createEndStateTransition(new StubState("step2")), StateTransition
        .createEndStateTransition(new StubState("step3"))));
    flow.setStateTransitionComparator(new DefaultStateTransitionComparator());
    flow.afterPropertiesSet();
    FlowExecution execution = flow.start(executor);
    assertEquals(FlowExecutionStatus.COMPLETED, execution.getStatus());
    assertEquals("step3", execution.getName());
  }
View Full Code Here


    flows.add(flow1);
    flows.add(flow2);

    SplitState state = new SplitState(flows, "foo");

    when(flow1.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));
    when(flow2.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));

    FlowExecutionStatus result = state.handle(executor);
    assertEquals(FlowExecutionStatus.COMPLETED, result);

  }
View Full Code Here

    Flow flow2 = mock(Flow.class);

    SplitState state = new SplitState(Arrays.asList(flow1, flow2), "foo");
    state.setTaskExecutor(new SimpleAsyncTaskExecutor());

    when(flow1.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));
    when(flow2.start(executor)).thenReturn(new FlowExecution("step1", FlowExecutionStatus.COMPLETED));
    FlowExecutionStatus result = state.handle(executor);
    assertEquals(FlowExecutionStatus.COMPLETED, result);

  }
View Full Code Here

  private MaxValueFlowExecutionAggregator aggregator = new MaxValueFlowExecutionAggregator();

  @Test
  public void testFailed() throws Exception {
    FlowExecution first = new FlowExecution("foo", FlowExecutionStatus.COMPLETED);
    FlowExecution second = new FlowExecution("foo", FlowExecutionStatus.FAILED);
    assertTrue("Should be negative", first.compareTo(second)<0);
    assertTrue("Should be positive", second.compareTo(first)>0);
    assertEquals(FlowExecutionStatus.FAILED, aggregator.aggregate(Arrays.asList(first, second)));
  }
View Full Code Here

*/
public class FlowExecutionTests {
 
  @Test
  public void testBasicProperties() throws Exception {
    FlowExecution execution = new FlowExecution("foo", new FlowExecutionStatus("BAR"));
    assertEquals("foo",execution.getName());
    assertEquals("BAR",execution.getStatus().getName());
  }
View Full Code Here

    assertEquals("BAR",execution.getStatus().getName());
  }

  @Test
  public void testAlphaOrdering() throws Exception {
    FlowExecution first = new FlowExecution("foo", new FlowExecutionStatus("BAR"));
    FlowExecution second = new FlowExecution("foo", new FlowExecutionStatus("SPAM"));
    assertTrue("Should be negative",first.compareTo(second)<0);
    assertTrue("Should be positive",second.compareTo(first)>0);
  }
View Full Code Here

    assertTrue("Should be positive",second.compareTo(first)>0);
  }

  @Test
  public void testEnumOrdering() throws Exception {
    FlowExecution first = new FlowExecution("foo", FlowExecutionStatus.COMPLETED);
    FlowExecution second = new FlowExecution("foo", FlowExecutionStatus.FAILED);
    assertTrue("Should be negative",first.compareTo(second)<0);
    assertTrue("Should be positive",second.compareTo(first)>0);
  }
View Full Code Here

    assertTrue("Should be positive",second.compareTo(first)>0);
  }

  @Test
  public void testEnumStartsWithOrdering() throws Exception {
    FlowExecution first = new FlowExecution("foo", new FlowExecutionStatus("COMPLETED.BAR"));
    FlowExecution second = new FlowExecution("foo", new FlowExecutionStatus("FAILED.FOO"));
    assertTrue("Should be negative",first.compareTo(second)<0);
    assertTrue("Should be positive",second.compareTo(first)>0);
  }
View Full Code Here

    assertTrue("Should be positive",second.compareTo(first)>0);
  }

  @Test
  public void testEnumStartsWithAlphaOrdering() throws Exception {
    FlowExecution first = new FlowExecution("foo", new FlowExecutionStatus("COMPLETED.BAR"));
    FlowExecution second = new FlowExecution("foo", new FlowExecutionStatus("COMPLETED.FOO"));
    assertTrue("Should be negative",first.compareTo(second)<0);
    assertTrue("Should be positive",second.compareTo(first)>0);
  }
View Full Code Here

    assertTrue("Should be positive",second.compareTo(first)>0);
  }

  @Test
  public void testEnumAndAlpha() throws Exception {
    FlowExecution first = new FlowExecution("foo", new FlowExecutionStatus("ZZZZZ"));
    FlowExecution second = new FlowExecution("foo", new FlowExecutionStatus("FAILED.FOO"));
    assertTrue("Should be negative",first.compareTo(second)<0);
    assertTrue("Should be positive",second.compareTo(first)>0);
  }
View Full Code Here

TOP

Related Classes of org.springframework.batch.core.job.flow.FlowExecution

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.