|
||||||||||
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.
Field Summary | |
---|---|
private Child |
child
|
private static int |
defaultTimeoutSeconds
The global default timeout (in seconds). |
private static Log |
fine
|
private long |
timeoutMilliseconds
|
Constructor Summary | |
---|---|
|
Expect()
Create a bash shell sitting at a prompt. |
private |
Expect(Child child,
long timeoutMilliseconds)
|
|
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. |
(package private) Expect |
timeoutMilliseconds(long timeoutMilliseconds)
Create a new expect (that shares everything with the old one) only with a different timeout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Log fine
private final Child child
private final long timeoutMilliseconds
private static int defaultTimeoutSeconds
Constructor Detail |
---|
private Expect(Child child, long timeoutMilliseconds)
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)
Expect timeoutMilliseconds(long timeoutMilliseconds)
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 |