From 765a74572adf7375da73c2b68c7dd8ed37126143 Mon Sep 17 00:00:00 2001 From: Michael Klein Date: Mon, 12 Jan 2015 13:13:39 +0100 Subject: [PATCH] Add rule for parsing surefire reports without Test- prefix --- .../sonar/plugins/scala/surefire/ScalaSurefireParser.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/sonar/plugins/scala/surefire/ScalaSurefireParser.java b/src/main/java/org/sonar/plugins/scala/surefire/ScalaSurefireParser.java index 6843505..d312984 100644 --- a/src/main/java/org/sonar/plugins/scala/surefire/ScalaSurefireParser.java +++ b/src/main/java/org/sonar/plugins/scala/surefire/ScalaSurefireParser.java @@ -73,6 +73,10 @@ private File[] getReports(File dir) { // maybe there's only a test suite result file unitTestResultFiles = findXMLFilesStartingWith(dir, "TESTS-"); } + if (unitTestResultFiles.length == 0) { + // maybe there's only a test suite result file + unitTestResultFiles = findXMLFilesStartingWith(dir, ""); + } return unitTestResultFiles; } @@ -84,7 +88,7 @@ public boolean accept(File dir, String name) { } }); } - + private void parseFiles(SensorContext context, File[] reports) { UnitTestIndex index = new UnitTestIndex(); parseFiles(reports, index);