diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-16 08:38:47 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-16 08:39:05 +0200 |
commit | b82da6d622c3648f016098eb6964555ad75879f9 (patch) | |
tree | 889751ecb942592bfe2d6c5792802cc89ea60662 /plugins | |
parent | fe201e27962b72878a936456c27778e37ba82827 (diff) | |
download | sonarqube-b82da6d622c3648f016098eb6964555ad75879f9.tar.gz sonarqube-b82da6d622c3648f016098eb6964555ad75879f9.zip |
Fix some quality flaws
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/TestCaseSensor.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/TestCaseSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/TestCaseSensor.java index 12f231c17e8..bd297b61172 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/TestCaseSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/TestCaseSensor.java @@ -76,16 +76,18 @@ public class TestCaseSensor implements Sensor { String status = split.next(); String message = split.next(); String stack = split.next(); - long duration = Long.parseLong(split.next()); - context.newTestCaseExecution() + String durationStr = StringUtils.trimToNull(split.next()); + TestCaseExecution test = context.newTestCaseExecution() .inTestFile(testFile) .name(name) .ofType(TestCaseExecution.Type.valueOf(type)) .status(TestCaseExecution.Status.valueOf(status)) .message(StringUtils.trimToNull(message)) - .stackTrace(StringUtils.trimToNull(stack)) - .durationInMs(duration) - .save(); + .stackTrace(StringUtils.trimToNull(stack)); + if (durationStr != null) { + test.durationInMs(Long.parseLong(durationStr)); + } + test.save(); } catch (Exception e) { throw new IllegalStateException("Error processing line " + lineNumber + " of file " + testplanFile.getAbsolutePath(), e); } |