frysk.expunit
Class Child

java.lang.Object
  extended by frysk.expunit.Child

 class Child
extends Object

The child being waited on.


Field Summary
private  PseudoTerminal child
           
private  boolean eof
          Detected end-of-file, or hang-up.
protected static Log fine
           
private static Log finest
           
private  String output
          Buffer containing all the unmatched output from the child.
private  ProcessIdentifier pid
           
 
Constructor Summary
Child(String[] args)
          Create an expect instance running the specified program args[0] and args.
 
Method Summary
 void close()
          Clean up.
(package private)  void expectMilliseconds(long timeoutMilliseconds, Match[] matches)
          Expect one of the specified patterns; throw TimeoutException if timeoutSecond expires; throw EofException if end-of-file is encountered.
 void finalize()
          Finalizer, also tries to clean up.
(package private)  ProcessIdentifier getPid()
          Return the Process ID of the child.
(package private)  void send(String string)
          Send "string" to the child process.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fine

protected static Log fine

finest

private static Log finest

child

private final PseudoTerminal child

pid

private final ProcessIdentifier pid

output

private String output
Buffer containing all the unmatched output from the child. It's a String and not a StringBuffer as after every change the buffer gets re-converted to a String anyway.


eof

private boolean eof
Detected end-of-file, or hang-up.

Constructor Detail

Child

Child(String[] args)
Create an expect instance running the specified program args[0] and args.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

close

public void close()
Clean up. XXX: This drains all outstanding WAITPID events, and SIGCHLD events.


finalize

public void finalize()
Finalizer, also tries to clean up.

Overrides:
finalize in class Object

getPid

ProcessIdentifier getPid()
Return the Process ID of the child.


send

void send(String string)
Send "string" to the child process.


expectMilliseconds

void expectMilliseconds(long timeoutMilliseconds,
                        Match[] matches)
Expect one of the specified patterns; throw TimeoutException if timeoutSecond expires; throw EofException if end-of-file is encountered. This is package visible so that Expect can use it, but no one else.