diff options
Diffstat (limited to 'src/test/java/org/sonar/runner/MainTest.java')
-rw-r--r-- | src/test/java/org/sonar/runner/MainTest.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/test/java/org/sonar/runner/MainTest.java b/src/test/java/org/sonar/runner/MainTest.java index aa4bf1d..01aab24 100644 --- a/src/test/java/org/sonar/runner/MainTest.java +++ b/src/test/java/org/sonar/runner/MainTest.java @@ -33,27 +33,28 @@ public class MainTest { @Test public void shouldParseEmptyArguments() { - Properties props = Main.parseArguments(new String[]{}); + Properties props = Main.parseArguments(new String[] {}); assertThat(props.isEmpty(), is(true)); } @Test public void shouldParseArguments() { - Properties props = Main.parseArguments(new String[]{"-D", "foo=bar", "--define", "hello=world"}); - assertThat(props.size(), is(2)); + Properties props = Main.parseArguments(new String[] { "-D", "foo=bar", "--define", "hello=world", "-Dboolean" }); + assertThat(props.size(), is(3)); assertThat(props.getProperty("foo"), is("bar")); assertThat(props.getProperty("hello"), is("world")); + assertThat(props.getProperty("boolean"), is("true")); } @Test public void shouldEnableDebugMode() { - Properties props = Main.parseArguments(new String[]{"-X"}); + Properties props = Main.parseArguments(new String[] { "-X" }); assertThat(props.getProperty(Runner.VERBOSE), is("true")); } @Test public void shouldDisableDebugModeByDefault() { - Properties props = Main.parseArguments(new String[]{}); + Properties props = Main.parseArguments(new String[] {}); assertThat(props.getProperty(Runner.VERBOSE), nullValue()); } @@ -90,9 +91,9 @@ public class MainTest { 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()); - Properties props = Main.loadProperties(new String[]{ - "-D", "runner.home=" + runnerHome.getCanonicalPath(), - "-D", "project.home=" + projectHome.getCanonicalPath() + Properties props = Main.loadProperties(new String[] { + "-D", "runner.home=" + runnerHome.getCanonicalPath(), + "-D", "project.home=" + projectHome.getCanonicalPath() }); assertThat(props.getProperty("project.prop"), is("foo")); |