From 994944fa6dcbbd6817bc0afbe8b43c4a106754fa Mon Sep 17 00:00:00 2001 From: Mihai Parv Date: Wed, 11 May 2016 17:43:24 +0300 Subject: [PATCH] Included category naming case when searching for test source files which are not in the root. --- .../org/sonar/plugins/objectivec/tests/SurefireParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/sonar/plugins/objectivec/tests/SurefireParser.java b/src/main/java/org/sonar/plugins/objectivec/tests/SurefireParser.java index d15e41bf..be92ce3c 100644 --- a/src/main/java/org/sonar/plugins/objectivec/tests/SurefireParser.java +++ b/src/main/java/org/sonar/plugins/objectivec/tests/SurefireParser.java @@ -206,7 +206,8 @@ public Resource getUnitTestResource(String classname) { if (!file.isFile() || !file.exists()) { List files = ImmutableList.copyOf(fileSystem.files(fileSystem.predicates().and( fileSystem.predicates().hasType(InputFile.Type.TEST), - fileSystem.predicates().matchesPathPattern("**/" + fileName)))); + fileSystem.predicates().or(fileSystem.predicates().matchesPathPattern("**/" + fileName), + fileSystem.predicates().matchesPathPattern("**/" + fileName.replace("_", "+")))))); if (files.isEmpty()) { LOG.info("Unable to locate test source file {}", fileName);