Package com.sun.javatest
Class TestResult.Section
java.lang.Object
com.sun.javatest.TestResult.Section
- Enclosing class:
TestResult
This "section" is the logical combination of a single action during test
execution. It is designed to hold multiple (or none) buffers of
output from test execution, such as stdout and stderr. In addition,
it has a "comment" field for tracking the test run itself (progress).
This output is identified by the MSG_SECTION_NAME identifier.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateOutput
(String name) Add a new output buffer to the section; get PrintWriter access to it.void
deleteOutputData
(String name) Removes any data added to the named output up to this point, resetting it to an empty state.Get the appropriate to writer to access the default message field.Get the content that was written to a specified output stream.int
Find out how many output buffers this section has inside it.String[]
Find out the symbolic names of all the streams in this section.Find out what the result of the execution of this section was.getTitle()
Get the title of this section, specified when the section was created.boolean
Query if the section is still writable or not.void
Set the result of this section.
-
Constructor Details
-
Section
-
-
Method Details
-
isMutable
public boolean isMutable()Query if the section is still writable or not.- Returns:
- true if the section is still writable, and false otherwise
-
getStatus
Find out what the result of the execution of this section was.- Returns:
- the result of the execution of this section
- See Also:
-
setStatus
Set the result of this section. This action makes this section immutable.- Parameters:
result
- The status to set as the result of this section of the test- See Also:
-
getTitle
Get the title of this section, specified when the section was created.- Returns:
- the title of this section
-
getMessageWriter
Get the appropriate to writer to access the default message field.- Returns:
- a Writer to access the default message field
-
getOutputCount
public int getOutputCount()Find out how many output buffers this section has inside it.- Returns:
- The number of output buffers in use (>=0).
-
createOutput
Add a new output buffer to the section; get PrintWriter access to it.- Parameters:
name
- The symbolic name that will identify this new stream.- Returns:
- A PrintWriter that gives access to the new stream.
-
getOutput
Get the content that was written to a specified output stream.- Parameters:
name
- the name of the stream in question- Returns:
- All the data that was written to the specified output, or null if nothing has been written.
-
getOutputNames
Find out the symbolic names of all the streams in this section. You can use getOutputCount to discover the number of items in this enumeration (not a thread safe activity in the strictest sense of course).- Returns:
- A list of strings which are the symbolic names of the streams in this section.
- See Also:
-
deleteOutputData
Removes any data added to the named output up to this point, resetting it to an empty state.- Parameters:
name
- The output name to erase the content of.- Since:
- 4.2.1
-