Skip to content

Commit d10d466

Browse files
committed
fix(deps): update dependency io.cucumber:query to v13.0.1
1 parent 51b3f4a commit d10d466

File tree

5 files changed

+13
-44
lines changed

5 files changed

+13
-44
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Changed
10+
- Update dependency io.cucumber:query to v13.0.1
911

1012
## [0.2.0] - 2024-06-22
1113
### Added

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<dependency>
5757
<groupId>io.cucumber</groupId>
5858
<artifactId>query</artifactId>
59-
<version>[12.2.0,13.0.0)</version>
59+
<version>[13.0.1,14.0.0)</version>
6060
</dependency>
6161

6262
<dependency>

java/src/main/java/io/cucumber/testngxmlformatter/XmlReportData.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.time.Instant;
2020
import java.time.format.DateTimeFormatter;
2121
import java.util.AbstractMap.SimpleEntry;
22+
import java.util.EnumMap;
2223
import java.util.List;
2324
import java.util.Locale;
2425
import java.util.Map;
@@ -55,7 +56,7 @@ long getDurationInMilliSeconds(TestCaseStarted testCaseStarted) {
5556
.toMillis();
5657
}
5758

58-
Map<TestStepResultStatus, Long> getTestCaseStatusCounts() {
59+
EnumMap<TestStepResultStatus, Long> getTestCaseStatusCounts() {
5960
return query.countMostSevereTestStepResultStatus();
6061
}
6162

@@ -116,7 +117,7 @@ Set<Entry<Optional<Feature>, List<TestCaseStarted>>> getAllTestCaseStartedGroupe
116117
private static final TestStepResult SCENARIO_WITH_NO_STEPS = new TestStepResult(ZERO_DURATION, null, PASSED, null);
117118

118119
TestStepResult getTestCaseStatus(TestCaseStarted testCaseStarted) {
119-
return query.findMostSevereTestStepResulBy(testCaseStarted)
120+
return query.findMostSevereTestStepResultBy(testCaseStarted)
120121
.orElse(SCENARIO_WITH_NO_STEPS);
121122
}
122123

java/src/main/java/io/cucumber/testngxmlformatter/XmlReportWriter.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import javax.xml.stream.XMLOutputFactory;
1010
import javax.xml.stream.XMLStreamException;
1111
import java.io.Writer;
12+
import java.util.EnumMap;
1213
import java.util.EnumSet;
1314
import java.util.List;
1415
import java.util.Map;
@@ -46,16 +47,16 @@ private void writeTestngResults(EscapingXmlStreamWriter writer) throws XMLStream
4647
}
4748

4849
private void writeTestngResultsAttributes(EscapingXmlStreamWriter writer) throws XMLStreamException {
49-
Map<TestStepResultStatus, Long> counts = data.getTestCaseStatusCounts();
50+
EnumMap<TestStepResultStatus, Long> counts = data.getTestCaseStatusCounts();
5051

5152
writer.writeAttribute("failed", String.valueOf(countFailures(counts)));
52-
writer.writeAttribute("passed", counts.getOrDefault(PASSED, 0L).toString());
53-
writer.writeAttribute("skipped", counts.getOrDefault(SKIPPED, 0L).toString());
53+
writer.writeAttribute("passed", counts.get(PASSED).toString());
54+
writer.writeAttribute("skipped", counts.get(SKIPPED).toString());
5455
writer.writeAttribute("total", String.valueOf(data.getTestCaseCount()));
5556
}
5657

57-
private static long countFailures(Map<TestStepResultStatus, Long> counts) {
58-
return createNotPassedNotSkippedSet().stream().mapToLong(s -> counts.getOrDefault(s, 0L)).sum();
58+
private static long countFailures(EnumMap<TestStepResultStatus, Long> counts) {
59+
return createNotPassedNotSkippedSet().stream().mapToLong(counts::get).sum();
5960
}
6061

6162
private static EnumSet<TestStepResultStatus> createNotPassedNotSkippedSet() {

testdata/retry.feature.xml

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<testng-results failed="7" passed="3" skipped="0" total="10">
2+
<testng-results failed="2" passed="3" skipped="0" total="5">
33
<suite name="Cucumber" duration-ms="41">
44
<test name="Cucumber" duration-ms="41">
55
<class name="Retry">
66
<test-method name="Test cases that pass aren't retried" status="PASS" duration-ms="3" started-at="1970-01-01T00:00:00.001Z" finished-at="1970-01-01T00:00:00.004Z"/>
7-
<test-method name="Test cases that fail are retried if within the --retry limit" status="FAIL" duration-ms="3" started-at="1970-01-01T00:00:00.005Z" finished-at="1970-01-01T00:00:00.008Z">
8-
<exception class="Error">
9-
<message><![CDATA[
10-
Given a step that passes the second time....................................failed
11-
]]></message>
12-
</exception>
13-
</test-method>
147
<test-method name="Test cases that fail are retried if within the --retry limit" status="PASS" duration-ms="3" started-at="1970-01-01T00:00:00.009Z" finished-at="1970-01-01T00:00:00.012Z"/>
15-
<test-method name="Test cases that fail will continue to retry up to the --retry limit" status="FAIL" duration-ms="3" started-at="1970-01-01T00:00:00.013Z" finished-at="1970-01-01T00:00:00.016Z">
16-
<exception class="Error">
17-
<message><![CDATA[
18-
Given a step that passes the third time.....................................failed
19-
]]></message>
20-
</exception>
21-
</test-method>
22-
<test-method name="Test cases that fail will continue to retry up to the --retry limit" status="FAIL" duration-ms="3" started-at="1970-01-01T00:00:00.017Z" finished-at="1970-01-01T00:00:00.020Z">
23-
<exception class="Error">
24-
<message><![CDATA[
25-
Given a step that passes the third time.....................................failed
26-
]]></message>
27-
</exception>
28-
</test-method>
298
<test-method name="Test cases that fail will continue to retry up to the --retry limit" status="PASS" duration-ms="3" started-at="1970-01-01T00:00:00.021Z" finished-at="1970-01-01T00:00:00.024Z"/>
30-
<test-method name="Test cases won't retry after failing more than the --retry limit" status="FAIL" duration-ms="3" started-at="1970-01-01T00:00:00.025Z" finished-at="1970-01-01T00:00:00.028Z">
31-
<exception class="Error">
32-
<message><![CDATA[
33-
Given a step that always fails..............................................failed
34-
]]></message>
35-
</exception>
36-
</test-method>
37-
<test-method name="Test cases won't retry after failing more than the --retry limit" status="FAIL" duration-ms="3" started-at="1970-01-01T00:00:00.029Z" finished-at="1970-01-01T00:00:00.032Z">
38-
<exception class="Error">
39-
<message><![CDATA[
40-
Given a step that always fails..............................................failed
41-
]]></message>
42-
</exception>
43-
</test-method>
449
<test-method name="Test cases won't retry after failing more than the --retry limit" status="FAIL" duration-ms="3" started-at="1970-01-01T00:00:00.033Z" finished-at="1970-01-01T00:00:00.036Z">
4510
<exception class="Error">
4611
<message><![CDATA[

0 commit comments

Comments
 (0)