| 1 | |
package org.jbehave.mojo; |
| 2 | |
|
| 3 | |
import org.apache.maven.plugin.MojoExecutionException; |
| 4 | |
import org.apache.maven.plugin.MojoFailureException; |
| 5 | |
import org.jbehave.core.embedder.Embedder; |
| 6 | |
import org.jbehave.core.junit.AnnotatedEmbedderRunner; |
| 7 | |
import org.junit.runner.RunWith; |
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | 2 | public class RunStoriesWithAnnotatedEmbedderRunner extends AbstractEmbedderMojo { |
| 16 | |
|
| 17 | |
public void execute() throws MojoExecutionException, MojoFailureException { |
| 18 | 2 | Embedder embedder = newEmbedder(); |
| 19 | 2 | getLog().info("Running stories with annotated embedder runner"); |
| 20 | |
try { |
| 21 | 2 | embedder.runStoriesWithAnnotatedEmbedderRunner(classNames()); |
| 22 | 1 | } catch (RuntimeException e) { |
| 23 | 1 | throw new MojoFailureException("Failed to run stories with annotated embedder runner", e); |
| 24 | 1 | } |
| 25 | |
|
| 26 | 1 | } |
| 27 | |
|
| 28 | |
} |