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

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

1 |  |
     package org.jbehave.core.junit;
2 |  |
3 |  |
     import org.jbehave.core.configuration.AnnotationBuilder;
4 |  |
     import org.junit.runner.Runner;
5 |  |
     import org.junit.runners.BlockJUnit4ClassRunner;
6 |  |
     import org.junit.runners.model.InitializationError;
7 |  |
8 |  |
     /**
9 |  |
      * A JUnit {@link Runner} that uses the {@link AnnotationBuilder} to
10 |  |
      * create an embeddable test instance.
11 |  |
      */
12 |  |
     public class AnnotatedEmbedderRunner extends BlockJUnit4ClassRunner {
13 |  |
14 |  |
         public AnnotatedEmbedderRunner(Class<?> testClass) throws InitializationError {
15 | 3 |
             super(testClass);
16 | 3 |
         }
17 |  |
18 |  |
         @Override
19 |  |
         public Object createTest() {
20 | 3 |
             return annotationBuilder().embeddableInstance();
21 |  |
         }
22 |  |
23 |  |
         public AnnotationBuilder annotationBuilder() {
24 | 3 |
             return new AnnotationBuilder(testClass());
25 |  |
         }
26 |  |
27 |  |
         protected Class<?> testClass() {
28 | 3 |
             return getTestClass().getJavaClass();
29 |  |
         }
30 |  |
31 |  |
     }