IBM Rational Functional Tester
Version 8.2.1
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.services
Class TextLog

java.lang.Object
  extended by com.rational.test.ft.services.SimpleLogAdapter
      extended by com.rational.test.ft.services.LogAdapter
          extended by com.rational.test.ft.services.LogExtensionAdapter
              extended by com.rational.test.ft.services.TextLog
All Implemented Interfaces:
ILog, ISimpleLog

public class TextLog
extends LogExtensionAdapter

A simple log implementation that writes out the log messages in text format. The messages will be written to either System.out or to a file if one is specified and can be opened. This format of the log messages is not compatible with the log viewer format.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.rational.test.ft.services.LogExtensionAdapter
LogExtensionAdapter.ImageMetadata
 
Field Summary
 
Fields inherited from class com.rational.test.ft.services.LogExtensionAdapter
MAX_IMAGE_DIMENSION
 
Fields inherited from class com.rational.test.ft.services.LogAdapter
spaceDelimeter
 
Fields inherited from interface com.rational.test.ft.services.ILog
KEY_POST_EXECUTION_END_MESSAGE, KEY_PRE_EXECUTION_START_MESSAGE, MASKED_PROP_GUI_ACTION_METHOD_ARGS, MASKED_PROP_GUI_ACTION_METHOD_NAME, PROP_ACTUAL, PROP_ADDITIONAL_INFO, PROP_APPLICATION, PROP_APPTYPE, PROP_ARGUMENTS, PROP_ASSIGNEDVARIABLE_NAME, PROP_BASELINE, PROP_BUFFERED_SNAPSHOT, PROP_DATAPOOL_STORE, PROP_DEFAULT_SCRIPT_DATAPOOL_NAME, PROP_ELAPSED_TIME, PROP_EXCEPTION_CONTEXT, PROP_EXCEPTION_MESSAGE, PROP_EXCEPTION_NAME, PROP_EXCEPTION_STACK, PROP_EXECUTABLE, PROP_EXPECTED, PROP_FAILURE_DESCRIPTION, PROP_ITERATION_COUNT, PROP_LINENUMBER, PROP_NAME, PROP_PROPERTY_NAME, PROP_PROPERTY_VALUE, PROP_SCREEN_SNAPSHOT, PROP_SCRIPT_ID, PROP_SCRIPT_NAME, PROP_SCRIPT_SOURCE_UID, PROP_SIMPLIFIEDSCRIPT_GRPNAME, PROP_SIMPLIFIEDSCRIPT_LINE, PROP_SIMPLIFIEDSCRIPT_LINENUMBER, PROP_TESTCASE_DESCRIPTION, PROP_TESTCASE_NAME, PROP_USER_SCREEN_SNAPSHOT, PROP_VP_TYPE, PROP_WORKINGDIRECTORY, SCREEN_SNAPSHOT_FILE_BASE, SCREEN_SNAPSHOT_FILE_EXT, SCREEN_SNAPSHOT_FILE_NAME, USER_SCREEN_SNAPSHOT_FILE_BASE, VP_TYPE_ALPHA_NUM, VP_TYPE_CLIPBOARD, VP_TYPE_FILE_COMPARE, VP_TYPE_FILE_EXIST, VP_TYPE_FULL_IMAGE, VP_TYPE_MENU, VP_TYPE_MODULE_EXIST, VP_TYPE_OBJECT_DATA, VP_TYPE_OBJECT_PROP, VP_TYPE_OCR_IMAGE, VP_TYPE_REGION_IMAGE, VP_TYPE_WEBSITE_COMPARE, VP_TYPE_WEBSITE_SCAN, VP_TYPE_WINDOW_EXIST, VP_TYPE_WINDOW_IMAGE
 
Fields inherited from interface com.rational.test.ft.services.ISimpleLog
DISABLE_LOGGING, EVENT_APPLICATION_END, EVENT_APPLICATION_START, EVENT_APPLICATON_ACTION, EVENT_CALL_SCRIPT, EVENT_CONFIGURATION, EVENT_CUSTOM, EVENT_EXPORT, EVENT_GENERAL, EVENT_SCRIPT_END, EVENT_SCRIPT_START, EVENT_TIMER_END, EVENT_TIMER_START, EVENT_VP, LOG_DISABLE_GUI_ACTION, LOG_DISABLE_GUI_SNAPSHOT_ACTION, LOG_ENABLE_GUI_ACTION, LOG_ENABLE_GUI_SNAPSHOT_ACTION, LOG_FAILURE, LOG_FAILURES, LOG_FAILURES_WARNINGS, LOG_FAILURES_WARNINGS_PASS, LOG_FAILURES_WARNINGS_PASS_INFO, LOG_INFORMATION, LOG_PASS, LOG_WARNING
 
Constructor Summary
TextLog()
           
TextLog(java.lang.String script, java.lang.String logName)
          Default constructor just uses System.out for the PrintStream.
 
Method Summary
 void closeLog()
          This method closes a log file.
 java.lang.String getLogFilename()
          Returns the name of the log filename including the file extension but no directory.
 void initLog()
          This method opens a log file with the specified name.
 boolean openLogViewer()
          The callback function to open the viewer for the log.
 void setPrintDateTime(boolean print)
          Set whether to print the date/time in the log entry
 boolean viewerKnowsHowToBringUpComparator()
          This answers yes/no whether the log-viewer associated with this log knows how to bring up our comparator.
 void writeLog(ILogMessage message)
          Write a message into the log.
 
Methods inherited from class com.rational.test.ft.services.LogExtensionAdapter
applicationStart, applicationStart, callScript, close, configuration, createApplicationStartMessage, createConfigurationMessage, createTestResultMessage, createTimerEndMessage, createTimerStartMessage, createVPMessage, exception, exception, getTimestamp, open, persistImage, scriptEnd, scriptStart, setLogDirectory, setLogName, timerEnd, timerStart, write, write
 
Methods inherited from class com.rational.test.ft.services.LogAdapter
appendLogProperties, createApplicationStartMessage, createAssignActionMessage, createGUIActionMessage, createGUIActionMessage, createLogParticipantMessage, createMessage, createMessage, createTimerEndMessage, ensureLogDirectory, getCurrentDatapool, getCurrentLogFilter, getCurrentScriptResult, getLastScriptResult, getLogDirectory, getLogName, getLogType, getNextUserSnapshotName, getNextUserSnapshotNumber, getScreenShotFile, getScriptName, getScriptPlaybackParams, getSimplifiedScriptElement, getSSGroupForLine, getSummaryEvent, getTestResult, getTimerAndEnd, getTimerValue, info, isLoggingEnabled, isLogGuiActionEnabled, isLogScreenSnapshotActionEnabled, logRootException, processPostGuiAction, processPreGuiAction, setCurrentLogFilter, setLogGUIAction, setLogScreenSnapshotAction, setLogType, setScriptPlaybackParams, setTopResult, shouldBringUpLog, timerEnd, writeGUIAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextLog

public TextLog(java.lang.String script,
               java.lang.String logName)
Default constructor just uses System.out for the PrintStream.

Parameters:
script - The script name (optionally includes package(s))
logname - The subdirectory under logs we will write to (defaults to scriptname if null is passed)

TextLog

public TextLog()
Method Detail

getLogFilename

public java.lang.String getLogFilename()
Returns the name of the log filename including the file extension but no directory.

Specified by:
getLogFilename in interface ILog
Overrides:
getLogFilename in class LogExtensionAdapter
Returns:
Return an empty string
Since:
RFT2.0

initLog

public void initLog()
             throws LogException
This method opens a log file with the specified name. If this Log file can not be opened then java.io.IOException is thrown.

Specified by:
initLog in class LogExtensionAdapter
Throws:
LogException

closeLog

public void closeLog()
This method closes a log file. If the log file is the same as System.out then no action is performed.

Specified by:
closeLog in class LogExtensionAdapter

setPrintDateTime

public void setPrintDateTime(boolean print)
Set whether to print the date/time in the log entry

Parameters:
print - Whether to print the date/time.

writeLog

public void writeLog(ILogMessage message)
Write a message into the log. This interface allows a message with a detailed description to be set in the log file (i.e. name/value pairs).

Specified by:
writeLog in class LogExtensionAdapter
Parameters:
message - The message (i.e. resultCode, eventCode, note, and details)

viewerKnowsHowToBringUpComparator

public boolean viewerKnowsHowToBringUpComparator()
This answers yes/no whether the log-viewer associated with this log knows how to bring up our comparator. The answer is true for TSS log, and false otherwise. This is used to decide whether to do our own bring-up-comparator after playback.

Specified by:
viewerKnowsHowToBringUpComparator in interface ILog
Overrides:
viewerKnowsHowToBringUpComparator in class LogAdapter

openLogViewer

public boolean openLogViewer()
The callback function to open the viewer for the log. Overwrite to open the log at the end of the playback.

Specified by:
openLogViewer in interface ISimpleLog
Overrides:
openLogViewer in class SimpleLogAdapter
Returns:
true, on successfull opening of log viewer, false otherwise