Package org.jbehave.core.story.result

Examples of org.jbehave.core.story.result.ScenarioResult


        };
       
        Mock listener = mock(BehaviourListener.class);
        AScenario scenario = new AScenario();
        NestedVerificationException nve = new NestedVerificationException(new RuntimeException());
        ScenarioResult result = new ScenarioResult("a scenario", "a story", nve);
        scenario.expects("run").with(world).will(throwException(nve));
        listener.expects("gotResult").with(eq(result));
       
        story.addScenario((Scenario)scenario);
        story.addListener((BehaviourListener)listener);
View Full Code Here


        };
       
        Mock listener = mock(BehaviourListener.class);
        AScenario scenario = new AScenario();
        VerificationException ve = new VerificationException("Thrown by an outcome when an ensureThat fails");
        ScenarioResult result = new ScenarioResult("a scenario", "a story", ve);
        scenario.expects("run").with(world).will(throwException(ve));
        scenario.expects("cleanUp").with(world);
       
        story.addScenario((Scenario)scenario);
       
View Full Code Here

    protected World createWorld() {
        return new HashMapWorld();
    }

    private ScenarioResult runScenario(World world, Class storyClass, Scenario scenario) {
        ScenarioResult result;
        String storyDescription = new CamelCaseConverter(storyClass).toPhrase();
        String description = new CamelCaseConverter(scenario).toPhrase();
       
        try {               
            scenario.run(world);
            result = new ScenarioResult(description, storyDescription,
                    scenario.containsMocks() ? ScenarioResult.USED_MOCKS : ScenarioResult.SUCCEEDED);
        } catch (VerificationException ve) {
            result = new ScenarioResult(description, storyDescription, ve);
        } finally {
            scenario.cleanUp(world);
        }       
        return result;
    }
View Full Code Here

TOP

Related Classes of org.jbehave.core.story.result.ScenarioResult

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.