documentation

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
Emmanuel Bigeon 2018-10-26 16:09:04 -04:00
parent 80242c79e8
commit 7e36a378c4
2 changed files with 7 additions and 1 deletions

View File

@ -95,8 +95,10 @@ public class ExecSystemCommand extends Command {
final InputStream is = proc.getInputStream(); final InputStream is = proc.getInputStream();
final Thread th = new Thread(new ForwardingRunnable(out, is)); final Thread th = new Thread(new ForwardingRunnable(out, is));
th.start(); th.start();
// Set the empty prompt for the processes promptings.
in.setPrompt(""); //$NON-NLS-1$ 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(); final OutputStream os = proc.getOutputStream();
try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os))) { try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os))) {
while (th.isAlive()) { while (th.isAlive()) {

View File

@ -47,6 +47,7 @@ import net.bigeon.gclc.utils.SinkOutput;
public class ExecSystemCommandTest { public class ExecSystemCommandTest {
/** Test the help methods of the command. */
@Test @Test
public void testExecSystemCommand() { public void testExecSystemCommand() {
final ExecSystemCommand cmd = new ExecSystemCommand("test"); final ExecSystemCommand cmd = new ExecSystemCommand("test");
@ -56,6 +57,9 @@ public class ExecSystemCommandTest {
assertNotNull("usage should be defined", cmd.usageDetail()); assertNotNull("usage should be defined", cmd.usageDetail());
} }
/** Test the execution of the command.
*
* @throws CommandRunException */
@Test @Test
public void testExecute() throws CommandRunException { public void testExecute() throws CommandRunException {
final ConsoleOutput out = SinkOutput.INSTANCE; final ConsoleOutput out = SinkOutput.INSTANCE;