aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/TestCaseSensor.java12
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);
}