15
15
import cucumber .runtime .StepDefinitionMatch ;
16
16
import cucumber .runtime .UndefinedStepDefinitionMatch ;
17
17
import cucumber .runtime .UnreportedStepExecutor ;
18
+ import gherkin .events .PickleEvent ;
18
19
import gherkin .pickles .Argument ;
19
- import gherkin .pickles .Pickle ;
20
20
import gherkin .pickles .PickleLocation ;
21
21
import gherkin .pickles .PickleRow ;
22
22
import gherkin .pickles .PickleStep ;
@@ -73,7 +73,7 @@ public void runUnreportedStep(String featurePath, String language, String stepNa
73
73
match .runStep (language , null );
74
74
}
75
75
76
- public void runPickle (Pickle pickle , String language ) {
76
+ public void runPickle (PickleEvent pickle , String language ) {
77
77
buildBackendWorlds (); // Java8 step definitions will be added to the glue here
78
78
TestCase testCase = createTestCaseForPickle (pickle );
79
79
testCase .run (bus , language );
@@ -89,24 +89,24 @@ public void reportStepDefinitions(StepDefinitionReporter stepDefinitionReporter)
89
89
glue .reportStepDefinitions (stepDefinitionReporter );
90
90
}
91
91
92
- private TestCase createTestCaseForPickle (Pickle pickle ) {
92
+ private TestCase createTestCaseForPickle (PickleEvent pickleEvent ) {
93
93
List <TestStep > testSteps = new ArrayList <TestStep >();
94
94
if (!runtimeOptions .isDryRun ()) {
95
- addTestStepsForBeforeHooks (testSteps , pickle .getTags ());
95
+ addTestStepsForBeforeHooks (testSteps , pickleEvent . pickle .getTags ());
96
96
}
97
- addTestStepsForPickleSteps (testSteps , pickle );
97
+ addTestStepsForPickleSteps (testSteps , pickleEvent );
98
98
if (!runtimeOptions .isDryRun ()) {
99
- addTestStepsForAfterHooks (testSteps , pickle .getTags ());
99
+ addTestStepsForAfterHooks (testSteps , pickleEvent . pickle .getTags ());
100
100
}
101
- TestCase testCase = new TestCase (testSteps , pickle );
101
+ TestCase testCase = new TestCase (testSteps , pickleEvent );
102
102
return testCase ;
103
103
}
104
104
105
- private void addTestStepsForPickleSteps (List <TestStep > testSteps , Pickle pickle ) {
106
- for (PickleStep step : pickle .getSteps ()) {
105
+ private void addTestStepsForPickleSteps (List <TestStep > testSteps , PickleEvent pickleEvent ) {
106
+ for (PickleStep step : pickleEvent . pickle .getSteps ()) {
107
107
StepDefinitionMatch match ;
108
108
try {
109
- match = glue .stepDefinitionMatch (pickle . getLocations (). get ( 0 ). getPath () , step );
109
+ match = glue .stepDefinitionMatch (pickleEvent . uri , step );
110
110
if (match == null ) {
111
111
List <String > snippets = new ArrayList <String >();
112
112
for (Backend backend : backends ) {
@@ -120,9 +120,9 @@ private void addTestStepsForPickleSteps(List<TestStep> testSteps, Pickle pickle)
120
120
} catch (AmbiguousStepDefinitionsException e ) {
121
121
match = new AmbiguousStepDefinitionsMatch (step , e );
122
122
} catch (Throwable t ) {
123
- match = new FailedStepInstantiationMatch (step , t );
123
+ match = new FailedStepInstantiationMatch (pickleEvent . uri , step , t );
124
124
}
125
- testSteps .add (new PickleTestStep (step , match ));
125
+ testSteps .add (new PickleTestStep (pickleEvent . uri , step , match ));
126
126
}
127
127
}
128
128
0 commit comments