|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | CONST | FIELD | CONSTR | METHOD | DETAIL: CONST | FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--satin.testing.TestLogInternal
public final class TestLogInternal
extends java.lang.Object
implements TestLog
This is the internal class for a test results log file.
It it intended for use only by other classes in the satin.testing
package, in particular
Test,
TestScript,
TestGroup and
Testcase.
Writers of specific tests (test scripts and testcases) should use only
the TestLog interface.
Every test log created by the TestScript class is an object of class TestLogInternal, and is cached as such by the TestScript and Testcase objects so that it can access all of the TestLogInternal methods. The script writer only sees the TestLog interface.
TestScript,
Testcase| Inner Class Summary | |
class |
TestLogInternal.PatchPoint
Defines a spot for back-patching. |
| Field Summary | |
boolean |
autoFlush
When true, output is flushed to disk after each write operation. |
protected TestLogBlock |
currentBlock
The current log block. |
boolean |
echoToConsole
When true, output is echoed to the console ( System.out). |
protected TestLogBlock |
outermostBlock
The outermost log block that encloses the entire test log. |
| Constructor Summary | |
TestLogInternal(java.lang.String fileName)
Creates a new test log file. |
|
TestLogInternal(java.lang.String fileName,
boolean append)
Creates a new test log file. |
|
| Method Summary | |
TestLogBlock |
beginBlock(int type,
java.lang.String title)
Begins a new nested block in the log file. |
TestLogBlock |
beginBlock(java.lang.String title)
Begins a new nested block in the log file. |
TestLogBlock |
beginError(java.lang.String str)
Writes an error message to the log file, increments the error count, and opens a block that will contain additional error information. |
TestLogBlock |
beginTestcase(java.lang.String description,
RestrictorList testPoint)
Begins a testcase block. |
TestLogBlock |
beginTestGroup(java.lang.String description)
Begins a test group block. |
TestLogBlock |
beginWarning(java.lang.String str)
Writes a warning message to the log file, increments the warning count, and opens a block that will contain additional warning information. |
void |
debug(java.lang.String str)
Logs a debugging statement as a separate line, prefixed with "# ". |
void |
endBlock()
Ends the current block. |
void |
endBlock(TestLogBlock block)
Ends the current block, which must be given. |
void |
endError(TestLogBlock errBlock)
Ends an error block that was begun by a call to beginError. |
void |
endTestcase(TestLogBlock blk,
TestStatus status)
Ends a testcase block. |
void |
endTestGroup(TestLogBlock blk)
Ends a test group block. |
void |
endWarning(TestLogBlock errBlock)
Ends an warning block that was begun by a call to beginWarning. |
java.io.Writer |
getAROlog(java.lang.String serverDesc)
Returns a stream to be used by an AROremoteServer object
for logging ARO events in this test log. |
TestLogBlock |
getBlock()
Returns the current block. |
java.lang.String |
getPath()
Returns the full path of the log file. |
java.io.Writer |
getUIlog(java.lang.String appDesc)
Returns a stream to be used for logging UI activity in this test log. |
void |
log(java.lang.String str)
Writes a string to the log file. |
void |
logDateTime()
Writes the current date & time to the log file in a standard format. |
void |
logDateTime(java.util.Date d)
Writes a date & time to the log file in the following standard format: |
void |
logError(java.lang.String str)
Writes an error message to the log file and increments the error count. |
void |
logException(java.lang.Throwable x)
Writes an exception message to the log file and increments the error count. |
void |
logFile(java.lang.String name,
java.lang.String descr)
Writes the name of an associated file. |
void |
logLine(java.lang.String str)
Writes a string to the log file as a separate line. |
void |
logStackTrace(java.lang.Throwable x)
Logs the stack trace for the given exception. |
void |
logSummary()
Writes summary information about the current block. |
void |
logSummary(java.lang.String descr)
Writes summary information about the current block. |
void |
logTestcaseSummary()
Writes testcase summary information about the current block. |
void |
logWarning(java.lang.String str)
Writes a warning message to the log file and increments the warning count. |
void |
patch(TestLogInternal.PatchPoint pp,
java.lang.String newString)
Patches a previously written portion of the file. |
TestLogInternal.PatchPoint |
preparePatch(java.lang.String placeHolder)
Prepares a spot for back-patching. |
void |
restoreBlock(TestLogBlock block)
Restores the block context. |
void |
setLineBreakChars(java.lang.String before,
java.lang.String after)
Sets line break characters for wrapping long lines for the current block. |
int |
setMaxWidth(int chars)
Sets the maximum physical line width in characters. |
void |
setTabs(int[] tabs)
Sets tab stops for the current block. |
void |
setTabs(int count,
int spacing)
Sets equal tab stops for the current block. |
protected void |
startLine()
Outputs a newline if we're not already at the beginning of a line. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public boolean echoToConsole
System.out).public boolean autoFlush
-autoflush command
line parameter defined by the TestProgram class.protected TestLogBlock currentBlock
protected TestLogBlock outermostBlock
| Constructor Detail |
public TestLogInternal(java.lang.String fileName)
throws java.io.IOException
fileName
public TestLogInternal(java.lang.String fileName,
boolean append)
throws java.io.IOException
fileNameappend| Method Detail |
public void log(java.lang.String str)
throws java.io.IOException
log in interface TestLog
str
protected void startLine()
throws java.io.IOException
public void logLine(java.lang.String str)
throws java.io.IOException
logLine in interface TestLog
str
public void logDateTime(java.util.Date d)
throws java.io.IOException
TestLog
YYYY-MM-DD HH:MM:SS
Always use this method to write dates & times, so that they can be read from the log by post-processing programs.
logDateTime in interface TestLog
satin.testing.TestLog
d
public void logDateTime()
throws java.io.IOException
TestLog
logDateTime in interface TestLog
public void logFile(java.lang.String name,
java.lang.String descr)
throws java.io.IOException
TestLog
logFile in interface TestLog
satin.testing.TestLog
namedescr
public void debug(java.lang.String str)
throws java.io.IOException
TestLog
debug in interface TestLog
public TestLogInternal.PatchPoint preparePatch(java.lang.String placeHolder)
throws java.io.IOException
patch to alter parts of the
log after they have been written, such as summary info.
Do not use tabs or newlines in the place holder string.
placeHolderpatch.
public void patch(TestLogInternal.PatchPoint pp,
java.lang.String newString)
throws java.io.IOException
preparePatch to alter parts
of the log after they have been written, such as summary info.
Do not use tabs or newlines in the new string.
Do not write more characters than there were in the place holder.
pppreparePatch.newString
public void logError(java.lang.String str)
throws java.io.IOException
TestLog
beginError and
endError instead of
logError.
logError in interface TestLog
satin.testing.TestLog
str
public TestLogBlock beginError(java.lang.String str)
throws java.io.IOException
TestLog
endError.
If you have no additional data to associate with this error, use
logError instead.
beginError in interface TestLog
satin.testing.TestLog
strendError.
public void endError(TestLogBlock errBlock)
throws java.io.IOException
TestLog
beginError.
endError in interface TestLog
satin.testing.TestLog
errBlockbeginError.
public void logWarning(java.lang.String str)
throws java.io.IOException
TestLog
logWarning in interface TestLog
satin.testing.TestLog
str
public TestLogBlock beginWarning(java.lang.String str)
throws java.io.IOException
TestLog
endWarning.
If you have no additional data to associate with this warning, use
logWarning instead.
beginWarning in interface TestLog
satin.testing.TestLog
strendWarning.
public void endWarning(TestLogBlock errBlock)
throws java.io.IOException
TestLog
beginWarning.
endWarning in interface TestLog
satin.testing.TestLog
warningBlockbeginWarning.
public void logException(java.lang.Throwable x)
throws java.io.IOException
TestLog
Scripts should normally not need to log exceptions; exceptions should normally be left for the testing infrastructure to catch and report.
logException in interface TestLog
satin.testing.TestLog
x
public void logStackTrace(java.lang.Throwable x)
throws java.io.IOException
public TestLogBlock beginBlock(java.lang.String title)
throws java.io.IOException
endBlock.
beginBlock in interface TestLog
the
public TestLogBlock beginBlock(int type,
java.lang.String title)
throws java.io.IOException
endBlock.
thethe
public void endBlock(TestLogBlock block)
throws java.io.IOException
endBlock in interface TestLog
block
public void endBlock()
throws java.io.IOException
public void restoreBlock(TestLogBlock block)
restoreBlock in interface TestLog
blockpublic TestLogBlock getBlock()
public TestLogBlock beginTestcase(java.lang.String description,
RestrictorList testPoint)
throws java.io.IOException
Testcase class.
public void endTestcase(TestLogBlock blk,
TestStatus status)
throws java.io.IOException
Testcase class.
public TestLogBlock beginTestGroup(java.lang.String description)
throws java.io.IOException
TestGroup class.
public void endTestGroup(TestLogBlock blk)
throws java.io.IOException
TestGroup class.
public void logSummary(java.lang.String descr)
throws java.io.IOException
descr
public void logTestcaseSummary()
throws java.io.IOException
public void logSummary()
throws java.io.IOException
public java.lang.String getPath()
throws java.io.IOException
public int setMaxWidth(int chars)
setMaxWidth in interface TestLog
satin.testing.TestLog
public void setLineBreakChars(java.lang.String before,
java.lang.String after)
TestLog
setLineBreakChars in interface TestLog
satin.testing.TestLog
beforeafterpublic void setTabs(int[] tabs)
TestLog
setTabs in interface TestLog
satin.testing.TestLog
tabs
public void setTabs(int count,
int spacing)
TestLog
setTabs in interface TestLog
satin.testing.TestLog
countspacingpublic java.io.Writer getAROlog(java.lang.String serverDesc)
AROremoteServer object
for logging ARO events in this test log.
Assign the return value of this method to the aroLog
field of the AROremoteServer.
serverDescpublic java.io.Writer getUIlog(java.lang.String appDesc)
aroLog
field of an AROremoteServer object.
appDesc| Revision History |
7/31/01 Ed Stauff - made changes per code review.
5/15/01 Ed Stauff - made changes per 2nd API review.
3/27/01 Ed Stauff - made changes per API review.
3/22/01 - API reviewed by Test Automation team.
3/16/01 Ed Stauff - replaced SimpleOutputStream with Writer.
3/13/01 Ed Stauff - doc published for initial review.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | CONST | FIELD | CONSTR | METHOD | DETAIL: CONST | FIELD | CONSTR | METHOD | ||||||||
TestLogInternal.java (PRIVATE SOURCES)