@Override protected boolean execute(SubstepNode node, RootNodeExecutionContext context) { log.debug("Executing substep {}", node.getDescription()); boolean success = addExpectedChildrenFailureIfNoChildren(node, node.getChildren(), context); this.context = context; Iterator<StepNode> substepsIt = node.getChildren().iterator(); while (success && substepsIt.hasNext()) { success = substepsIt.next().dispatch(this); } return success; }
@Override public String getDescription() { return getLine(); }
public SubstepNode(List<StepNode> substeps, Set<String> tags, int depth) { super(substeps); this.tags = tags; setDepth(depth); }
substepNode.setLine(step.getLine()); substepNode.setFileUri(substepsParent.getSubStepFileUri()); substepNode.setLineNumber(substepsParent.getSourceLineNumber()); substepNode.setSourceLine(substepsParent.getParent().getLine()); substepNode.setParameterNames(substepsParent.getParent().getParamNames());
substepNode.setLine(step.getLine()); substepNode.setFileUri(substepsParent.getSubStepFileUri()); substepNode.setLineNumber(substepsParent.getSourceLineNumber()); return substepNode;
@Override public <RETURN_TYPE> List<RETURN_TYPE> accept(ExecutionNodeVisitor<RETURN_TYPE> executionNodeVisitor) { List<RETURN_TYPE> toReturn = Lists.newArrayList(); toReturn.add(executionNodeVisitor.visit(this)); for (StepNode stepNode : getChildren()) { toReturn.addAll(stepNode.accept(executionNodeVisitor)); } return toReturn; }
public SubstepNode build(final String scenarioDescription, final List<Step> steps, final PatternMap<ParentStep> subStepsMapLocal, final ParentStep parent, final ExampleParameter parametersForSteps, final boolean throwExceptionIfUnableToBuildMethodArgs, final Set<String> tags, final int depth) { if (steps == null || steps.isEmpty()) { throw new SubstepsConfigurationException("There are no steps for " + scenarioDescription + " or a substep"); } final List<StepNode> substeps = Lists.newArrayList(); for (final Step step : steps) { substeps.add(buildStepNode(scenarioDescription, step, subStepsMapLocal, parent, parametersForSteps, throwExceptionIfUnableToBuildMethodArgs, tags, depth + 1)); } return new SubstepNode(substeps, tags, depth); }
@Override public <RETURN_TYPE> List<RETURN_TYPE> accept(final ExecutionNodeVisitor<RETURN_TYPE> executionNodeVisitor) { final List<RETURN_TYPE> results = Lists.newArrayList(); results.add(executionNodeVisitor.visit(this)); if (this.background != null) { results.addAll(this.background.accept(executionNodeVisitor)); } for (final StepNode step : getChildren()) { results.addAll(step.accept(executionNodeVisitor)); } return results; }
public SubstepNode build(final String scenarioDescription, final List<Step> steps, final PatternMap<ParentStep> subStepsMapLocal, final ParentStep parent, final ExampleParameter parametersForSteps, final boolean throwExceptionIfUnableToBuildMethodArgs, final Set<String> tags, final int depth) { if (steps == null || steps.isEmpty()) { throw new SubstepsConfigurationException("There are no steps for " + scenarioDescription + " or a substep"); } final List<StepNode> substeps = Lists.newArrayList(); for (final Step step : steps) { substeps.add(buildStepNode(scenarioDescription, step, subStepsMapLocal, parent, parametersForSteps, throwExceptionIfUnableToBuildMethodArgs, tags, depth + 1)); } return new SubstepNode(substeps, tags, depth); }
@Override protected boolean execute(SubstepNode node, RootNodeExecutionContext context) { log.debug("Executing substep {}", node.getDescription()); boolean success = addExpectedChildrenFailureIfNoChildren(node, node.getChildren(), context); this.context = context; Iterator<StepNode> substepsIt = node.getChildren().iterator(); while (success && substepsIt.hasNext()) { success = substepsIt.next().dispatch(this); } return success; }