Package org.jbehave.core.story.codegen.domain

Examples of org.jbehave.core.story.codegen.domain.BasicDetails


    }

    private static void outcomes(OutcomeDetails outcomes, VelocityEngine ve, VelocityContext vcontext) throws Exception {
        Template outcomeTemplate = ve.getTemplate("templates/Expectation.vm");
        for (int i = 0; i < outcomes.outcomes.size(); i++) {
            BasicDetails outcome = (BasicDetails) outcomes.outcomes.get(i);
            vcontext.put("outcome", outcome.getClassName());
            merge(outcomeTemplate, vcontext, new FileWriter(genDir + outcome.getClassName() + ".java"));

        }
    }
View Full Code Here


    private static void givens(ContextDetails context, VelocityEngine ve, VelocityContext vcontext) throws Exception {
        List givens = context.givens;
        Template givenTemplate = ve.getTemplate("templates/Given.vm");
        for (int j = 0; j < givens.size(); j++) {
            BasicDetails given = (BasicDetails) givens.get(j);
            vcontext.put("given", given);
            merge(givenTemplate, vcontext, new FileWriter(genDir+given.getClassName()+".java"));
        }
    }
View Full Code Here

    private Scenario scenario(final ScenarioDetails details, String storyName) {
        return new MultiStepScenario() {
            public void specifySteps() {
                // given
                for (Iterator i = details.context.givens.iterator(); i.hasNext();) {
                    BasicDetails given = (BasicDetails)i.next();
                    given((Given)builder.newGiven(given.name));
                }
               
                // when
                when((Event)builder.newEvent(details.event.name));
               
                // then
                for (Iterator i = details.outcome.outcomes.iterator(); i.hasNext();) {
                    BasicDetails outcome = (BasicDetails)i.next();
                    then((Outcome)builder.newOutcome(outcome.name));
                }
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.jbehave.core.story.codegen.domain.BasicDetails

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.