Skip to content

Commit 5f012ef

Browse files
committed
Modified test files to reflect new filtering rules
1 parent 721583b commit 5f012ef

File tree

5 files changed

+10
-17
lines changed

5 files changed

+10
-17
lines changed

src/main/java/com/pdsl/gherkin/executors/GherkinTestExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.net.URI;
2929
import java.nio.charset.StandardCharsets;
3030
import java.util.Collection;
31+
import java.util.List;
3132
import java.util.Optional;
3233
import java.util.Set;
3334

@@ -41,7 +42,7 @@ public class GherkinTestExecutor implements TraceableTestRunExecutor {
4142
private final GherkinTestSpecificationFactory testSpecificationFactory;
4243
private final TestCaseFactory testCaseFactory = new PreorderTestCaseFactory();
4344
private final Logger logger = LoggerFactory.getLogger(GherkinTestExecutor.class);
44-
private final TraceableTestRunExecutor executor = new DefaultPolymorphicDslTestExecutor();
45+
private final TraceableTestRunExecutor executor = DefaultPolymorphicDslTestExecutor.of(List.of());
4546

4647
public <SG extends Parser, SL extends Lexer> GherkinTestExecutor(Class<SG> subgrammarParser, Class<SL> subgrammarLexer) {
4748
phraseFilter = new DefaultPolymorphicDslPhraseFilter(subgrammarParser, subgrammarLexer);

src/main/java/com/pdsl/gherkin/models/GherkinFeature.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ public static class Builder {
7171
private List<GherkinScenario> gherkinScenarios = new ArrayList<>();
7272
private List<GherkinRule> rules = new ArrayList<>();
7373
private Optional<List<String>> tags = Optional.empty();
74-
private int lineNumber = -1;
75-
private int linePosition = -1;
7674

77-
private static final String LOCATION_ERROR = "Location cannot be null!";
75+
private static final String LOCATION_ERROR = "Location cannot be null!";
7876
public Builder(URI location) {
7977

8078
Preconditions.checkArgument(location == null, LOCATION_ERROR);
@@ -98,16 +96,6 @@ public GherkinFeature build() {
9896
return new GherkinFeature(this);
9997
}
10098

101-
public Builder withLineNumber(int lineNumber) {
102-
this.lineNumber = lineNumber;
103-
return this;
104-
}
105-
106-
public Builder withLinePosition(int linePosition) {
107-
this.linePosition = linePosition;
108-
return this;
109-
}
110-
11199
public Builder addScenario(GherkinScenario scenario) {
112100
gherkinScenarios.add(scenario);
113101
return this;

src/test/java/com/pdsl/api/GherkinPolymorphicDslTestExecutor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public void minimalFeature_runsAllTests() {
6565
assertThat(stepCounterListener.getStepsInOrderRun().poll().strip()).isEqualTo("Given the minimalism inside a background");
6666
assertThat(stepCounterListener.getStepsInOrderRun().poll().strip()).isEqualTo("Given the minimalism");
6767

68+
assertThat(stepCounterListener.getStepsInOrderRun().poll().strip()).isEqualTo("Given the minimalism inside a background");
69+
assertThat(stepCounterListener.getStepsInOrderRun().poll().strip()).isEqualTo("Given the minimalism");
70+
6871
assertThat(stepCounterListener.getStepsInOrderRun().poll().strip()).isEqualTo("Given the minimalism inside a background");
6972
assertThat(stepCounterListener.getStepsInOrderRun().poll().strip()).isEqualTo("Given a rule background step");
7073
assertThat(stepCounterListener.getStepsInOrderRun().poll().strip()).isEqualTo("Given the 1 minimalism");

src/test/java/com/pdsl/api/PolymorphicDslGherkinExecution.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ public void gherkinTestSpecification_executesComplexBackgroundFeatureProperly()
184184
assertThat(stepCounterListener.getStepsInOrderRun().poll()).contains("Given the minimalism inside a background");
185185
assertThat(stepCounterListener.getStepsInOrderRun().poll()).contains("Given the minimalism");
186186

187+
assertThat(stepCounterListener.getStepsInOrderRun().poll()).contains("Given the minimalism inside a background");
188+
assertThat(stepCounterListener.getStepsInOrderRun().poll()).contains("Given the minimalism");
189+
187190
assertThat(stepCounterListener.getStepsInOrderRun().poll()).contains("Given the minimalism inside a background");
188191
assertThat(stepCounterListener.getStepsInOrderRun().poll()).contains("Given a rule background step");
189192
assertThat(stepCounterListener.getStepsInOrderRun().poll()).contains("Given the 1 minimalism");

src/test/java/com/pdsl/component/FrameworkTestCase.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ public void longFeatureFiles_haveLineNumbersMappedToScenarios() throws URISyntax
8787
AllGrammarsLexer.class,
8888
"polymorphicDslAllRules"
8989
);
90-
GherkinTestExecutor gherkinTestExecutor = new GherkinTestExecutor(phraseFilter,
91-
// Disable printing because file is too long
92-
DefaultPolymorphicDslTestExecutor.ofWithoutDuplicateFiltering(List.of()));
90+
GherkinTestExecutor gherkinTestExecutor = new GherkinTestExecutor(phraseFilter);
9391
// Act
9492

9593
MetadataTestRunResults results = gherkinTestExecutor.runTestsWithMetadata(dslFiles, new TestCaseFactoryParserListenerImpl(), "Component");

0 commit comments

Comments
 (0)