diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-05-03 09:14:29 +0000 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-05-03 09:14:29 +0000 |
commit | 84e2798123e242bfe786359dfff9865e1a230793 (patch) | |
tree | e6a2bc27af521e3b96782d39a2ed162ed02074be /src/test | |
parent | 83e9baf9a94f52fe5f8a3ba0ad8a819a021fd68d (diff) | |
download | sonar-scanner-cli-84e2798123e242bfe786359dfff9865e1a230793.tar.gz sonar-scanner-cli-84e2798123e242bfe786359dfff9865e1a230793.zip |
SONARPLUGINS-1619 Support the properties sonar.showSql and sonar.showSqlResults
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/sonar/runner/LauncherTest.java | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/test/java/org/sonar/runner/LauncherTest.java b/src/test/java/org/sonar/runner/LauncherTest.java index f857441..ea3de33 100644 --- a/src/test/java/org/sonar/runner/LauncherTest.java +++ b/src/test/java/org/sonar/runner/LauncherTest.java @@ -19,14 +19,17 @@ */ package org.sonar.runner; +import org.apache.commons.configuration.BaseConfiguration; +import org.apache.commons.configuration.Configuration; +import org.junit.Test; + +import java.io.File; + import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.startsWith; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; -import java.io.File; -import org.junit.Test; - public class LauncherTest { @Test @@ -56,4 +59,30 @@ public class LauncherTest { } } + @Test + public void testGetSqlLevel() throws Exception { + Configuration conf = new BaseConfiguration(); + + assertThat(Launcher.getSqlLevel(conf), is("WARN")); + + conf.setProperty("sonar.showSql", "true"); + assertThat(Launcher.getSqlLevel(conf), is("DEBUG")); + + conf.setProperty("sonar.showSql", "false"); + assertThat(Launcher.getSqlLevel(conf), is("WARN")); + } + + @Test + public void testGetSqlResultsLevel() throws Exception { + Configuration conf = new BaseConfiguration(); + + assertThat(Launcher.getSqlResultsLevel(conf), is("WARN")); + + conf.setProperty("sonar.showSqlResults", "true"); + assertThat(Launcher.getSqlResultsLevel(conf), is("DEBUG")); + + conf.setProperty("sonar.showSqlResults", "false"); + assertThat(Launcher.getSqlResultsLevel(conf), is("WARN")); + } + } |