Package com.technophobia.substeps.model

Examples of com.technophobia.substeps.model.Syntax


        if (config.getSubStepsFileName() != null) {
            subStepsFile = new File(config.getSubStepsFileName());
        }

        final Syntax syntax = SyntaxBuilder.buildSyntax(config.getStepImplementationClasses(), subStepsFile,
                config.isStrict(), config.getNonStrictKeywordPrecedence());

        final TestParameters parameters = new TestParameters(tagmanager, syntax, config.getFeatureFile());

        parameters.setFailParseErrorsImmediately(config.isFastFailParseErrors());
View Full Code Here



    public static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final File subStepsFile,
            final boolean strict, final String[] nonStrictKeywordPrecedence, final ClassAnalyser classAnalyser,
            final boolean failOnDuplicateEntries, final SyntaxErrorReporter syntaxErrorReporter) {
        final Syntax syntax = buildBaseSyntax(stepImplementationClasses, classAnalyser, failOnDuplicateEntries,
                syntaxErrorReporter);

        syntax.setStrict(strict, nonStrictKeywordPrecedence);

        if (subStepsFile != null) {
            final SubStepDefinitionParser subStepParser = new SubStepDefinitionParser(failOnDuplicateEntries,
                    syntaxErrorReporter);
            syntax.setSubStepsMap(subStepParser.loadSubSteps(subStepsFile));
        }

        return syntax;
    }
View Full Code Here

            final SyntaxErrorReporter syntaxErrorReporter) {
        // step implementations (arranged by StepDefinition, ie the annotation)
        // +
        // sub step definitions

        final Syntax syntax = new Syntax(syntaxErrorReporter);
        syntax.setFailOnDuplicateStepImplementations(failOnDuplicateEntries);

        final List<Class<?>> implClassList;

        if (stepImplementationClasses != null) {
            implClassList = stepImplementationClasses;
View Full Code Here

        checkSyntaxBuilderWithStepImpls(stepImpls);
    }

    private void checkSyntaxBuilderWithStepImpls(final List<Class<?>> stepImpls) {
        final Syntax syntax = SyntaxBuilder.buildSyntax(stepImpls, new File(
                "./target/test-classes/substeps/allFeatures.substeps"));

        final List<StepImplementation> stepImplementations = syntax.getStepImplementations();

        Assert.assertFalse("expecting some step impls", stepImplementations.isEmpty());

        System.out.println("\nStep implementations\n");

        for (final StepImplementation impl : stepImplementations) {
            System.out.println(impl.getKeyword() + " " + impl.getValue() + " : "
                    + impl.getImplementedIn().getSimpleName() + "." + impl.getMethod().getName());
        }

        final List<ParentStep> sortedList = syntax.getSortedRootSubSteps();

        System.out.println("\n\n\nSubSteps\n");

        for (final ParentStep parent : sortedList) {
            final StringBuilder buf = new StringBuilder();
View Full Code Here

        stepImplsList.add(MockStepImplementations.class);

        // final List<Class<?>> stepImpls = new ArrayList<Class<?>>();
        // stepImpls.add(DuplicateStepImplementations.class);

        final Syntax syntax = SyntaxBuilder.buildSyntax(stepImplsList, new File(
                "./target/test-classes/substeps/bugs.substeps"));

        final List<ParentStep> substeps = syntax.getSubStepsMap().get("AnotherSingleWord");

        Assert.assertNotNull(substeps);

        Assert.assertThat(substeps.size(), is(1));
    }
View Full Code Here

    }


    private StepValidator createStepValidatorWithSubsteps(final String substepsFilename,
            final Class<?>... stepImplClasses) {
        final Syntax syntax = SyntaxBuilder.buildSyntax(Arrays.asList(stepImplClasses),
                createSubstepsFile(substepsFilename), true, new String[0], new ClassAnalyser(), true,
                this.syntaxErrorReporter);

        return new SyntaxAwareStepValidator(syntax);
    }
View Full Code Here

TOP

Related Classes of com.technophobia.substeps.model.Syntax

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.