Package org.jbehave.mojo

Source Code of org.jbehave.mojo.RunStoriesWithAnnotatedEmbedderRunner

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);
        }

    }

}
TOP

Related Classes of org.jbehave.mojo.RunStoriesWithAnnotatedEmbedderRunner

TOP
Copyright © 2018 www.massapi.com. 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.