Package org.jbehave.core.configuration

Examples of org.jbehave.core.configuration.MostUsefulConfiguration


public class MyStory extends JUnitStory {

    public MyStory() {
        // Making sure this doesn't output to the build while it's running
        useConfiguration(new MostUsefulConfiguration() {
            @Override
            public StoryReporter defaultStoryReporter() {
                return new TxtOutput(new PrintStream(new ByteArrayOutputStream()));
            }
        });
View Full Code Here


public abstract class MyPendingStory extends JUnitStory {

    public MyPendingStory() {
        // Making sure this doesn't output to the build while it's running
        useConfiguration(new MostUsefulConfiguration() {
            @Override
            public StoryReporter defaultStoryReporter() {
                return new TxtOutput(new PrintStream(new ByteArrayOutputStream()));
            }
        });
View Full Code Here

import org.jbehave.core.reporters.TxtOutput;

public abstract class MyMultipleStory extends JUnitStory {
  public MyMultipleStory() {
        // Making sure this doesn't output to the build while it's running
        useConfiguration(new MostUsefulConfiguration()
            .useStoryReporterBuilder(new StoryReporterBuilder(){
                    @Override
                    public StoryReporter build(String storyPath) {
                        return new TxtOutput(new PrintStream(new ByteArrayOutputStream()));
                    }               
View Full Code Here

        super(setUpInjectionProviders(JBehaveNeedleConfiguration.RESOURCE_JBEHAVE_NEEDLE));
        if (injectionProviders != null) {
            addInjectionProvider(toArray(injectionProviders));
        }
        if (this.configuration == null) {
            this.configuration = new MostUsefulConfiguration();
        } else {
            this.configuration = configuration;
        }
        this.steps = steps;
    }
View Full Code Here

public class GridStory extends JUnitStory {

    // Here we specify the configuration, starting from default MostUsefulConfiguration, and changing only what is needed
    @Override
    public Configuration configuration() {
        return new MostUsefulConfiguration()
            // where to find the stories
            .useStoryLoader(new LoadFromClasspath(this.getClass())) 
            // CONSOLE and TXT reporting
            .useStoryReporterBuilder(new StoryReporterBuilder().withDefaultFormats().withFormats(Format.CONSOLE, Format.TXT));
    }
View Full Code Here

    private void runStories(String... storyPaths) {
        StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withDefaultFormats()
                .withCodeLocation(CodeLocations.codeLocationFromClass(ReportTransformBehaviour.class))
                .withFormats(Format.XML);

        Configuration configuration = new MostUsefulConfiguration()
                .useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(storyReporterBuilder)
                .useFailureStrategy(new SilentlyAbsorbingFailure())
                .useStepCollector(new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance())));

        Embedder embedder = new Embedder();
View Full Code Here

    private void runStories(String... storyPaths) {
        StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withDefaultFormats()
                .withCodeLocation(CodeLocations.codeLocationFromClass(ReportTransformBehaviour.class))
                .withFormats(Format.XML);

        Configuration configuration = new MostUsefulConfiguration()
                .useStoryLoader(new LoadFromClasspath(this.getClass())).useStoryReporterBuilder(storyReporterBuilder)
                .useFailureStrategy(new SilentlyAbsorbingFailure())
                .useStepCollector(new MarkUnmatchedStepsAsPending(new StepFinder(new ByLevenshteinDistance())));

        Embedder embedder = new Embedder();
View Full Code Here

public class GoogleStories extends JUnitStories {

    @Override
    public Configuration configuration() {
        Class<? extends Embeddable> embeddableClass = this.getClass();
        return new MostUsefulConfiguration()
            .useStoryLoader(new LoadFromClasspath(embeddableClass))
            .useStoryReporterBuilder(new StoryReporterBuilder()
                .withCodeLocation(CodeLocations.codeLocationFromClass(embeddableClass))
                .withDefaultFormats()
                .withFormats(CONSOLE, HTML)
View Full Code Here

public class ScalaStepsFactoryBehaviour {

    @Test
    public void shouldCreateStepsInstancesFromScalaWhenAnnotated() {
        ScalaContext context = new ScalaContext("AnnotatedSteps", "NonAnnotatedSteps");
        ScalaStepsFactory factory = new ScalaStepsFactory(new MostUsefulConfiguration(), context);
        List<Class<?>> types = factory.stepsTypes();
        MatcherAssert.assertThat(types.size(), Matchers.equalTo(1));
        assertThat(types.get(0).getSimpleName(), equalTo("AnnotatedSteps"));
        Object object = factory.createInstanceOfType(context.newInstance("AnnotatedSteps").getClass());
        assertThat(object.getClass().getName(), equalTo("AnnotatedSteps"));
View Full Code Here

        assertThat(object.getClass().getName(), equalTo("AnnotatedSteps"));
    }

    @Test(expected = ScalaInstanceNotFound.class)
    public void shouldNotCreateStepsInstancesFromScalaWhenContextInvalid() {
        new ScalaStepsFactory(new MostUsefulConfiguration(), new ScalaContext("InexistentSteps"));
    }
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.