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 | |
|
10 | |
|
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 | |
} |