Examples of CandidateSteps


Examples of org.jbehave.core.steps.CandidateSteps

        when(classLoader.newInstance(Embeddable.class, myEmbeddableName)).thenReturn(myEmbeddable);
        when(classLoader.newInstance(Embeddable.class, myOtherEmbeddableName)).thenReturn(myOtherEmbeddable);

        // When
        Configuration configuration = new MostUsefulConfiguration();
        CandidateSteps steps = mock(CandidateSteps.class);
        Embedder embedder = embedderWith(runner, embedderControls, monitor);
        embedder.useClassLoader(classLoader);
        embedder.useConfiguration(configuration);
        embedder.useCandidateSteps(asList(steps));
        embedder.runAsEmbeddables(classNames);
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

        when(embedder.configuration()).thenReturn(configuration);
        when(configuration.storyPathResolver()).thenReturn(pathResolver);
        Class<MyStory> storyClass = MyStory.class;
        String storyPath = "/path/to/story";
        when(pathResolver.resolve(storyClass)).thenReturn(storyPath);
        CandidateSteps steps = mock(CandidateSteps.class);

        // When
        MyStory story = new MyStory(configuration, steps);
        story.useEmbedder(embedder);
        story.run();
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

    @Test
    public void shouldRunMultipleStories() throws Throwable {
        // Given
        Embedder embedder = mock(Embedder.class);
        Configuration configuration = mock(Configuration.class);
        CandidateSteps steps = mock(CandidateSteps.class);

        // When
        MyStories story = new MyStories(configuration, steps);
        story.useEmbedder(embedder);
        story.run();
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

        when(embedder.configuration()).thenReturn(configuration);
        when(configuration.storyPathResolver()).thenReturn(pathResolver);
        Class<MyStory> storyClass = MyStory.class;
        String storyPath = "/path/to/story";
        when(pathResolver.resolve(storyClass)).thenReturn(storyPath);
        CandidateSteps steps = mock(CandidateSteps.class);
       
        // When
        MyStory story = new MyStory(new MostUsefulConfiguration(), steps);
        assertThat(story.configuration(), is(not(sameInstance(configuration))));
        story.useConfiguration(configuration);
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

        when(embedder.configuration()).thenReturn(configuration);
        when(configuration.storyPathResolver()).thenReturn(pathResolver);
        Class<MyStory> storyClass = MyStory.class;
        String storyPath = "/path/to/story";
        when(pathResolver.resolve(storyClass)).thenReturn(storyPath);
        CandidateSteps steps = mock(CandidateSteps.class);
       
        // When
        MyStory story = new MyStory(configuration, steps);
        story.useEmbedder(embedder);
        story.run();
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

        when(beforeStep.perform(null)).thenReturn(beforeResult);
        Step afterStep = mock(Step.class, "afterStep");
        StepResult afterResult = mock(StepResult.class);
        when(afterStep.perform(null)).thenReturn(afterResult);
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        StoryReporter reporter = mock(StoryReporter.class);
        FailureStrategy failureStrategy = mock(FailureStrategy.class);

        // When
        StoryRunner runner = new StoryRunner();
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

        when(beforeResult.getFailure()).thenReturn(failure);
        Step afterStep = mock(Step.class, "afterStep");
        StepResult afterResult = mock(StepResult.class);
        when(afterStep.doNotPerform(failure)).thenReturn(afterResult);
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        StoryReporter reporter = mock(StoryReporter.class);
        FailureStrategy failureStrategy = mock(FailureStrategy.class);

        // When
        StoryRunner runner = new StoryRunner();
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

                "pendingStep"));
        Story story = new Story(new Description("my blurb"), Narrative.EMPTY, asList(scenario1,
                scenario2, scenario3));
        StoryReporter reporter = mock(ConcurrentStoryReporter.class);
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        UUIDExceptionWrapper failure = new UUIDExceptionWrapper(new IllegalArgumentException());
        Step pendingStep = mock(Step.class, "pendingStep");
        Step successfulStep = mock(Step.class, "successfulStep");
        Step failingStep = mock(Step.class, "failingStep");
        when(successfulStep.perform(Matchers.<UUIDExceptionWrapper>any())).thenReturn(successful("successfulStep"));
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

        StoryParser storyParser = mock(StoryParser.class);
        StoryLoader storyLoader = mock(StoryLoader.class);
        StoryReporter reporter = mock(ConcurrentStoryReporter.class);
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        Step successfulStep = mockSuccessfulStep("successfulStep");
        Step anotherSuccessfulStep = mockSuccessfulStep("anotherSuccessfulStep");
        boolean givenStory = false;
        givenStoryWithNoBeforeOrAfterSteps(story1, givenStory, collector, mySteps);
        when(collector.collectScenarioSteps(asList(mySteps), scenario1, parameters)).thenReturn(asList(successfulStep));
View Full Code Here

Examples of org.jbehave.core.steps.CandidateSteps

        Step firstStepNormal = mockSuccessfulStep("Given I succeed");
        Step secondStepPending = mock(Step.class, "secondStepPending");
        Step thirdStepNormal = mock(Step.class, "thirdStepNormal");
        Step fourthStepAlsoPending = mock(Step.class, "fourthStepAlsoPending");
        StepCollector collector = mock(StepCollector.class);
        CandidateSteps mySteps = new Steps();
        Scenario scenario = new Scenario();
        when(collector.collectScenarioSteps(eq(asList(mySteps)), eq(scenario), eq(parameters))).thenReturn(
                asList(firstStepNormal, secondStepPending, thirdStepNormal, fourthStepAlsoPending));
        when(secondStepPending.perform(null)).thenReturn(pending("When I am pending"));
        when(thirdStepNormal.doNotPerform(Matchers.<UUIDExceptionWrapper>any())).thenReturn(notPerformed("Then I should not be performed"));
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.