summaryrefslogtreecommitdiff
path: root/qpid/java/systests
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2012-02-15 15:29:22 +0000
committerKeith Wall <kwall@apache.org>2012-02-15 15:29:22 +0000
commit4a0d5c412e2bee6f4c72e0194fa5959cf94e5fb3 (patch)
treebcb1acfc95bc698c577218a2824076caf7804d28 /qpid/java/systests
parent07d52e55da5a28788c7604d0b445549a92cda238 (diff)
downloadqpid-python-4a0d5c412e2bee6f4c72e0194fa5959cf94e5fb3.tar.gz
QPID-3840: corrected qpid-passwd and qpid-run to handle paths with spaces in them. Modified unit test to capture stderr to aid diagnosis of failures.
Applied patch from Andrew MacBean <andymacbean@gmail.com> and Philip Harvey <phil@philharveyonline.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1244535 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/scripts/QpidPasswdTest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/scripts/QpidPasswdTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/scripts/QpidPasswdTest.java
index f8a2fc15a8..1158a1d220 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/scripts/QpidPasswdTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/scripts/QpidPasswdTest.java
@@ -23,9 +23,13 @@ import java.util.concurrent.TimeUnit;
import org.apache.qpid.test.utils.Piper;
import org.apache.qpid.test.utils.QpidTestCase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class QpidPasswdTest extends QpidTestCase
{
+ private static final Logger LOGGER = LoggerFactory.getLogger(QpidPasswdTest.class);
+
private static final String PASSWD_SCRIPT = "qpid-passwd";
private static final String EXPECTED_OUTPUT = "user1:rL0Y20zC+Fzt72VPzMSk2A==";
@@ -39,15 +43,19 @@ public class QpidPasswdTest extends QpidTestCase
+ "bin" + File.separatorChar
+ PASSWD_SCRIPT;
+ LOGGER.info("About to run script: " + scriptPath);
+
ProcessBuilder pb = new ProcessBuilder(scriptPath, "user1", "foo");
+ pb.redirectErrorStream(true);
process = pb.start();
Piper piper = new Piper(process.getInputStream(), System.out, EXPECTED_OUTPUT, EXPECTED_OUTPUT);
piper.start();
boolean finishedSuccessfully = piper.await(2, TimeUnit.SECONDS);
- assertTrue("Script should have completed with expected output " + EXPECTED_OUTPUT, finishedSuccessfully);
-
+ assertTrue(
+ "Script should have completed with expected output " + EXPECTED_OUTPUT + ". Check standard output for actual output.",
+ finishedSuccessfully);
process.waitFor();
piper.join();