Package org.jbehave.core.configuration

Examples of org.jbehave.core.configuration.MostUsefulConfiguration


    @Test
    public void shouldHandleFailureInParametrisedStep() throws IntrospectionException {
        // Given
        SomeSteps stepsInstance = new SomeSteps();
        InjectableStepsFactory stepsFactory = new InstanceStepsFactory(new MostUsefulConfiguration(), stepsInstance);
        StepCreator stepCreator = new StepCreator(stepsInstance.getClass(), stepsFactory, null,
                new ParameterControls(), null, new SilentStepMonitor());

        // When
        Method method = null;
View Full Code Here


    @Test(expected = ParameterNotFound.class)
    public void shouldFailIfMatchedParametersAreNotFound() throws IntrospectionException {
        // Given
        SomeSteps stepsInstance = new SomeSteps();
        StepMatcher stepMatcher = mock(StepMatcher.class);
        InjectableStepsFactory stepsFactory = new InstanceStepsFactory(new MostUsefulConfiguration(), stepsInstance);
        StepCreator stepCreator = new StepCreator(stepsInstance.getClass(), stepsFactory, new ParameterConverters(),
                new ParameterControls(), stepMatcher, new SilentStepMonitor());

        // When
        when(stepMatcher.parameterNames()).thenReturn(new String[] {});
View Full Code Here

        assertThat(results.get("variant"), equalTo("a variant"));

    }

    private StepCreator stepCreatorUsing(SomeSteps stepsInstance, StepMatcher stepMatcher, ParameterControls parameterControls) {
        InjectableStepsFactory stepsFactory = new InstanceStepsFactory(new MostUsefulConfiguration(), stepsInstance);
        return new StepCreator(stepsInstance.getClass(), stepsFactory, parameterConverters, parameterControls,
                stepMatcher, new SilentStepMonitor());
    }
View Full Code Here

      ExamplesTableFactory examplesTableFactory = new ExamplesTableFactory(new LocalizedKeywords(), new LoadFromClasspath(embeddableClass),
            parameterConverters);
      // add custom coverters
      parameterConverters.addConverters(new DateConverter(new SimpleDateFormat("yyyy-MM-dd")), new ExamplesTableConverter(
            examplesTableFactory));
      return new MostUsefulConfiguration()
            .useStoryLoader(new LoadFromClasspath(embeddableClass))
            .useStoryParser(new RegexStoryParser(examplesTableFactory))
            .useStoryReporterBuilder(
                  new StoryReporterBuilder().withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass)).withDefaultFormats()
                        .withFormats(CONSOLE, TXT, HTML, XML)).useParameterConverters(parameterConverters);
View Full Code Here

    StoryReporterBuilder reporterBuilder = new StoryReporterBuilder()
        .withCodeLocation(codeLocation)
        .withDefaultFormats()
        .withFormats(CONSOLE, TXT, HTML, XML);

    Configuration config = new MostUsefulConfiguration()
        .useStoryLoader(storyLoader)
        .useStoryReporterBuilder(reporterBuilder);

    return config;
  }
View Full Code Here

        configuredEmbedder().useMetaFilters(metaFilters());
    }

    @Override
    public Configuration configuration() {
        return new MostUsefulConfiguration()
            .useStoryParser(new RegexStoryParser(new ExamplesTableFactory(new LoadFromClasspath(this.getClass()))))
            .useStoryReporterBuilder(new StoryReporterBuilder()
                .withCodeLocation(CodeLocations.codeLocationFromClass(this.getClass())));
    }
View Full Code Here

    protected LocalStoryFinder createStoryPathFinder() {
        return new LocalStoryFinder(this.getClass());
    }

    protected Configuration createConfiguration() {
        final MostUsefulConfiguration config = (MostUsefulConfiguration) super
                .configuration();

        config.usePendingStepStrategy(new FailingUponPendingStep());
        config.storyReporterBuilder().withFormats(CONSOLE);

        return config;
    }
View Full Code Here

        return new LocalStoryFinder(this.getClass());
    }

    @Ensures("result != null")
    protected Configuration createConfiguration() {
        final MostUsefulConfiguration config = (MostUsefulConfiguration) super
                .configuration();

        config.usePendingStepStrategy(new FailingUponPendingStep());
        config.storyReporterBuilder().withFormats(CONSOLE);

        return config;
    }
View Full Code Here

    protected LocalStoryFinder createStoryPathFinder() {
        return new LocalStoryFinder(this.getClass());
    }

    protected Configuration createConfiguration() {
        final MostUsefulConfiguration config = (MostUsefulConfiguration) super
                .configuration();

        config.usePendingStepStrategy(new FailingUponPendingStep());
        config.storyReporterBuilder().withFormats(CONSOLE);

        return config;
    }
View Full Code Here

        return injectableStepsFactory;
    }

    @Override
    public Configuration configuration() {
        final MostUsefulConfiguration config = (MostUsefulConfiguration) super
                .configuration();

        config.usePendingStepStrategy(new FailingUponPendingStep());
        config.storyReporterBuilder().withFormats(CONSOLE);

        return config;
    }
View Full Code Here

TOP

Related Classes of org.jbehave.core.configuration.MostUsefulConfiguration

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.