From 1085fe249e3dcef1a48d15334ed1e1b9097eba8c Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Mon, 8 Jul 2013 12:09:01 +0200 Subject: [PATCH] Fix UTs --- .../test/java/org/sonar/runner/ConfTest.java | 34 +++++++++---------- .../other-conf.properties | 2 +- .../conf/sonar-runner.properties | 4 +-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sonar-runner-dist/src/test/java/org/sonar/runner/ConfTest.java b/sonar-runner-dist/src/test/java/org/sonar/runner/ConfTest.java index e4296c5..d9ad17d 100644 --- a/sonar-runner-dist/src/test/java/org/sonar/runner/ConfTest.java +++ b/sonar-runner-dist/src/test/java/org/sonar/runner/ConfTest.java @@ -45,7 +45,7 @@ public class ConfTest { File home = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByHome/").toURI()); args.setProperty("runner.home", home.getCanonicalPath()); - assertThat(conf.properties().get("sonar.host.url")).isEqualTo("http://moon/sonar"); + assertThat(conf.properties().get("sonar.prop")).isEqualTo("value"); } @Test @@ -58,23 +58,23 @@ public class ConfTest { File settings = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByDirectPath/other-conf.properties").toURI()); args.setProperty("runner.settings", settings.getCanonicalPath()); - assertThat(conf.properties().get("sonar.host.url")).isEqualTo("http://other/sonar"); + assertThat(conf.properties().get("sonar.prop")).isEqualTo("otherValue"); } -// @Test -// public void shouldLoadCompleteConfiguration() throws Exception { -// File runnerHome = new File(getClass().getResource("/org/sonar/runner/MainTest/shouldLoadCompleteConfiguration/runner").toURI()); -// File projectHome = new File(getClass().getResource("/org/sonar/runner/MainTest/shouldLoadCompleteConfiguration/project").toURI()); -// Main main = new Main(); -// Properties args = main.parseArguments(new String[] { -// "-D", "runner.home=" + runnerHome.getCanonicalPath(), -// "-D", "project.home=" + projectHome.getCanonicalPath() -// }); -// main.loadProperties(args); -// -// assertThat(main.projectProperties.getProperty("project.prop")).isEqualTo("foo"); -// assertThat(main.projectProperties.getProperty("overridden.prop")).isEqualTo("project scope"); -// assertThat(main.globalProperties.getProperty("global.prop")).isEqualTo("jdbc:mysql:localhost/sonar"); -// } + // @Test + // public void shouldLoadCompleteConfiguration() throws Exception { + // File runnerHome = new File(getClass().getResource("/org/sonar/runner/MainTest/shouldLoadCompleteConfiguration/runner").toURI()); + // File projectHome = new File(getClass().getResource("/org/sonar/runner/MainTest/shouldLoadCompleteConfiguration/project").toURI()); + // Main main = new Main(); + // Properties args = main.parseArguments(new String[] { + // "-D", "runner.home=" + runnerHome.getCanonicalPath(), + // "-D", "project.home=" + projectHome.getCanonicalPath() + // }); + // main.loadProperties(args); + // + // assertThat(main.projectProperties.getProperty("project.prop")).isEqualTo("foo"); + // assertThat(main.projectProperties.getProperty("overridden.prop")).isEqualTo("project scope"); + // assertThat(main.globalProperties.getProperty("global.prop")).isEqualTo("jdbc:mysql:localhost/sonar"); + // } } diff --git a/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByDirectPath/other-conf.properties b/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByDirectPath/other-conf.properties index 740a616..33dc79b 100644 --- a/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByDirectPath/other-conf.properties +++ b/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByDirectPath/other-conf.properties @@ -1 +1 @@ -sonar.host.url=http://other/sonar \ No newline at end of file +sonar.prop=otherValue diff --git a/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByHome/conf/sonar-runner.properties b/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByHome/conf/sonar-runner.properties index e7d5c09..1e03622 100644 --- a/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByHome/conf/sonar-runner.properties +++ b/sonar-runner-dist/src/test/resources/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByHome/conf/sonar-runner.properties @@ -1,2 +1,2 @@ -sonar.host.url=http://moon/sonar -sonar.jdbc.url=jdbc:mysql:localhost/sonar \ No newline at end of file +sonar.prop=value +sonar.jdbc.url=jdbc:mysql:localhost/sonar -- 2.39.5