summaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/test/java/org
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-07-26 11:42:39 +0200
committerDavid Gageot <david@gageot.net>2012-07-26 11:43:58 +0200
commit0ccf01fa0c17d1e40defef636c7f1499f286a10d (patch)
tree54ca64080dc7334481721d5c0fca5389c246af9a /sonar-plugin-api/src/test/java/org
parent71f68fbed0dc2aea4e32e38630e4af390e0068d6 (diff)
downloadsonarqube-0ccf01fa0c17d1e40defef636c7f1499f286a10d.tar.gz
sonarqube-0ccf01fa0c17d1e40defef636c7f1499f286a10d.zip
SONAR-3698 Improve documentation, code coverage and add a salt of Guava
Diffstat (limited to 'sonar-plugin-api/src/test/java/org')
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java
index b57a671ee0b..2ae9c89b4f8 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java
@@ -29,7 +29,6 @@ import java.util.Arrays;
import static org.fest.assertions.Assertions.assertThat;
-
public class CommandTest {
@Rule
@@ -52,7 +51,7 @@ public class CommandTest {
Command command = Command.create("java");
command.addArgument("-Xmx512m");
command.addArguments(Arrays.asList("-a", "-b"));
- command.addArguments(new String[]{"-x", "-y"});
+ command.addArguments(new String[] {"-x", "-y"});
assertThat(command.getExecutable()).isEqualTo("java");
assertThat(command.getArguments()).hasSize(5);
assertThat(command.toCommandLine()).isEqualTo("java -Xmx512m -a -b -x -y");
@@ -89,15 +88,24 @@ public class CommandTest {
}
@Test
- public void use_new_shell() {
+ public void should_use_new_shell() {
if (SystemUtils.IS_OS_WINDOWS) {
Command command = Command.create("foo.bat");
command.setNewShell(true);
assertThat(command.toCommandLine()).isEqualTo("cmd /C foo.bat");
+ assertThat(command.isNewShell()).isTrue();
} else {
Command command = Command.create("foo.sh");
command.setNewShell(true);
assertThat(command.toCommandLine()).isEqualTo("sh foo.sh");
+ assertThat(command.isNewShell()).isTrue();
}
}
+
+ @Test
+ public void shouldnt_use_new_shell_by_default() {
+ Command command = Command.create("foo.sh");
+
+ assertThat(command.isNewShell()).isFalse();
+ }
}