SyntaxBuilder { public static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final File subStepsFile) { return buildSyntax(stepImplementationClasses, subStepsFile, true, (String[])null); } private  SyntaxBuilder(); static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final File subStepsFile); static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final File subStepsFile,
                                     final boolean strict, final String[] nonStrictKeywordPrecedence); static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final File subStepsFile,
                                     final boolean strict, final List<String> nonStrictKeywordPrecedence); static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final File subStepsFile,
                                     final boolean strict, final String[] nonStrictKeywordPrecedence, final ClassAnalyser classAnalyser); static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final File subStepsFile,
                                     final boolean strict, final String[] nonStrictKeywordPrecedence, final ClassAnalyser classAnalyser,
                                     final boolean failOnDuplicateEntries); 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); static Syntax buildSyntax(final List<Class<?>> stepImplementationClasses, final PatternMap<ParentStep> loadedSubSteps);  }
@Test(expected = DuplicatePatternException.class) public void testDuplicateDefinitionsThrowError() { final List<Class<?>> stepImplsList = new ArrayList<Class<?>>(); stepImplsList.add(TestStepImplementations.class); final List<Class<?>> stepImpls = new ArrayList<Class<?>>(); stepImpls.add(MockStepImplementations.class); SyntaxBuilder.buildSyntax(stepImpls, new File("./target/test-classes/substeps/duplicates.substeps")); }
@Test(expected = DuplicateStepImplementationException.class) public void testDuplicateStepImplementaionsThrowError() { final List<Class<?>> stepImplsList = new ArrayList<Class<?>>(); stepImplsList.add(TestStepImplementations.class); final List<Class<?>> stepImpls = new ArrayList<Class<?>>(); stepImpls.add(DuplicateStepImplementations.class); SyntaxBuilder.buildSyntax(stepImpls, new File("./target/test-classes/substeps/simple.substeps")); }
@Test public void testSingleWordSubStepDefinition() { final Step parent = new Step("ASingleWord", true, new File("./target/test-classes/substeps/bugs.substeps"), 23, 11); Assert.assertNotNull(parent.getPattern()); final List<Class<?>> stepImplsList = new ArrayList<Class<?>>(); stepImplsList.add(MockStepImplementations.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)); }