Skip to content

Commit b5dabdf

Browse files
committed
[JENKINS-51645] Add support for claims plugin in xUnit
Use collection or pipepine is not able to construct the list
1 parent 33cac3a commit b5dabdf

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

src/main/java/org/jenkinsci/plugins/xunit/XUnitProcessor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.io.InputStream;
3131
import java.util.Arrays;
3232
import java.util.Collection;
33-
import java.util.Set;
3433
import java.util.UUID;
3534

3635
import javax.annotation.CheckForNull;
@@ -143,7 +142,7 @@ public XUnitProcessor(@Nonnull TestType[] tools,
143142
this.processorId = UUID.randomUUID().toString();
144143
}
145144

146-
public void process(Run<?, ?> build, FilePath workspace, TaskListener listener, Launcher launcher, @Nonnull Set<TestDataPublisher> testDataPublishers)
145+
public void process(Run<?, ?> build, FilePath workspace, TaskListener listener, Launcher launcher, @Nonnull Collection<TestDataPublisher> testDataPublishers)
147146
throws IOException, InterruptedException {
148147
logger = new XUnitLog(listener);
149148
logger.info("Starting to record.");
@@ -331,7 +330,7 @@ private TestResult recordTestResult(Run<?, ?> build,
331330
FilePath workspace,
332331
TaskListener listener,
333332
Launcher launcher,
334-
Set<TestDataPublisher> testDataPublishers) throws IOException, InterruptedException {
333+
Collection<TestDataPublisher> testDataPublishers) throws IOException, InterruptedException {
335334
TestResultAction existingAction = build.getAction(TestResultAction.class);
336335
final long buildTime = build.getTimestamp().getTimeInMillis();
337336
final long nowMaster = System.currentTimeMillis();

src/main/java/org/jenkinsci/plugins/xunit/XUnitPublisher.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626

2727
import java.io.IOException;
2828
import java.util.Arrays;
29+
import java.util.Collection;
2930
import java.util.Collections;
30-
import java.util.LinkedHashSet;
31-
import java.util.Set;
31+
import java.util.LinkedList;
3232

3333
import javax.annotation.CheckForNull;
3434
import javax.annotation.Nonnull;
@@ -37,8 +37,6 @@
3737
import org.jenkinsci.lib.dtkit.descriptor.TestTypeDescriptor;
3838
import org.jenkinsci.lib.dtkit.type.TestType;
3939
import org.jenkinsci.plugins.xunit.service.TransformerException;
40-
import org.jenkinsci.plugins.xunit.threshold.FailedThreshold;
41-
import org.jenkinsci.plugins.xunit.threshold.SkippedThreshold;
4240
import org.jenkinsci.plugins.xunit.threshold.XUnitThreshold;
4341
import org.jenkinsci.plugins.xunit.threshold.XUnitThresholdDescriptor;
4442
import org.kohsuke.stapler.DataBoundConstructor;
@@ -78,7 +76,7 @@ public class XUnitPublisher extends Recorder implements SimpleBuildStep {
7876
private XUnitThreshold[] thresholds;
7977
private int thresholdMode;
8078
private ExtraConfiguration extraConfiguration;
81-
private Set<TestDataPublisher> testDataPublishers;
79+
private Collection<TestDataPublisher> testDataPublishers;
8280

8381
@DataBoundConstructor
8482
public XUnitPublisher(@CheckForNull TestType[] tools, @CheckForNull XUnitThreshold[] thresholds, int thresholdMode, @CheckForNull String testTimeMargin) {
@@ -126,7 +124,7 @@ public ExtraConfiguration getExtraConfiguration() {
126124
return extraConfiguration;
127125
}
128126

129-
public @Nonnull Set<TestDataPublisher> getTestDataPublishers() {
127+
public @Nonnull Collection<TestDataPublisher> getTestDataPublishers() {
130128
return testDataPublishers;
131129
}
132130

@@ -139,10 +137,10 @@ public ExtraConfiguration getExtraConfiguration() {
139137
* publisher
140138
*/
141139
@DataBoundSetter
142-
public void setTestDataPublishers(@CheckForNull Set<TestDataPublisher> testDataPublishers) {
140+
public void setTestDataPublishers(@CheckForNull Collection<TestDataPublisher> testDataPublishers) {
143141
this.testDataPublishers = testDataPublishers != null
144-
? new LinkedHashSet<>(testDataPublishers)
145-
: Collections.<TestDataPublisher> emptySet();
142+
? new LinkedList<>(testDataPublishers)
143+
: Collections.<TestDataPublisher> emptyList();
146144
}
147145

148146
@SuppressWarnings("deprecation")

0 commit comments

Comments
 (0)