Skip to content

Commit 1cc955a

Browse files
Adopt compatibility-kit 20 (#3043)
Co-authored-by: M.P. Korstanje <[email protected]>
1 parent 12776a5 commit 1cc955a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+629
-633
lines changed

compatibility/src/test/java/io/cucumber/compatibility/CompatibilityTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ void produces_expected_output_for(TestCase testCase) throws IOException {
4343
Runtime.builder()
4444
.withRuntimeOptions(new RuntimeOptionsBuilder()
4545
.addGlue(testCase.getGlue())
46-
.addFeature(testCase.getFeature())
47-
.build())
46+
.addFeature(testCase.getFeatures()).build())
4847
.withAdditionalPlugins(
4948
new MessageFormatter(newOutputStream(outputNdjson)))
5049
.build()

compatibility/src/test/java/io/cucumber/compatibility/TestCase.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,21 @@
1616

1717
final class TestCase {
1818

19-
private static final String FEATURES_DIRECTORY = "src/test/resources/features";
19+
private static final Path FEATURES_DIRECTORY = Paths.get("src/test/resources/features");
2020
private static final String FEATURES_PACKAGE = "io.cucumber.compatibility";
2121

22-
private final String packageName;
2322
private final String id;
2423

25-
private TestCase(String packageName, String id) {
26-
this.packageName = packageName;
24+
private TestCase(String id) {
2725
this.id = id;
2826
}
2927

3028
static List<TestCase> testCases() throws IOException {
3129
List<TestCase> testCases = new ArrayList<>();
32-
Path dir = Paths.get(FEATURES_DIRECTORY);
33-
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
30+
try (DirectoryStream<Path> stream = Files.newDirectoryStream(FEATURES_DIRECTORY)) {
3431
for (Path path : stream) {
3532
if (path.toFile().isDirectory()) {
36-
String id = path.getFileName().toString();
37-
testCases.add(new TestCase(id.replace("-", ""), id));
33+
testCases.add(new TestCase(path.getFileName().toString()));
3834
}
3935
}
4036
}
@@ -47,15 +43,15 @@ String getId() {
4743
}
4844

4945
URI getGlue() {
50-
return GluePath.parse(FEATURES_PACKAGE + "." + packageName);
46+
return GluePath.parse(FEATURES_PACKAGE + "." + id.replace("-", ""));
5147
}
5248

53-
FeatureWithLines getFeature() {
54-
return FeatureWithLines.parse("file:" + FEATURES_DIRECTORY + "/" + id + "/" + id + ".feature");
49+
FeatureWithLines getFeatures() {
50+
return FeatureWithLines.parse("file:" + FEATURES_DIRECTORY + "/" + id);
5551
}
5652

5753
Path getExpectedFile() {
58-
return Paths.get(FEATURES_DIRECTORY + "/" + id + "/" + id + ".feature.ndjson");
54+
return Paths.get(FEATURES_DIRECTORY + "/" + id + "/" + id + ".ndjson");
5955
}
6056

6157
@Override

compatibility/src/test/resources/features/attachments/attachments.feature.ndjson

Lines changed: 0 additions & 61 deletions
This file was deleted.

compatibility/src/test/resources/features/attachments/attachments.ndjson

Lines changed: 61 additions & 0 deletions
Large diffs are not rendered by default.

compatibility/src/test/resources/features/cdata/cdata.feature.ndjson

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{"meta":{"protocolVersion":"28.0.0","implementation":{"name":"fake-cucumber","version":"123.45.6"},"cpu":{"name":"arm64"},"os":{"name":"darwin","version":"24.5.0"},"runtime":{"name":"Node.js","version":"24.4.1"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber-ltd/shouty.rb/actions/runs/154666429","buildNumber":"154666429","git":{"revision":"99684bcacf01d95875834d87903dcb072306c9ad","remote":"https://github.com/cucumber-ltd/shouty.rb.git","branch":"main"}}}}
2+
{"source":{"data":"Feature: cdata\n Cucumber xml formatters should be able to handle xml cdata elements.\n\n Scenario: cdata\n Given I have 42 <![CDATA[cukes]]> in my belly\n","uri":"samples/cdata/cdata.feature","mediaType":"text/x.cucumber.gherkin+plain"}}
3+
{"gherkinDocument":{"feature":{"tags":[],"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"cdata","description":" Cucumber xml formatters should be able to handle xml cdata elements.","children":[{"scenario":{"id":"1","tags":[],"location":{"line":4,"column":3},"keyword":"Scenario","name":"cdata","description":"","steps":[{"id":"0","location":{"line":5,"column":5},"keyword":"Given ","keywordType":"Context","text":"I have 42 <![CDATA[cukes]]> in my belly"}],"examples":[]}}]},"comments":[],"uri":"samples/cdata/cdata.feature"}}
4+
{"pickle":{"id":"3","uri":"samples/cdata/cdata.feature","astNodeIds":["1"],"tags":[],"name":"cdata","language":"en","steps":[{"id":"2","text":"I have 42 <![CDATA[cukes]]> in my belly","type":"Context","astNodeIds":["0"]}]}}
5+
{"stepDefinition":{"id":"4","pattern":{"type":"CUCUMBER_EXPRESSION","source":"I have {int} <![CDATA[cukes]]> in my belly"},"sourceReference":{"uri":"samples/cdata/cdata.ts","location":{"line":3}}}}
6+
{"testRunStarted":{"id":"5","timestamp":{"seconds":0,"nanos":0}}}
7+
{"testCase":{"id":"6","pickleId":"3","testSteps":[{"id":"7","pickleStepId":"2","stepDefinitionIds":["4"],"stepMatchArgumentsLists":[{"stepMatchArguments":[{"group":{"start":7,"value":"42","children":[]},"parameterTypeName":"int"}]}]}],"testRunStartedId":"5"}}
8+
{"testCaseStarted":{"id":"8","testCaseId":"6","timestamp":{"seconds":0,"nanos":1000000},"attempt":0}}
9+
{"testStepStarted":{"testCaseStartedId":"8","testStepId":"7","timestamp":{"seconds":0,"nanos":2000000}}}
10+
{"testStepFinished":{"testCaseStartedId":"8","testStepId":"7","testStepResult":{"status":"PASSED","duration":{"seconds":0,"nanos":1000000}},"timestamp":{"seconds":0,"nanos":3000000}}}
11+
{"testCaseFinished":{"testCaseStartedId":"8","timestamp":{"seconds":0,"nanos":4000000},"willBeRetried":false}}
12+
{"testRunFinished":{"testRunStartedId":"5","timestamp":{"seconds":0,"nanos":5000000},"success":true}}

compatibility/src/test/resources/features/data-tables/data-tables.feature.ndjson

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{"meta":{"protocolVersion":"28.0.0","implementation":{"name":"fake-cucumber","version":"123.45.6"},"cpu":{"name":"arm64"},"os":{"name":"darwin","version":"24.5.0"},"runtime":{"name":"Node.js","version":"24.4.1"},"ci":{"name":"GitHub Actions","url":"https://github.com/cucumber-ltd/shouty.rb/actions/runs/154666429","buildNumber":"154666429","git":{"revision":"99684bcacf01d95875834d87903dcb072306c9ad","remote":"https://github.com/cucumber-ltd/shouty.rb.git","branch":"main"}}}}
2+
{"source":{"data":"Feature: Data Tables\n Data Tables can be placed underneath a step and will be passed as the last\n argument to the step definition.\n\n They can be used to represent richer data structures, and can be transformed to other data-types.\n\n Scenario: transposed table\n When the following table is transposed:\n | a | b |\n | 1 | 2 |\n Then it should be:\n | a | 1 |\n | b | 2 |\n","uri":"samples/data-tables/data-tables.feature","mediaType":"text/x.cucumber.gherkin+plain"}}
3+
{"gherkinDocument":{"feature":{"tags":[],"location":{"line":1,"column":1},"language":"en","keyword":"Feature","name":"Data Tables","description":" Data Tables can be placed underneath a step and will be passed as the last\n argument to the step definition.\n\n They can be used to represent richer data structures, and can be transformed to other data-types.","children":[{"scenario":{"id":"6","tags":[],"location":{"line":7,"column":3},"keyword":"Scenario","name":"transposed table","description":"","steps":[{"id":"2","location":{"line":8,"column":5},"keyword":"When ","keywordType":"Action","text":"the following table is transposed:","dataTable":{"location":{"line":9,"column":7},"rows":[{"id":"0","location":{"line":9,"column":7},"cells":[{"location":{"line":9,"column":9},"value":"a"},{"location":{"line":9,"column":13},"value":"b"}]},{"id":"1","location":{"line":10,"column":7},"cells":[{"location":{"line":10,"column":9},"value":"1"},{"location":{"line":10,"column":13},"value":"2"}]}]}},{"id":"5","location":{"line":11,"column":5},"keyword":"Then ","keywordType":"Outcome","text":"it should be:","dataTable":{"location":{"line":12,"column":7},"rows":[{"id":"3","location":{"line":12,"column":7},"cells":[{"location":{"line":12,"column":9},"value":"a"},{"location":{"line":12,"column":13},"value":"1"}]},{"id":"4","location":{"line":13,"column":7},"cells":[{"location":{"line":13,"column":9},"value":"b"},{"location":{"line":13,"column":13},"value":"2"}]}]}}],"examples":[]}}]},"comments":[],"uri":"samples/data-tables/data-tables.feature"}}
4+
{"pickle":{"id":"9","uri":"samples/data-tables/data-tables.feature","astNodeIds":["6"],"tags":[],"name":"transposed table","language":"en","steps":[{"id":"7","text":"the following table is transposed:","type":"Action","argument":{"dataTable":{"rows":[{"cells":[{"value":"a"},{"value":"b"}]},{"cells":[{"value":"1"},{"value":"2"}]}]}},"astNodeIds":["2"]},{"id":"8","text":"it should be:","type":"Outcome","argument":{"dataTable":{"rows":[{"cells":[{"value":"a"},{"value":"1"}]},{"cells":[{"value":"b"},{"value":"2"}]}]}},"astNodeIds":["5"]}]}}
5+
{"stepDefinition":{"id":"10","pattern":{"type":"CUCUMBER_EXPRESSION","source":"the following table is transposed:"},"sourceReference":{"uri":"samples/data-tables/data-tables.ts","location":{"line":4}}}}
6+
{"stepDefinition":{"id":"11","pattern":{"type":"CUCUMBER_EXPRESSION","source":"it should be:"},"sourceReference":{"uri":"samples/data-tables/data-tables.ts","location":{"line":8}}}}
7+
{"testRunStarted":{"id":"12","timestamp":{"seconds":0,"nanos":0}}}
8+
{"testCase":{"id":"13","pickleId":"9","testSteps":[{"id":"14","pickleStepId":"7","stepDefinitionIds":["10"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]},{"id":"15","pickleStepId":"8","stepDefinitionIds":["11"],"stepMatchArgumentsLists":[{"stepMatchArguments":[]}]}],"testRunStartedId":"12"}}
9+
{"testCaseStarted":{"id":"16","testCaseId":"13","timestamp":{"seconds":0,"nanos":1000000},"attempt":0}}
10+
{"testStepStarted":{"testCaseStartedId":"16","testStepId":"14","timestamp":{"seconds":0,"nanos":2000000}}}
11+
{"testStepFinished":{"testCaseStartedId":"16","testStepId":"14","testStepResult":{"status":"PASSED","duration":{"seconds":0,"nanos":1000000}},"timestamp":{"seconds":0,"nanos":3000000}}}
12+
{"testStepStarted":{"testCaseStartedId":"16","testStepId":"15","timestamp":{"seconds":0,"nanos":4000000}}}
13+
{"testStepFinished":{"testCaseStartedId":"16","testStepId":"15","testStepResult":{"status":"PASSED","duration":{"seconds":0,"nanos":1000000}},"timestamp":{"seconds":0,"nanos":5000000}}}
14+
{"testCaseFinished":{"testCaseStartedId":"16","timestamp":{"seconds":0,"nanos":6000000},"willBeRetried":false}}
15+
{"testRunFinished":{"testRunStartedId":"12","timestamp":{"seconds":0,"nanos":7000000},"success":true}}

compatibility/src/test/resources/features/empty/empty.feature.ndjson

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)