Search in sources :

Example 51 with Embedder

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

the class ReportStepdocsAsEmbeddables method execute.

public void execute() throws BuildException {
    Embedder embedder = newEmbedder();
    log("Reporting stepdocs as embeddables using embedder " + embedder, MSG_INFO);
    embedder.reportStepdocsAsEmbeddables(classNames());
}
Also used : Embedder(org.jbehave.core.embedder.Embedder)

Example 52 with Embedder

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

the class RunStoriesAsPaths method execute.

public void execute() throws BuildException {
    Embedder embedder = newEmbedder();
    log("Running stories as paths using embedder " + embedder, MSG_INFO);
    embedder.runStoriesAsPaths(storyPaths());
}
Also used : Embedder(org.jbehave.core.embedder.Embedder)

Example 53 with Embedder

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

the class EmbedderTaskBehaviour method shouldAllowSpecificationOfInjectableEmbedderClass.

@Test
public void shouldAllowSpecificationOfInjectableEmbedderClass() {
    // Given
    AbstractEmbedderTask task = new AbstractEmbedderTask() {
    };
    // When
    task.setInjectableEmbedderClass(MyInjectableEmbedder.class.getName());
    Embedder embedder = task.newEmbedder();
    // Then
    assertThat(embedder.getClass().getName(), equalTo(MyEmbedder.class.getName()));
}
Also used : Embedder(org.jbehave.core.embedder.Embedder) InjectableEmbedder(org.jbehave.core.InjectableEmbedder) Test(org.junit.Test)

Example 54 with Embedder

use of org.jbehave.core.embedder.Embedder 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)

Example 55 with Embedder

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

the class CoreStoryRunner method runURLLoadedStoriesAsJUnit.

@Test
public void runURLLoadedStoriesAsJUnit() {
    // Embedder defines the configuration and candidate steps
    Embedder embedder = new URLCoreEmbedder();
    String codeLocation = codeLocationFromClass(this.getClass()).getFile();
    List<String> storyPaths = new StoryFinder().findPaths(codeLocation, asList("**/trader_is_alerted_of_status.story", "**/traders_can_be_searched.story"), null, "file:" + codeLocation);
    embedder.runStoriesAsPaths(storyPaths);
}
Also used : StoryFinder(org.jbehave.core.io.StoryFinder) Embedder(org.jbehave.core.embedder.Embedder) Test(org.junit.Test)

Aggregations

Embedder (org.jbehave.core.embedder.Embedder)56 Test (org.junit.Test)33 InjectableEmbedder (org.jbehave.core.InjectableEmbedder)25 ConfigurableEmbedder (org.jbehave.core.ConfigurableEmbedder)10 MojoFailureException (org.apache.maven.plugin.MojoFailureException)8 EmbedderControls (org.jbehave.core.embedder.EmbedderControls)7 Configuration (org.jbehave.core.configuration.Configuration)6 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)6 File (java.io.File)5 Properties (java.util.Properties)5 Matchers.containsString (org.hamcrest.Matchers.containsString)5 UsingEmbedder (org.jbehave.core.annotations.UsingEmbedder)5 CandidateSteps (org.jbehave.core.steps.CandidateSteps)5 StoryPathResolver (org.jbehave.core.io.StoryPathResolver)4 HashSet (java.util.HashSet)3 Artifact (org.apache.maven.artifact.Artifact)3 Build (org.apache.maven.model.Build)3 MavenProject (org.apache.maven.project.MavenProject)3 ArchiverManager (org.codehaus.plexus.archiver.manager.ArchiverManager)3 StoryFinder (org.jbehave.core.io.StoryFinder)3