aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-08-26 09:28:02 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-08-26 09:28:50 +0200
commita2a0a746a88f1b04bad94c91b3111a5b5f30b521 (patch)
tree73ce3a2d0c303c14d0e575d23b17f45dded2e9dd /sonar-batch
parent9245b29fe0419dc17c880cdea33d4ee348d68721 (diff)
downloadsonarqube-a2a0a746a88f1b04bad94c91b3111a5b5f30b521.tar.gz
sonarqube-a2a0a746a88f1b04bad94c91b3111a5b5f30b521.zip
SONAR-5528 Fix UT
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/mediumtest/highlighting/HighlightingMediumTest.java10
1 files changed, 1 insertions, 9 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/highlighting/HighlightingMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/highlighting/HighlightingMediumTest.java
index 6b0501ec9fc..0fa6c76365f 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/highlighting/HighlightingMediumTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/highlighting/HighlightingMediumTest.java
@@ -104,14 +104,13 @@ public class HighlightingMediumTest {
File xooFile = new File(srcDir, "sample.xoo");
File xoohighlightingFile = new File(srcDir, "sample.xoo.highlighting");
FileUtils.write(xooFile, "Sample xoo\ncontent");
- int chunkSize = 100000;
+ int chunkSize = 10000;
StringBuilder sb = new StringBuilder(16 * chunkSize);
for (int i = 0; i < chunkSize; i++) {
sb.append(i).append(":").append(i + 1).append(":s\n");
}
FileUtils.write(xoohighlightingFile, sb.toString());
- long start = System.currentTimeMillis();
TaskResult result = tester.newTask()
.properties(ImmutableMap.<String, String>builder()
.put("sonar.task", "scan")
@@ -123,17 +122,10 @@ public class HighlightingMediumTest {
.put("sonar.sources", "src")
.build())
.start();
- long duration = System.currentTimeMillis() - start;
- assertDurationLessThan(duration, 20000L);
InputFile file = result.inputFiles().get(0);
assertThat(result.highlightingTypeFor(file, 0)).isEqualTo(HighlightingBuilder.TypeOfText.STRING);
}
- void assertDurationLessThan(long duration, long maxDuration) {
- assertThat(duration).as(String.format("Expected less than %d ms, got %d ms", maxDuration, duration)).isLessThanOrEqualTo(maxDuration);
- System.out.printf("Test %s : %d ms (max allowed is %d)\n", testName.getMethodName(), duration, maxDuration);
- }
-
}