diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-25 09:53:58 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-09-25 09:53:58 +0200 |
commit | 3cf0930f7f5ef287310a4a33b9c4f2fbdcbb1c4d (patch) | |
tree | c00cf3f57b71bcdacb10e565d2554e23c462a08e /sonar-plugin-api | |
parent | 85c037c87a728edbefc0fd417d6cb89cab246e44 (diff) | |
download | sonarqube-3cf0930f7f5ef287310a4a33b9c4f2fbdcbb1c4d.tar.gz sonarqube-3cf0930f7f5ef287310a4a33b9c4f2fbdcbb1c4d.zip |
Try to improve stability of CommandExecutorTest
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java index 0dcba90e1ed..7a1f4386312 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java @@ -53,7 +53,7 @@ public class CommandExecutorTest { workDir = tempFolder.newFolder(testName.getMethodName()); } - @Test + @Test(timeout = 3000L) public void should_consume_StdOut_and_StdErr() throws Exception { // too many false-positives on MS windows if (!SystemUtils.IS_OS_WINDOWS) { @@ -82,7 +82,7 @@ public class CommandExecutorTest { } } - @Test + @Test(timeout = 3000L) public void stdOut_consumer_can_throw_exception() throws Exception { Command command = Command.create(getScript("output")).setDirectory(workDir); thrown.expect(CommandException.class); @@ -90,12 +90,12 @@ public class CommandExecutorTest { CommandExecutor.create().execute(command, BAD_CONSUMER, NOP_CONSUMER, 1000L); } - @Test + @Test(timeout = 3000L) public void stdErr_consumer_can_throw_exception() throws Exception { Command command = Command.create(getScript("output")).setDirectory(workDir); thrown.expect(CommandException.class); thrown.expectMessage("Error inside stdErr stream"); - CommandExecutor.create().execute(command, NOP_CONSUMER, BAD_CONSUMER, 1000L); + CommandExecutor.create().execute(command, NOP_CONSUMER, BAD_CONSUMER, 1500L); } private static final StreamConsumer NOP_CONSUMER = new StreamConsumer() { |