Package org.jbehave.core.story.result

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


   
    public static class MyStory extends UsingMiniMock implements Story  {
    private Mock mock;
   
    public MyStory() {
            ScenarioResult resultA = new ScenarioResult("scenarioA", "MyStory", ScenarioResult.SUCCEEDED);
            ScenarioResult resultB = new ScenarioResult("scenarioB", "MyStory", ScenarioResult.SUCCEEDED);
           
      mock = mock(Story.class);
            mock.expects("addListener").with(isA(PlainTextScenarioListener.class));
      mock.expects("run").with(a(World.class)).will(returnValue(new ScenarioResult[] {resultA, resultB}));
    }
View Full Code Here


        super(writer, timer);
    }
   
    public void gotResult(Result result) {
        if (result instanceof ScenarioResult) {
            ScenarioResult scenarioResult = (ScenarioResult) result;
            if (scenarioResult.usedMocks()) {
               usedMocks.add(result);
            }
        }
        super.gotResult(result);
    }
View Full Code Here

    protected PlainTextListener newPlainTextListener() {
        return new PlainTextScenarioListener(writer, timer);
    }

    protected Result newSuccessResult() {
        return new ScenarioResult("scenario", "container", ScenarioResult.SUCCEEDED);
    }
View Full Code Here

    protected Result newSuccessResult() {
        return new ScenarioResult("scenario", "container", ScenarioResult.SUCCEEDED);
    }

    protected Result newFailureResult() {
        return new ScenarioResult("Scenario", "container", new VerificationException("oops"));
    }
View Full Code Here

    protected Result newFailureResult() {
        return new ScenarioResult("Scenario", "container", new VerificationException("oops"));
    }

    protected Result newExceptionResult() {
        return new ScenarioResult("Scenario", "container", new Exception("oops"));
    }
View Full Code Here

    protected Result newExceptionResult() {
        return new ScenarioResult("Scenario", "container", new Exception("oops"));
    }

    protected Result newPendingResult() {
        return new ScenarioResult("Scenario", "container", new PendingException());
    }
View Full Code Here

    public void shouldRenderMockSymbolForScenarioThatUsedMocks() throws Exception {
        // given...
       
        // when...
        listener.gotResult(new ScenarioResult("scenario", "container", ScenarioResult.USED_MOCKS));
       
        // then...
        ensureThat(writer.toString(), eq(ScenarioResult.USED_MOCKS.symbol()));
    }
View Full Code Here

        ensureThat(writer.toString(), eq(ScenarioResult.USED_MOCKS.symbol()));
    }
   
    public void shouldSummarizeScenarioThatUsesMocks() throws Exception {
        // given...
        Result usesMocks = new ScenarioResult("scenario", "Container", ScenarioResult.USED_MOCKS);
       
        // when...
        listener.gotResult(usesMocks);
        listener.printReport();
       
View Full Code Here

            }
        };
       
        Mock listener = mock(BehaviourListener.class);
        AScenario scenario = new AScenario();
        ScenarioResult result = new ScenarioResult("a scenario", "a story", Result.SUCCEEDED);
       
        scenario.expects("run").with(world);
        scenario.expects("containsMocks").will(returnValue(false));
        listener.expects("gotResult").with(eq(result));
       
View Full Code Here

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

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.