public interface ShellTest
| Modifier and Type | Method and Description |
|---|---|
void |
clearScreen()
Clear the screen and reset the buffer.
|
org.jboss.forge.addon.ui.result.Result |
execute(String line,
int quantity,
TimeUnit unit)
Execute the given line and return the
Result. |
org.jboss.aesh.console.Buffer |
getBuffer()
Get the
Console buffer object. |
org.jboss.forge.addon.shell.Shell |
getShell()
Get the underlying test
Shell object. |
String |
getStdErr()
Get the current contents of STDERR since the last time it was cleared.
|
OutputStream |
getStdIn()
Get the STDIN
OutputStream for writing. |
String |
getStdOut()
Get the current contents of STDOUT since the last time it was cleared.
|
void |
sendCompletionSignal()
Initiate completion by sending the appropriate signal or character sequence to the
Shell. |
void |
waitForBufferChanged(Callable<?> task,
int quantity,
TimeUnit unit)
Wait for the console
Buffer to be updated the given task is executed. |
void |
waitForBufferValue(Callable<?> task,
int quantity,
TimeUnit unit,
String expected)
Wait for the console
Buffer to be updated the given task is executed, and assert that it matches the given
String. |
String |
waitForCompletion(int quantity,
TimeUnit unit)
Clear STDOUT, then send the completion signal.
|
String |
waitForCompletion(String expected,
String write,
int quantity,
TimeUnit unit)
Clear STDOUT, then write the given string to the buffer and assert that the full buffer is equal to the expected
content.
|
String |
waitForStdErrChanged(Callable<?> callable,
int quantity,
TimeUnit unit)
Execute the given
Callable task, waiting for STDERR and returning the resultant output. |
void |
waitForStdErrChanged(String input,
int quantity,
TimeUnit unit)
Clear and wait for the next write to STDOUT.
|
void |
waitForStdErrValue(Callable<Void> task,
int timeout,
TimeUnit unit,
String expected)
Execute the given
Callable task, waiting for STDERR to be updated, and assert that it matches the given
value. |
String |
waitForStdOutChanged(Callable<?> task,
int quantity,
TimeUnit unit)
Execute the given
Callable task, waiting for STDOUT and returning the resultant output. |
void |
waitForStdOutChanged(String input,
int quantity,
TimeUnit unit)
Clear and wait for the next write to STDOUT.
|
void |
waitForStdOutValue(Callable<Void> task,
int timeout,
TimeUnit unit,
String expected)
Execute the given
Callable task, waiting for STDOUT to be updated, and assert that it matches the given
value. |
void |
write(String string)
Write to STDIN.
|
org.jboss.aesh.console.Buffer getBuffer()
Console buffer object.org.jboss.forge.addon.shell.Shell getShell()
Shell object.org.jboss.forge.addon.ui.result.Result execute(String line, int quantity, TimeUnit unit) throws TimeoutException
Result. Fail if not complete within the given quantity of
TimeUnit. Clears STDOUT and STDERR before execution.TimeoutException - if the given command was not executed successfully within the allotted timeout.void waitForBufferChanged(Callable<?> task, int quantity, TimeUnit unit) throws TimeoutException
Buffer to be updated the given task is executed.TimeoutException - if the timeout is reached without detecting a buffer value change.void waitForBufferValue(Callable<?> task, int quantity, TimeUnit unit, String expected) throws TimeoutException
Buffer to be updated the given task is executed, and assert that it matches the given
String.TimeoutException - if the timeout is reached without detecting the appropriate value.void waitForStdOutChanged(String input, int quantity, TimeUnit unit) throws TimeoutException
TimeUnitTimeoutException - if the timeout is reached without detecting a write to STDOUT.String waitForStdOutChanged(Callable<?> task, int quantity, TimeUnit unit) throws TimeoutException
Callable task, waiting for STDOUT and returning the resultant output.TimeoutException - if the timeout is reached without detecting a write to STDOUT.void waitForStdOutValue(Callable<Void> task, int timeout, TimeUnit unit, String expected) throws TimeoutException
Callable task, waiting for STDOUT to be updated, and assert that it matches the given
value.TimeoutException - if the timeout is reached without detecting the expected write to STDOUT.void waitForStdErrChanged(String input, int quantity, TimeUnit unit) throws TimeoutException
TimeUnitTimeoutException - if the timeout is reached without detecting a write to STDERR.String waitForStdErrChanged(Callable<?> callable, int quantity, TimeUnit unit) throws TimeoutException
Callable task, waiting for STDERR and returning the resultant output.TimeoutException - if the timeout is reached without detecting a write to STDERR.void waitForStdErrValue(Callable<Void> task, int timeout, TimeUnit unit, String expected) throws TimeoutException
Callable task, waiting for STDERR to be updated, and assert that it matches the given
value.TimeoutException - if the timeout is reached without detecting the expected write to STDERR.OutputStream getStdIn()
OutputStream for writing.String getStdOut()
String getStdErr()
void write(String string) throws IOException
IOExceptionvoid sendCompletionSignal()
throws IOException
Shell.IOExceptionvoid clearScreen()
throws IOException
IOExceptionString waitForCompletion(String expected, String write, int quantity, TimeUnit unit) throws TimeoutException
TimeoutException - if the buffer did not match STDOUT within the given timeout.String waitForCompletion(int quantity, TimeUnit unit) throws TimeoutException
TimeoutException - if the buffer did not match STDOUT within the given timeout.Copyright © 2013 JBoss by Red Hat. All Rights Reserved.