Examples of ParentStep


Examples of com.technophobia.substeps.model.ParentStep

        final String topLevelStepFeature = "Given two postcodes S11 8UP, \"Penrhyn Road\", S11 8UE, \"Hunter Hill Road\"";

        final String parentDefinition = "Given two postcodes <s_outer_pc> <s_inner_pc>, <from_street>, <e_outer_pc> <e_inner_pc>, <to_street>";

        final Step theParentStep = new Step(parentDefinition, true);
        final ParentStep parentStep = new ParentStep(theParentStep);

        final Step topLevelStop = new Step(topLevelStepFeature);

        parentStep.initialiseParamValues(topLevelStop);

        final Map<String, String> paramValueMap = parentStep.getParamValueMap().getParameters();
        Assert.assertNotNull(paramValueMap);

        Assert.assertThat(paramValueMap.size(), is(6));

        Assert.assertThat(paramValueMap.get("s_outer_pc"), is("S11"));
View Full Code Here

Examples of com.technophobia.substeps.model.ParentStep

        final Step aParentSubStep = new Step("Given", // "the usual with a <parameter>",
                "Given the usual with a <parameter>", true);

        final Step topLevelStepReDefinedInSubSteps = new Step("Given the usual with a \"fantastically tickety boo\"");

        final ParentStep parentStep = new ParentStep(aParentSubStep);

        parentStep.initialiseParamValues(topLevelStepReDefinedInSubSteps);
        // String[] paramValues = Util.getArgs(this.parent.pattern, step.param);

        final Map<String, String> paramValueMap = parentStep.getParamValueMap().getParameters();
        Assert.assertNotNull(paramValueMap);

        Assert.assertThat(paramValueMap.size(), is(1));

        Assert.assertTrue(paramValueMap.containsKey("parameter"));
View Full Code Here

Examples of com.technophobia.substeps.model.ParentStep

                            throw ex;
                        }
                    }
                }

                this.currentParentStep = new ParentStep(parent);

                break;
            }
            default: // whatever
        }
View Full Code Here

Examples of com.technophobia.substeps.model.ParentStep

        List<ParentStep> list = substepDefs.get(def1);

        Assert.assertThat(list, hasSize(1));

        ParentStep parentStep = list.get(0);

        String line = parentStep.getParent().getLine();

        Assert.assertThat(line, is(def1));

        final String def2 = "and something different";

        list = substepDefs.get(def2);

        Assert.assertThat(list, hasSize(1));

        parentStep = list.get(0);

        line = parentStep.getParent().getLine();

        Assert.assertThat(line, is(def2));

        final String commentedDefine = "a normal comment";
View Full Code Here

Examples of com.technophobia.substeps.model.ParentStep

            final Set<String> tags, final int depth) {

        substituteStepParametersIntoStep(parametersForSteps, step);

        // is this step defined as a root of some sub steps, ie a parent?
        ParentStep substepsParent = null;

        if (subStepsMapLocal != null) {
            substepsParent = locateSubStepsParent(subStepsMapLocal, step);
        }
View Full Code Here

Examples of com.technophobia.substeps.model.ParentStep

        substepNode.setLineNumber(substepsParent.getSourceLineNumber());
        return substepNode;
    }

    private ParentStep locateSubStepsParent(final PatternMap<ParentStep> subStepsMapLocal, final Step step) {
        ParentStep substepsParent = subStepsMapLocal.get(step.getLine(), 0);

        // if we're not strict then we can look for other step defs that fit
        if (!this.parameters.getSyntax().isStrict() && substepsParent == null) {
            final String originalKeyword = step.getKeyword();

            for (final String altKeyword : this.parameters.getSyntax().getNonStrictKeywordPrecedence()) {
                // don't use the same keyword again
                if (altKeyword.compareToIgnoreCase(originalKeyword) != 0) {

                    final String altLine = step.getLine().replaceFirst(originalKeyword, altKeyword);
                    substepsParent = subStepsMapLocal.get(altLine, 0);
                    if (substepsParent != null) {
                        // do we need to modify the parent ??

                        substepsParent = substepsParent.cloneWithAltLine(altLine);

                        break;
                    }
                }
            }
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.