Search in sources :

Example 6 with EmbedderControls

use of org.jbehave.core.embedder.EmbedderControls in project jbehave-core by jbehave.

the class AnnotationBuilderBehaviour method shouldBuildEmbedderWithAnnotatedControls.

@Test
public void shouldBuildEmbedderWithAnnotatedControls() {
    AnnotationBuilder annotated = new AnnotationBuilder(AnnotedEmbedderControls.class);
    EmbedderControls embedderControls = annotated.buildEmbedder().embedderControls();
    assertThat(embedderControls.batch(), is(true));
    assertThat(embedderControls.generateViewAfterStories(), is(true));
    assertThat(embedderControls.ignoreFailureInStories(), is(true));
    assertThat(embedderControls.ignoreFailureInView(), is(true));
    assertThat(embedderControls.skip(), is(true));
    assertThat(embedderControls.storyTimeouts(), equalTo("**/longs/*.story:60,**/shorts/*.story:10"));
    assertThat(embedderControls.failOnStoryTimeout(), is(true));
    assertThat(embedderControls.threads(), equalTo(2));
    assertThat(embedderControls.verboseFailures(), is(true));
    assertThat(embedderControls.verboseFiltering(), is(true));
}
Also used : EmbedderControls(org.jbehave.core.embedder.EmbedderControls) Test(org.junit.Test)

Example 7 with EmbedderControls

use of org.jbehave.core.embedder.EmbedderControls in project jbehave-core by jbehave.

the class EmbedderMojoBehaviour method shouldCreateNewEmbedderWithGivenControls.

@Test
public void shouldCreateNewEmbedderWithGivenControls() {
    // Given
    AbstractEmbedderMojo mojo = new AbstractEmbedderMojo() {

        public void execute() throws MojoExecutionException, MojoFailureException {
        }
    };
    // When
    mojo.batch = true;
    mojo.generateViewAfterStories = false;
    mojo.ignoreFailureInStories = true;
    mojo.ignoreFailureInView = true;
    mojo.skip = true;
    mojo.storyTimeouts = "**/longs/BddTest2Long.feature:7";
    mojo.failOnStoryTimeout = true;
    mojo.threads = 2;
    Embedder embedder = mojo.newEmbedder();
    // Then
    EmbedderControls embedderControls = embedder.embedderControls();
    assertThat(embedderControls.batch(), is(true));
    assertThat(embedderControls.generateViewAfterStories(), is(false));
    assertThat(embedderControls.ignoreFailureInStories(), is(true));
    assertThat(embedderControls.ignoreFailureInView(), is(true));
    assertThat(embedderControls.skip(), is(true));
    assertThat(embedderControls.storyTimeouts(), is("**/longs/BddTest2Long.feature:7"));
    assertThat(embedderControls.threads(), is(2));
}
Also used : Embedder(org.jbehave.core.embedder.Embedder) InjectableEmbedder(org.jbehave.core.InjectableEmbedder) EmbedderControls(org.jbehave.core.embedder.EmbedderControls) Test(org.junit.Test)

Example 8 with EmbedderControls

use of org.jbehave.core.embedder.EmbedderControls in project jbehave-core by jbehave.

the class EmbedderTaskBehaviour method shouldCreateNewEmbedderWithGivenControls.

@Test
public void shouldCreateNewEmbedderWithGivenControls() {
    // Given
    AbstractEmbedderTask task = new AbstractEmbedderTask() {
    };
    // When
    task.setBatch(true);
    task.setGenerateViewAfterStories(false);
    task.setIgnoreFailureInStories(true);
    task.setIgnoreFailureInView(true);
    task.setVerboseFailures(true);
    task.setVerboseFiltering(true);
    task.setSkip(true);
    task.setStoryTimeouts("**/shorts/BddShortTest.story:5");
    task.setFailOnStoryTimeout(true);
    task.setThreads(2);
    Embedder embedder = task.newEmbedder();
    // Then
    EmbedderControls embedderControls = embedder.embedderControls();
    assertThat(embedderControls.batch(), is(true));
    assertThat(embedderControls.generateViewAfterStories(), is(false));
    assertThat(embedderControls.ignoreFailureInStories(), is(true));
    assertThat(embedderControls.ignoreFailureInView(), is(true));
    assertThat(embedderControls.verboseFailures(), is(true));
    assertThat(embedderControls.verboseFiltering(), is(true));
    assertThat(embedderControls.skip(), is(true));
    assertThat(embedderControls.storyTimeouts(), equalTo("**/shorts/BddShortTest.story:5"));
    assertThat(embedderControls.failOnStoryTimeout(), is(true));
    assertThat(embedderControls.threads(), equalTo(2));
}
Also used : Embedder(org.jbehave.core.embedder.Embedder) InjectableEmbedder(org.jbehave.core.InjectableEmbedder) EmbedderControls(org.jbehave.core.embedder.EmbedderControls) Test(org.junit.Test)

Aggregations

EmbedderControls (org.jbehave.core.embedder.EmbedderControls)8 Embedder (org.jbehave.core.embedder.Embedder)7 Test (org.junit.Test)5 InjectableEmbedder (org.jbehave.core.InjectableEmbedder)4 FileNotFoundException (java.io.FileNotFoundException)2 Configuration (org.jbehave.core.configuration.Configuration)2 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)2 SilentlyAbsorbingFailure (org.jbehave.core.failures.SilentlyAbsorbingFailure)2 LoadFromClasspath (org.jbehave.core.io.LoadFromClasspath)2 StoryReporterBuilder (org.jbehave.core.reporters.StoryReporterBuilder)2 InstanceStepsFactory (org.jbehave.core.steps.InstanceStepsFactory)2 MarkUnmatchedStepsAsPending (org.jbehave.core.steps.MarkUnmatchedStepsAsPending)2 StepFinder (org.jbehave.core.steps.StepFinder)2 ByLevenshteinDistance (org.jbehave.core.steps.StepFinder.ByLevenshteinDistance)2 IOException (java.io.IOException)1 Properties (java.util.Properties)1 ConfigurableEmbedder (org.jbehave.core.ConfigurableEmbedder)1 UsingEmbedder (org.jbehave.core.annotations.UsingEmbedder)1