From 7e36a378c4fd313adeb0eef601094c5a7601e1c4 Mon Sep 17 00:00:00 2001 From: Emmanuel Bigeon Date: Fri, 26 Oct 2018 16:09:04 -0400 Subject: [PATCH] documentation Signed-off-by: Emmanuel Bigeon --- .../main/java/net/bigeon/gclc/system/ExecSystemCommand.java | 4 +++- .../java/net/bigeon/gclc/system/ExecSystemCommandTest.java | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gclc.system/src/main/java/net/bigeon/gclc/system/ExecSystemCommand.java b/gclc.system/src/main/java/net/bigeon/gclc/system/ExecSystemCommand.java index 6415bb1..34a71ad 100644 --- a/gclc.system/src/main/java/net/bigeon/gclc/system/ExecSystemCommand.java +++ b/gclc.system/src/main/java/net/bigeon/gclc/system/ExecSystemCommand.java @@ -95,8 +95,10 @@ public class ExecSystemCommand extends Command { final InputStream is = proc.getInputStream(); final Thread th = new Thread(new ForwardingRunnable(out, is)); th.start(); + // Set the empty prompt for the processes promptings. in.setPrompt(""); //$NON-NLS-1$ - // Forward console input to the process. + // Forward console input to the process, whether the process is waiting or not + // for input. final OutputStream os = proc.getOutputStream(); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os))) { while (th.isAlive()) { diff --git a/gclc.system/src/test/java/net/bigeon/gclc/system/ExecSystemCommandTest.java b/gclc.system/src/test/java/net/bigeon/gclc/system/ExecSystemCommandTest.java index 619231d..3f0a492 100644 --- a/gclc.system/src/test/java/net/bigeon/gclc/system/ExecSystemCommandTest.java +++ b/gclc.system/src/test/java/net/bigeon/gclc/system/ExecSystemCommandTest.java @@ -47,6 +47,7 @@ import net.bigeon.gclc.utils.SinkOutput; public class ExecSystemCommandTest { + /** Test the help methods of the command. */ @Test public void testExecSystemCommand() { final ExecSystemCommand cmd = new ExecSystemCommand("test"); @@ -56,6 +57,9 @@ public class ExecSystemCommandTest { assertNotNull("usage should be defined", cmd.usageDetail()); } + /** Test the execution of the command. + * + * @throws CommandRunException */ @Test public void testExecute() throws CommandRunException { final ConsoleOutput out = SinkOutput.INSTANCE;