|
47 | 47 | * Additional hints can be given to Cucumber by annotating the class with {@link CucumberOptions}.
|
48 | 48 | * <p>
|
49 | 49 | * Cucumber also supports JUnits {@link ClassRule}, {@link BeforeClass} and {@link AfterClass} annotations.
|
50 |
| - * These will executed before and after all scenarios. Using these is not recommended as it limits the portability |
| 50 | + * These will be executed before and after all scenarios. Using these is not recommended as it limits the portability |
51 | 51 | * between different runners; they may not execute correctly when using the commandline, IntelliJ IDEA or
|
52 | 52 | * Cucumber-Eclipse. Instead it is recommended to use Cucumbers `Before` and `After` hooks.
|
53 | 53 | *
|
@@ -75,34 +75,15 @@ public Cucumber(Class clazz) throws InitializationError, IOException {
|
75 | 75 | RuntimeOptions runtimeOptions = runtimeOptionsFactory.create();
|
76 | 76 |
|
77 | 77 | ResourceLoader resourceLoader = new MultiLoader(classLoader);
|
78 |
| - runtime = createRuntime(resourceLoader, classLoader, runtimeOptions); |
| 78 | + ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader); |
| 79 | + runtime = new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions); |
79 | 80 | formatter = runtimeOptions.formatter(classLoader);
|
80 | 81 | final JUnitOptions junitOptions = new JUnitOptions(runtimeOptions.getJunitOptions());
|
81 | 82 | final List<CucumberFeature> cucumberFeatures = runtimeOptions.cucumberFeatures(resourceLoader, runtime.getEventBus());
|
82 | 83 | jUnitReporter = new JUnitReporter(runtime.getEventBus(), runtimeOptions.isStrict(), junitOptions);
|
83 | 84 | addChildren(cucumberFeatures);
|
84 | 85 | }
|
85 | 86 |
|
86 |
| - /** |
87 |
| - * Create the Runtime. Can be overridden to customize the runtime or backend. |
88 |
| - * |
89 |
| - * @param resourceLoader used to load resources |
90 |
| - * @param classLoader used to load classes |
91 |
| - * @param runtimeOptions configuration |
92 |
| - * @return a new runtime |
93 |
| - * @throws InitializationError if a JUnit error occurred |
94 |
| - * @throws IOException if a class or resource could not be loaded |
95 |
| - * @deprecated Neither the runtime nor the backend or any of the classes involved in their construction are part of |
96 |
| - * the public API. As such they should not be exposed. The recommended way to observe the cucumber process is to |
97 |
| - * listen to events by using a plugin. For example the JSONFormatter. |
98 |
| - */ |
99 |
| - @Deprecated |
100 |
| - protected Runtime createRuntime(ResourceLoader resourceLoader, ClassLoader classLoader, |
101 |
| - RuntimeOptions runtimeOptions) throws InitializationError, IOException { |
102 |
| - ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader); |
103 |
| - return new Runtime(resourceLoader, classFinder, classLoader, runtimeOptions); |
104 |
| - } |
105 |
| - |
106 | 87 | @Override
|
107 | 88 | public List<FeatureRunner> getChildren() {
|
108 | 89 | return children;
|
|
0 commit comments