All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jbehave.mojo.RunStoriesWithAnnotatedEmbedderRunner Maven / Gradle / Ivy

There is a newer version: 5.2.0
Show newest version
package org.jbehave.mojo;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.jbehave.core.embedder.Embedder;
import org.jbehave.core.junit.AnnotatedEmbedderRunner;
import org.junit.runner.RunWith;

/**
 * Mojo that runs stories with {@link AnnotatedEmbedderRunner}, equivalent to
 * execution via JUnit's {@link RunWith}.
 * 
 * @goal run-stories-with-annotated-embedder
 */
public class RunStoriesWithAnnotatedEmbedderRunner extends AbstractEmbedderMojo {

    public void execute() throws MojoExecutionException, MojoFailureException {
        Embedder embedder = newEmbedder();
        getLog().info("Running stories with annotated embedder runner");
        try {
            embedder.runStoriesWithAnnotatedEmbedderRunner(classNames());
        } catch (RuntimeException e) {
            throw new MojoFailureException("Failed to run stories with annotated embedder runner", e);
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy