Examples of StepState


Examples of org.mage.test.clientside.bdd.StepState

    private StepState step;
    public Phase(StepState step) {
        this.step = step;
    }
    public void is(String phase, MageAPI.Owner owner) throws Exception {
        StepState current = MageAPI.defineStep(this.step);
        if (current.equals(StepState.GIVEN)) {
            if ("Precombat Main".equals(phase) && (owner.equals(mine) || owner.equals(me))) {
                MageBase.getInstance().goToPhase("Precombat Main - play spells and sorceries.");
                return;
            }
            System.err.println("waitForPhase not implemented for phase="+phase+", owner="+owner.name());
View Full Code Here

Examples of org.mage.test.clientside.bdd.StepState

    private StepState step;
    public Graveyards(StepState step) {
        this.step = step;
    }
    public boolean empty() throws Exception {
        StepState current = MageAPI.defineStep(this.step);
        if (current.equals(StepState.THEN)) {
            boolean empty = MageBase.getInstance().checkGraveyardsEmpty();
            Assert.assertThat(empty, is(true));
            return empty;
        } else {
            throw new AssertionError("Not implemented for step="+current);
View Full Code Here

Examples of org.mage.test.clientside.bdd.StepState

    private StepState step;
    public Battlefield(StepState step) {
        this.step = step;
    }
    public boolean has(String cardName) throws Exception {
        StepState current = MageAPI.defineStep(this.step);
        if (current.equals(StepState.THEN)) {
            return MageBase.getInstance().checkBattlefield(cardName);
        } else {
            throw new AssertionError("Not implemented for step="+current);
        }
    }
View Full Code Here

Examples of org.mage.test.clientside.bdd.StepState

    private StepState step;
    public A(StepState step) {
        this.step = step;
    }
    public void card(String cardName) throws Exception {
        StepState current = MageAPI.defineStep(this.step);
        if (current.equals(StepState.GIVEN)) {
            if (!MageBase.getInstance().giveme(cardName)) {
                throw new CardNotFoundException("Couldn't create card: " + cardName);
            }
        } else if (current.equals(StepState.THEN)) {
            if (!MageBase.getInstance().checkIhave(cardName)) {
                throw new CardNotFoundException("Couldn't find requested card in hand: " + cardName);
            }
        }
    }
View Full Code Here

Examples of org.mage.test.clientside.bdd.StepState

     *
     * @param step
     * @return
     */
    public static StepState defineStep(StepState step) {
        StepState current = step;
        if (!step.equals(StepState.UNKNOWN)) {
            StepController.currentState = step;
        } else {
            current = StepController.currentState;
        }
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

   * @param stateName The name for the new State
   * @return
   */
  protected State createNewStepState(State state, String oldName,
      String stateName) {
    return new StepState(stateName, ((StepState) state).getStep(oldName));
  }
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  @Test
  public void testGetSteps() throws Exception {
    SimpleFlow flow = new JsrFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step2")), "end0"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end0")));
    flow.setStateTransitions(transitions);
    flow.afterPropertiesSet();
    job.setFlow(flow);
    job.afterPropertiesSet();
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  @Test
  public void testTwoSteps() throws Exception {
    SimpleFlow flow = new JsrFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    StepState step2 = new StepState(new StubStep("step2"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.FAILED, "end0")));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    flow.setStateTransitions(transitions);
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  public void testFailedStep() throws Exception {
    SimpleFlow flow = new JsrFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StateSupport("step1", FlowExecutionStatus.FAILED),
        "step2"));
    StepState step2 = new StepState(new StubStep("step2"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.FAILED.getExitCode(), "end0"));
    transitions.add(StateTransition.createStateTransition(step2, ExitStatus.COMPLETED.getExitCode(), "end1"));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.FAILED, "end0")));
    transitions.add(StateTransition.createEndStateTransition(new EndState(FlowExecutionStatus.COMPLETED, "end1")));
    flow.setStateTransitions(transitions);
View Full Code Here

Examples of org.springframework.batch.core.job.flow.support.state.StepState

  @Test
  public void testFailedStepRestarted() throws Exception {
    SimpleFlow flow = new JsrFlow("job");
    List<StateTransition> transitions = new ArrayList<StateTransition>();
    transitions.add(StateTransition.createStateTransition(new StepState(new StubStep("step1")), "step2"));
    State step2State = new StateSupport("step2") {
      @Override
      public FlowExecutionStatus handle(FlowExecutor executor) throws Exception {
        JobExecution jobExecution = executor.getJobExecution();
        StepExecution stepExecution = jobExecution.createStepExecution(getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.