Package org.netbeans.jemmy
Class TestOut
java.lang.Object
org.netbeans.jemmy.TestOut
Test output.
- Author:
- Alexandre Iline (alexandre.iline@sun.com)
-
Constructor Summary
ConstructorsConstructorDescriptionTestOut()
Creates unstance using System.in, System.out and System.err streams.TestOut
(InputStream in, PrintStream out, PrintStream err) Constructor.TestOut
(InputStream in, PrintStream out, PrintStream err, PrintStream golden) Constructor.TestOut
(InputStream in, PrintWriter out, PrintWriter err) Constructor.TestOut
(InputStream in, PrintWriter out, PrintWriter err, PrintWriter golden) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionCreates an output which prints only error messages.void
flush()
Flushes all output threads.boolean
Says if flush is invoked after each output.Returns errput writer.Returns golden output writer.getInput()
Returns input stream.static TestOut
Creates output which does not print any message anywhere.Returns output writer.void
Prints a line into output.void
printErrLine
(String line) Prints a line into error output.void
printError
(String text) Prints a error line.void
printGolden
(String line) Prints a line into golden output.void
Prints a line into either output or errput.void
Prints a line and then terminate the line by writing the line separator string.void
Prints an exception stack trace into error stream.void
printTrace
(String text) Prints a trace line.int
read()
Read one byte from input.readLine()
Read a line from input.boolean
setAutoFlushMode
(boolean autoFlushMode) Specifies either flush is invoked after each output.
-
Constructor Details
-
TestOut
Constructor.- Parameters:
in
- Input streamout
- Output streamerr
- Errput stream
-
TestOut
Constructor.- Parameters:
in
- Input streamout
- Output streamerr
- Errput streamgolden
- Golgen output stream
-
TestOut
Constructor.- Parameters:
in
- Input streamout
- Output streamerr
- Errput stream
-
TestOut
Constructor.- Parameters:
in
- Input streamout
- Output streamerr
- Errput streamgolden
- Golgen output stream
-
TestOut
public TestOut()Creates unstance using System.in, System.out and System.err streams.
-
-
Method Details
-
getNullOutput
Creates output which does not print any message anywhere.- Returns:
- a TestOut object which does not print any message anywhere.
-
setAutoFlushMode
public boolean setAutoFlushMode(boolean autoFlushMode) Specifies either flush is invoked after each output.- Parameters:
autoFlushMode
- If true flush is invoking after each output.- Returns:
- Old value of the auto flush mode.
- See Also:
-
getAutoFlushMode
public boolean getAutoFlushMode()Says if flush is invoked after each output.- Returns:
- Value of the auto flush mode.
- See Also:
-
read
Read one byte from input.- Returns:
- an int from input stream.
- Throws:
IOException
-
readLine
Read a line from input.- Returns:
- a line from input stream.
- Throws:
IOException
-
print
Prints a line into output.- Parameters:
line
- a string to print into output stream.
-
printLine
Prints a line and then terminate the line by writing the line separator string.- Parameters:
line
- a string to print into output stream.
-
printGolden
Prints a line into golden output.- Parameters:
line
- a string to print into golden output stream.
-
printErrLine
Prints a line into error output.- Parameters:
line
- a string to print into error output stream.
-
printLine
Prints a line into either output or errput.- Parameters:
toOut
- If true prints a line into output.line
- a string to print.
-
printTrace
Prints a trace line.- Parameters:
text
- a trace text.
-
printError
Prints a error line.- Parameters:
text
- a error text.
-
printStackTrace
Prints an exception stack trace into error stream.- Parameters:
e
- exception
-
getInput
Returns input stream.- Returns:
- an input stream
-
getOutput
Returns output writer.- Returns:
- an output stream
-
getErrput
Returns errput writer.- Returns:
- a error stream
-
getGolden
Returns golden output writer.- Returns:
- a golden output stream
-
createErrorOutput
Creates an output which prints only error messages.- Returns:
- a TestOut instance which has only error stream.
-
flush
public void flush()Flushes all output threads.
-