|
13 | 13 | import static gherkin.util.FixJava.join;
|
14 | 14 |
|
15 | 15 | public abstract class CucumberTagStatement extends StepContainer {
|
16 |
| - final TagStatement tagStatement; |
| 16 | + private final TagStatement gherkinModel; |
17 | 17 | private final String visualName;
|
18 | 18 |
|
19 |
| - CucumberTagStatement(CucumberFeature cucumberFeature, TagStatement tagStatement) { |
20 |
| - super(cucumberFeature, tagStatement); |
21 |
| - this.tagStatement = tagStatement; |
22 |
| - this.visualName = tagStatement.getKeyword() + ": " + tagStatement.getName(); |
| 19 | + CucumberTagStatement(CucumberFeature cucumberFeature, TagStatement gherkinModel) { |
| 20 | + super(cucumberFeature, gherkinModel); |
| 21 | + this.gherkinModel = gherkinModel; |
| 22 | + this.visualName = gherkinModel.getKeyword() + ": " + gherkinModel.getName(); |
23 | 23 | }
|
24 | 24 |
|
25 |
| - CucumberTagStatement(CucumberFeature cucumberFeature, TagStatement tagStatement, Row example) { |
26 |
| - super(cucumberFeature, tagStatement); |
27 |
| - this.tagStatement = tagStatement; |
| 25 | + CucumberTagStatement(CucumberFeature cucumberFeature, TagStatement gherkinModel, Row example) { |
| 26 | + super(cucumberFeature, gherkinModel); |
| 27 | + this.gherkinModel = gherkinModel; |
28 | 28 | this.visualName = "| " + join(example.getCells(), " | ") + " |";
|
29 | 29 | }
|
30 | 30 |
|
31 | 31 | protected Set<Tag> tagsAndInheritedTags() {
|
32 | 32 | Set<Tag> tags = new HashSet<Tag>();
|
33 |
| - tags.addAll(cucumberFeature.getFeature().getTags()); |
34 |
| - tags.addAll(tagStatement.getTags()); |
| 33 | + tags.addAll(cucumberFeature.getGherkinFeature().getTags()); |
| 34 | + tags.addAll(gherkinModel.getTags()); |
35 | 35 | return tags;
|
36 | 36 | }
|
37 | 37 |
|
38 | 38 | public String getVisualName() {
|
39 | 39 | return visualName;
|
40 | 40 | }
|
41 | 41 |
|
| 42 | + public TagStatement getGherkinModel() { |
| 43 | + return gherkinModel; |
| 44 | + } |
42 | 45 |
|
43 | 46 | public abstract void run(Formatter formatter, Reporter reporter, Runtime runtime);
|
44 | 47 | }
|
0 commit comments