mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #19863 from izeye
* gh-19863: Fix TestFailuresPlugin.TestFailure.compareTo() Closes gh-19863
This commit is contained in:
commit
c1ebd5abb8
@ -56,7 +56,7 @@ public class TestFailuresPlugin implements Plugin<Project> {
|
||||
|
||||
private final class FailureRecordingTestListener implements TestListener {
|
||||
|
||||
private List<TestFailure> failures = new ArrayList<>();
|
||||
private final List<TestFailure> failures = new ArrayList<>();
|
||||
|
||||
private final TestResultsExtension testResults;
|
||||
|
||||
@ -106,7 +106,7 @@ public class TestFailuresPlugin implements Plugin<Project> {
|
||||
public int compareTo(TestFailure other) {
|
||||
int comparison = this.descriptor.getClassName().compareTo(other.descriptor.getClassName());
|
||||
if (comparison == 0) {
|
||||
comparison = this.descriptor.getName().compareTo(other.descriptor.getClassName());
|
||||
comparison = this.descriptor.getName().compareTo(other.descriptor.getName());
|
||||
}
|
||||
return comparison;
|
||||
}
|
||||
|
@ -22,9 +22,9 @@ import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.gradle.testkit.runner.BuildResult;
|
||||
import org.gradle.testkit.runner.GradleRunner;
|
||||
@ -169,17 +169,12 @@ class TestFailuresPluginIntegrationTests {
|
||||
}
|
||||
|
||||
private List<String> readLines(String output) {
|
||||
List<String> lines = new ArrayList<>();
|
||||
try (BufferedReader reader = new BufferedReader(new StringReader(output))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
lines.add(line);
|
||||
}
|
||||
return reader.lines().collect(Collectors.toList());
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
return lines;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user