|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object frysk.expunit.Expect
public class Expect
Simple expect like framework, that works within JUnit. This works creating a pty with a daemon process attached. XXX: At present, since it is a daemon, it isn't possible to expect an exit status.
Constructor Summary | |
---|---|
Expect()
Create a bash shell sitting at a prompt. |
|
Expect(File program)
Create an expect instance running PROGRAM with no arguments. |
|
Expect(String command)
Using bash | |
Expect(String[] args)
Create an expect instance running the specified program args[0] and args. |
Method Summary | |
---|---|
void |
close()
Clean up. |
void |
expect(Match match)
Expect the specified pattern, throw a TimeoutException if the default timeout expires or EofException if end-of-file is reached. |
void |
expect(Match[] matches)
Expect a specified pattern, throw a TimeoutException if the default timeout expires or EofException if end-of-file is reached. |
void |
expect(String regex)
Expect the specified regular expression, throw a TimeoutException if the default timeout expires or EofException if end-of-file is reached. |
void |
expectEOF()
Expect an EOF. |
void |
expectTermination(int status)
Expect the child process to exit with status. |
void |
expectTermination(Signal signal)
Expect the child process to be terminated by SIGNAL. |
void |
finalize()
Finalizer, also tries to clean up. |
ProcessIdentifier |
getPid()
Return the Process ID of the child. |
void |
send(String string)
Send "string" to the child process. |
static void |
setDefaultTimeoutSeconds(int defaultTimeoutSeconds)
Set the global default timeout (in seconds). |
Expect |
timeout(int timeoutSeconds)
Create a new expect (that shares everything with the old one) only with a different timeout. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Expect(String[] args)
public Expect(File program)
public Expect(String command)
public Expect()
Method Detail |
---|
public void close()
public void finalize()
finalize
in class Object
public static void setDefaultTimeoutSeconds(int defaultTimeoutSeconds)
public Expect timeout(int timeoutSeconds)
public ProcessIdentifier getPid()
public void send(String string)
public void expect(Match[] matches)
public void expect(Match match)
public void expect(String regex)
public void expectEOF()
public void expectTermination(int status)
public void expectTermination(Signal signal)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |