org.robotframework.javalib.util
Class StdStreamRedirecter

java.lang.Object
  extended by org.robotframework.javalib.util.StdStreamRedirecter

public class StdStreamRedirecter
extends java.lang.Object

Handles the STDOUT and STDERR redirection. Used for remote logging.

Author:
Heikki Hulkko

Constructor Summary
StdStreamRedirecter()
           
 
Method Summary
 java.lang.String getStdErrAsString()
          Retrieves everything printed to STDERR as string.
 java.lang.String getStdOutAsString()
          Retrieves everything printed to STDOUT as string.
 void redirectStdStreams()
          Initializes the redirection of STDOUT and STDERR so they can be accessed with getStdOutAsString and getStdErrAsString.
 void resetStdStreams()
          Resets STDOUT and STDERR as they were before calling redirectStdStreams.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdStreamRedirecter

public StdStreamRedirecter()
Method Detail

getStdErrAsString

public java.lang.String getStdErrAsString()
Retrieves everything printed to STDERR as string. redirectStdStreams() must be called before calling this method. After each call to this method, the internal buffer containing STDERR as string is emptied.

Returns:
STDERR as string

getStdOutAsString

public java.lang.String getStdOutAsString()
Retrieves everything printed to STDOUT as string. redirectStdStreams() must be called before calling this method. After each call to this method, the internal buffer containing STDOUT as string is emptied.

Returns:
STDOUT as string

redirectStdStreams

public void redirectStdStreams()
Initializes the redirection of STDOUT and STDERR so they can be accessed with getStdOutAsString and getStdErrAsString.


resetStdStreams

public void resetStdStreams()
Resets STDOUT and STDERR as they were before calling redirectStdStreams.



Copyright © 2008. All Rights Reserved.