Skip to content

Commit

Permalink
Merge pull request #725 from JetBrains/refactor-junit-executor
Browse files Browse the repository at this point in the history
A tiny refactoring: use groupBy
  • Loading branch information
nikpachoo committed Apr 28, 2024
2 parents b3b7d96 + 27e54cf commit f18d9a8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions executors/src/main/kotlin/JUnitExecutors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ class JUnitExecutors {
jUnitCore.run(request)
}
System.setOut(standardOutput)
val groupedTestResults = HashMap<String, MutableList<TestRunInfo>>()
for (testRunInfo in output) {
if (!groupedTestResults.containsKey(testRunInfo.className)) {
groupedTestResults[testRunInfo.className] = ArrayList()
}
groupedTestResults[testRunInfo.className]?.add(testRunInfo)
}
print(mapper.writeValueAsString(groupedTestResults))
standardOutput.print(mapper.writeValueAsString(output.groupBy({ it.className }, { it })))
}
catch (e: Exception) {
System.setOut(standardOutput)
Expand Down

0 comments on commit f18d9a8

Please sign in to comment.