From de0ac02d7f815fea0b9cff29adc1db0faf2e18a9 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Tue, 1 Sep 2015 15:57:06 +0200 Subject: [PATCH] Fix test on windows --- .../sonar/runner/impl/SimulatedLauncherTest.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sonar-runner-api/src/test/java/org/sonar/runner/impl/SimulatedLauncherTest.java b/sonar-runner-api/src/test/java/org/sonar/runner/impl/SimulatedLauncherTest.java index 5f34023..aeb4e88 100644 --- a/sonar-runner-api/src/test/java/org/sonar/runner/impl/SimulatedLauncherTest.java +++ b/sonar-runner-api/src/test/java/org/sonar/runner/impl/SimulatedLauncherTest.java @@ -27,6 +27,7 @@ import org.junit.Test; import org.sonar.home.cache.Logger; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; import java.util.Map; import java.util.Properties; @@ -99,19 +100,17 @@ public class SimulatedLauncherTest { private void assertDump(Properties global, Properties analysis) throws IOException { if (analysis != null) { - String content = FileUtils.readFileToString(new File(filename)); - for (Map.Entry e : analysis.entrySet()) { - assertThat(content).contains(e.getKey() + "=" + e.getValue()); - } + Properties p = new Properties(); + p.load(new FileInputStream(new File(filename))); + assertThat(p).isEqualTo(analysis); } else { assertThat(new File(filename)).doesNotExist(); } if (global != null) { - String content = FileUtils.readFileToString(new File(filename + ".global")); - for (Map.Entry e : global.entrySet()) { - assertThat(content).contains(e.getKey() + "=" + e.getValue()); - } + Properties p = new Properties(); + p.load(new FileInputStream(new File(filename + ".global"))); + assertThat(p).isEqualTo(global); } else { assertThat(new File(filename + ".global")).doesNotExist(); } -- 2.39.5