aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/test/java/org/sonar/api/utils
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-10-02 17:50:04 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-10-02 17:52:24 +0200
commita5d9aeea1d086bbffb8f2f864651416494abb0b4 (patch)
treefbe41af6757604f34540fafc0318c6d6cef3c620 /sonar-plugin-api/src/test/java/org/sonar/api/utils
parent2d60412e140a950436349f80f928c0e3a073c287 (diff)
downloadsonarqube-a5d9aeea1d086bbffb8f2f864651416494abb0b4.tar.gz
sonarqube-a5d9aeea1d086bbffb8f2f864651416494abb0b4.zip
SONAR-5643 Hide SVN password and rework logging
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/utils')
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandTest.java14
1 files changed, 13 insertions, 1 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 ab7d0b526ee..79704677501 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
@@ -61,6 +61,18 @@ public class CommandTest {
}
@Test
+ public void create_command_with_masked_arguments() {
+ Command command = Command.create("java");
+ command.addArgument("-Xmx512m");
+ command.addMaskedArgument("s3cr3t");
+ command.addArguments(new String[] {"-x", "-y"});
+ assertThat(command.getExecutable()).isEqualTo("java");
+ assertThat(command.getArguments()).hasSize(4);
+ assertThat(command.toCommandLine()).isEqualTo("java -Xmx512m s3cr3t -x -y");
+ assertThat(command.toString()).isEqualTo("java -Xmx512m ******** -x -y");
+ }
+
+ @Test
public void toString_is_the_command_line() {
Command command = Command.create("java");
command.addArgument("-Xmx512m");
@@ -100,7 +112,7 @@ public class CommandTest {
Command command = new Command("foo.bat", system);
command.setNewShell(true);
assertThat(command.toCommandLine()).isEqualTo("cmd /C call foo.bat");
- assertThat(command.isNewShell()).isTrue();
+ assertThat(command.isNewShell()).isTrue();
}