Examples of ScenarioResult


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

            }
        };
       
        Mock listener = mock(BehaviourListener.class);
        AScenario scenario = new AScenario();
        ScenarioResult result = new ScenarioResult("a scenario", "a story", ScenarioResult.USED_MOCKS);

        scenario.expects("run").with(world);
        scenario.expects("containsMocks").will(returnValue(true));
        listener.expects("gotResult").with(eq(result));
       
View Full Code Here

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

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

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

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

    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

Examples of org.moresbycoffee.mbyhave8.result.ScenarioResult

    private ScenarioOutput executeHelper(final BiFunction<Step, StepHooks, StepOutput> stepExecutor, final BiFunction<Step, StepHooks, StepOutput> skipStep, final ScenarioHooks hooks) {
        hooks.startScenario(this);

        final StepHooks stepHooks = new ScenarioAwareStepHook(id, hooks);

        ScenarioResult result = ScenarioResult.Success;
        final List<StepOutput> stepOutputs;
        if (steps.isEmpty()) {
            result = ScenarioResult.Pending;
            stepOutputs = Collections.emptyList();
        } else {
View Full Code Here

Examples of org.moresbycoffee.mbyhave8.result.ScenarioResult

        tags.addAll(s.getTags());
        return tags;
    }

    private FeatureResult folder(final FeatureResult previousResult, final ScenarioOutput item) {
        final ScenarioResult scenarioResult = item.getResult();
        switch (scenarioResult) {
            case Error: {
                return FeatureResult.Error;
            }
            case Pending: {
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.