##### Coverage Report - org.jbehave.core.junit.JUnitStory

Classes in this File | Line Coverage | Branch Coverage | Complexity
JUnitStory |
100% | 8/8
N/A | N/A
| 1.0;1

1 |  |
     package org.jbehave.core.junit;
2 |  |
3 |  |
     import org.jbehave.core.ConfigurableEmbedder;
4 |  |
     import org.jbehave.core.Embeddable;
5 |  |
     import org.jbehave.core.embedder.Embedder;
6 |  |
     import org.jbehave.core.io.StoryPathResolver;
7 |  |
     import org.junit.Test;
8 |  |
9 |  |
     import static java.util.Arrays.asList;
10 |  |
11 |  |
     /**
12 |  |
      * <p>
13 |  |
      * JUnit-runnable entry-point to run a single story specified by a {@link Embeddable} class.
14 |  |
      * </p>
15 |  |
      */
16 | 9 |
     public abstract class JUnitStory extends ConfigurableEmbedder {
17 |  |
18 |  |
             @Test
19 |  |
         public void run() throws Throwable {
20 | 3 |
             Embedder embedder = configuredEmbedder();
21 | 3 |
             StoryPathResolver pathResolver = embedder.configuration().storyPathResolver();
22 | 3 |
             String storyPath = pathResolver.resolve(this.getClass());
23 |  |
             try {
24 | 3 |
                 embedder.runStoriesAsPaths(asList(storyPath));
25 |  |
             } finally {
26 | 3 |
                 embedder.generateCrossReference();
27 | 3 |
             }
28 | 3 |
         }
29 |  |
30 |  |
     }