##### Coverage Report - org.jbehave.mojo.RunStoriesWithAnnotatedEmbedderRunner

Classes in this File | Line Coverage | Branch Coverage | Complexity
RunStoriesWithAnnotatedEmbedderRunner |
100% | 8/8
N/A | N/A
| 3.0;3

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 |  |
      * Mojo that runs stories with {@link AnnotatedEmbedderRunner}, equivalent to
11 |  |
      * execution via JUnit's {@link RunWith}.
12 |  |
      *
13 |  |
      * @goal run-stories-with-annotated-embedder
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 |  |
     }