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

Project Version 2.3

com.rational.test.ft.services
Class LogAdapter

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

public class LogAdapter
extends SimpleLogAdapter
implements ILog

The base implementation of the log methods for script playback. NOTE - DO NOT extend this without looking carefully at the result propagation logic - if write gets called and we don't see it, the event will not affect the script!


Field Summary
static java.lang.String 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
LogAdapter()
          Constructor
LogAdapter(java.lang.String logName)
           
 
Method Summary
 void appendLogProperties(ILogMessage logMessage)
          Custom Log Participants can append log properties to the events they are interested at.
 void applicationStart(java.lang.String name, int status, java.lang.String description, java.lang.String language)
          Writes an application start message into the log.
 void applicationStart(java.lang.String name, java.lang.String language)
          Write an application start message into the log.
 void callScript(java.lang.String name, java.lang.String language)
          Write a calling script message into the log.
 void configuration(java.lang.String language)
          Write the system configuration into the log.
 ILogMessage createApplicationStartMessage(java.lang.String name, int status, java.lang.String description, java.lang.String language)
          Return a application start message.
 ILogMessage createApplicationStartMessage(java.lang.String symbolicName, java.lang.String description, java.lang.String language, java.lang.String appType, java.lang.String executable, java.lang.String workingDirectory, java.lang.String arguments, java.lang.String JvmVersion)
          Return a application start message.
 ILogMessage createAssignActionMessage(int resultCode, java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args, java.lang.String testObjectRole, java.lang.String testObjectName, java.lang.Object returnValue, java.lang.String propName)
          Creates a GUI Action message.
 ILogMessage createConfigurationMessage(java.lang.String language)
          Create a system configuration message.
 ILogMessage createGUIActionMessage(int resultCode, java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args, java.lang.String testObjectRole, java.lang.String testObjectName)
          Creates a GUI Action message.
 ILogMessage createGUIActionMessage(int resultCode, java.lang.String method, java.lang.String methodSignature, java.lang.Object[] args, java.lang.String testObjectRole, java.lang.String testObjectName, java.awt.image.BufferedImage screenSnapshot)
          Creates a GUI Action message.
 ILogMessage createLogParticipantMessage()
          Create an instance of a log message for custom log participants.
 ILogMessage createMessage()
          Create an instance of a log message.
 ILogMessage createMessage(int resultCode, int eventCode, java.lang.String headline)
          Create an instance of a log message specifying the status, event and note.
 ILogMessage createTestResultMessage(java.lang.String headline, boolean passed, java.lang.String additionalInfo)
          Creates a test result message.
 ILogMessage createTimerEndMessage(java.lang.String name, java.lang.String language)
          Return an end timer message.
protected  ILogMessage createTimerEndMessage(java.lang.String name, java.lang.String language, double delta)
          Return an end timer message.
 ILogMessage createTimerStartMessage(java.lang.String name, java.lang.String language)
          Return a start timer message.
 ILogMessage createVPMessage(int resultCode, java.lang.String type, java.lang.String name, java.lang.String language)
          Return a verification point message.
 java.lang.String ensureLogDirectory()
          Returns the directory the log is being written to.
 void exception(java.lang.String note, java.lang.String context, java.lang.String throwableName, java.lang.String throwableMessage, java.lang.String scriptName, int line, java.lang.String stackTrace, java.lang.String language)
          Write an exception message.
 void exception(java.lang.String note, java.lang.String context, java.lang.String throwableName, java.lang.String throwableMessage, java.lang.String scriptName, int line, java.lang.String stackTrace, java.lang.String language, java.awt.image.BufferedImage screenSnapshot)
          Write an exception message.
protected  DatapoolStore getCurrentDatapool()
           
 int getCurrentLogFilter()
          Return the current log filter level.
 boolean getCurrentScriptResult()
          Returns the result of the current script.
 boolean getLastScriptResult()
          Returns the result of the last script that had ended.
 java.lang.String getLogDirectory()
          Returns the directory the log is being written to.
 java.lang.String getLogFilename()
          Returns the name of the log filename including the file extension but no directory.
 java.lang.String getLogName()
           
 java.lang.String getLogType()
          Return the type for the log
protected  java.lang.String getNextUserSnapshotName()
          As the user logs snapshots we need to generate unique names for them.
protected  int getNextUserSnapshotNumber()
          As the user logs snapshots we need to generate unique names for them.
protected  java.lang.String getScreenShotFile(java.lang.String scriptName)
          As multiple exceptions are caught, unique numbers are needed for the exceptions screensnapshots The method is called by the logs (HTML etc) to obtain the unique name for the exception snapshots.
 java.lang.String getScriptName()
          Return the script name that has initiated the playback of the script
 IScriptPlaybackParams getScriptPlaybackParams()
          Get the ScriptPlaybackParams
static TestElement getSimplifiedScriptElement(int ssLine)
           
protected static java.lang.String getSSGroupForLine(int ssLine)
           
 ILogMessage getSummaryEvent(java.lang.String key)
          Return the events that are very specific and unique to the execution.
 boolean getTestResult()
          Returns the result of the current test.
 double getTimerAndEnd(java.lang.String name, java.lang.String language)
          gets the timer value for the given timer
 double getTimerValue(java.lang.String name)
          gets the timer value for the given timer
 void info(java.lang.String note)
          Writes a simple text informational message into the log.
protected  boolean isLoggingEnabled(int resultCode, int eventCode)
          Return true if the resultCode is within the current log filters.
 boolean isLogGuiActionEnabled(java.lang.String methodName)
          Returns true if Gui Actions are to be logged.
 boolean isLogScreenSnapshotActionEnabled()
          Returns true if Screen Snapshot for Gui Actions are to be logged.
 void logRootException(java.lang.String scriptName, java.lang.String language, java.lang.String msg, java.lang.Throwable e, java.lang.String headline)
          The API can be used if failures occur prior to start of execution of script.
 void processPostGuiAction(ILogMessage logMessage)
          Custom log Participants can add more properties after any Gui Action takes place on the AUT
 void processPreGuiAction(ClientTestObject clientTestObject, ILogMessage logMessage)
          Custom log Participants can cache properties before any Gui Action takes place on the AUT
 void scriptEnd(java.lang.String name, java.lang.String language)
          Write a script end message into the log.
 void scriptStart(java.lang.String name, IScriptDefinition scriptDef)
          Write a script start message into the log.
 void setCurrentLogFilter(int filterLevel)
          Set the log filter for the playback.
 void setLogDirectory(java.lang.String logDirectory)
          Sets the directory the log is beging written to.
 void setLogGUIAction(boolean logGuiAction)
          Sets the option to log the GUI Action during playback
 void setLogName(java.lang.String log_Name)
           
 void setLogScreenSnapshotAction(boolean logSanpShot)
          Sets the option to log the Screen Snapshot for GUI Action during playback
 void setLogType(java.lang.String logType)
          Set the log type for the Log
 void setScriptPlaybackParams(IScriptPlaybackParams scriptPlaybackParams)
          Set the ScriptPlaybackParams
protected  void setTopResult(int result)
          set the top result on the results stack.
 boolean shouldBringUpLog()
          Returns true if the log viewer is to be opened at the end of the command line playback.
 void timerEnd(java.lang.String name, java.lang.String language)
          Write an end timer message into the log.
 void timerEnd(java.lang.String name, java.lang.String language, long timerEnd)
          Writes an end-timer message into the log.
 void timerStart(java.lang.String name, java.lang.String language)
          Write a start timer message into the log.
 boolean viewerKnowsHowToBringUpComparator()
          This answers yes/no whether the log-viewer associated with this log knows how to bring up our comparator.
 void writeGUIAction(ILogMessage message)
          Writes an Gui Action message in the log
 
Methods inherited from class com.rational.test.ft.services.SimpleLogAdapter
close, open, openLogViewer, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rational.test.ft.services.ISimpleLog
close, open, openLogViewer, write, write
 

Field Detail

spaceDelimeter

public static final java.lang.String spaceDelimeter
See Also:
Constant Field Values
Constructor Detail

LogAdapter

public LogAdapter(java.lang.String logName)

LogAdapter

public LogAdapter()
Constructor

Method Detail

setTopResult

protected void setTopResult(int result)
set the top result on the results stack. Note that this can make the result worse, but never better. If we set the result failure, we push the result through to ALL results on the result stack.


getCurrentScriptResult

public boolean getCurrentScriptResult()
Description copied from interface: ILog
Returns the result of the current script. It returns false if there is any failure and true if there are no failures. The result includes the result of the scripts that this script had called.

Specified by:
getCurrentScriptResult in interface ILog
Returns:
boolean

getLastScriptResult

public boolean getLastScriptResult()
Description copied from interface: ILog
Returns the result of the last script that had ended. It returns false if there is any failure and true if there are no failures. The result includes the result of the scripts that the last script had called. It returns true if no script had ended.

Specified by:
getLastScriptResult in interface ILog
Returns:
boolean

getTestResult

public boolean getTestResult()
Description copied from interface: ILog
Returns the result of the current test. It returns false if there is any failure and true if there are no failures. The result includes the result of all the scripts that are executed in the current run.

Specified by:
getTestResult in interface ILog
Returns:
boolean

getLogDirectory

public java.lang.String getLogDirectory()
Returns the directory the log is being written to. This is actually just used by the VP code to decide where to write expected/actual files. Note we may split the concept of "where the log is being written to" and "where VP files should be written" at some later time. The LogAdapter base class returns the datastore log folder for this, so if special handling needs to be done (eg for TM and TSS logs) you should override the method with a real answer. The VP logic does handle null though, and writes expected/actuals to the datastore directory in that case.

Specified by:
getLogDirectory in interface ILog
Since:
RFT1.0

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
Since:
RFT2.0

setLogDirectory

public void setLogDirectory(java.lang.String logDirectory)
Sets the directory the log is beging written to.


ensureLogDirectory

public java.lang.String ensureLogDirectory()
Returns the directory the log is being written to. Ensures that the directory exists, and tries to empty it.


info

public void info(java.lang.String note)
Writes a simple text informational message into the log.

Specified by:
info in interface ILog
Parameters:
note - The note to write to the log.
Since:
RFT1.0

scriptStart

public void scriptStart(java.lang.String name,
                        IScriptDefinition scriptDef)
Write a script start message into the log.

Specified by:
scriptStart in interface ILog
Parameters:
name - The script name.
language - The language used for the script ( i.e. java )

scriptEnd

public void scriptEnd(java.lang.String name,
                      java.lang.String language)
Write a script end message into the log.

Specified by:
scriptEnd in interface ILog
Parameters:
name - The script name.
language - The language used for the script ( i.e. java )

callScript

public void callScript(java.lang.String name,
                       java.lang.String language)
Write a calling script message into the log.

Specified by:
callScript in interface ILog
Parameters:
name - The script being called.
language - The language used for the script ( i.e. java )

applicationStart

public void applicationStart(java.lang.String name,
                             java.lang.String language)
Write an application start message into the log.

Specified by:
applicationStart in interface ILog
Parameters:
name - The application's name.
language - The language used for the script ( i.e. java )

applicationStart

public void applicationStart(java.lang.String name,
                             int status,
                             java.lang.String description,
                             java.lang.String language)
Writes an application start message into the log.

Specified by:
applicationStart in interface ILog
Parameters:
name - The application's name
status - Result of starting the application (@see ISimpleLog.LOG_FAILURE
description - Additional text for the status (e.g. reason for failure)
language - The language used for the script ( i.e. java )
Since:
RFT1.0
See Also:
ISimpleLog.LOG_WARNING, ISimpleLog.LOG_INFORMATION

createApplicationStartMessage

public ILogMessage createApplicationStartMessage(java.lang.String name,
                                                 int status,
                                                 java.lang.String description,
                                                 java.lang.String language)
Return a application start message. This interface allows the caller to add detailed information and then write the message.

Specified by:
createApplicationStartMessage in interface ILog
Parameters:
name - The application's name.
status - Result of starting the application (@see ISimpleLog.LOG_FAILURE
description - Additional text for the status (e.g. reason for failure)
language - The language used for the script ( i.e. java )
Returns:
An application start message.
See Also:
ISimpleLog.LOG_WARNING, ISimpleLog.LOG_INFORMATION

createApplicationStartMessage

public ILogMessage createApplicationStartMessage(java.lang.String symbolicName,
                                                 java.lang.String description,
                                                 java.lang.String language,
                                                 java.lang.String appType,
                                                 java.lang.String executable,
                                                 java.lang.String workingDirectory,
                                                 java.lang.String arguments,
                                                 java.lang.String JvmVersion)
Return a application start message. This interface allows the caller to add detailed information and then write the message.

Specified by:
createApplicationStartMessage in interface ILog
Parameters:
name - The application's name.
status - Result of starting the application (@see ISimpleLog.LOG_FAILURE
description - Additional text for the status (e.g. reason for failure)
language - The language used for the script ( i.e. java )
Returns:
An application start message.
See Also:
ISimpleLog.LOG_WARNING, ISimpleLog.LOG_INFORMATION

timerStart

public void timerStart(java.lang.String name,
                       java.lang.String language)
Write a start timer message into the log.

Specified by:
timerStart in interface ILog
Parameters:
name - The timer name.
language - The language used for the script ( i.e. java )

getTimerValue

public double getTimerValue(java.lang.String name)
gets the timer value for the given timer

Specified by:
getTimerValue in interface ILog
Parameters:
name - The timer name.
Returns:
timerValue The timer value.

getTimerAndEnd

public double getTimerAndEnd(java.lang.String name,
                             java.lang.String language)
gets the timer value for the given timer

Specified by:
getTimerAndEnd in interface ILog
Parameters:
name - The timer name.
language - The language used for the script ( i.e. java )
Returns:
timerValue The timer value.

createTimerStartMessage

public ILogMessage createTimerStartMessage(java.lang.String name,
                                           java.lang.String language)
Return a start timer message. This interface allows the caller to add detailed information and then write the message.

Specified by:
createTimerStartMessage in interface ILog
Parameters:
name - The timer name.
language - The language used for the script ( i.e. java )
Returns:
A timer start message. This message has the result, event, and note initialized.

timerEnd

public void timerEnd(java.lang.String name,
                     java.lang.String language)
Write an end timer message into the log.

Specified by:
timerEnd in interface ILog
Parameters:
name - The timer name.
language - The language used for the script ( i.e. java )

timerEnd

public void timerEnd(java.lang.String name,
                     java.lang.String language,
                     long timerEnd)
Writes an end-timer message into the log.

Specified by:
timerEnd in interface ILog
Parameters:
name - The timer name
language - The language used for the script ( i.e. java )
timerEnd - The time to end the timer
Since:
RFT8.2.1ifix1

createTimerEndMessage

public ILogMessage createTimerEndMessage(java.lang.String name,
                                         java.lang.String language)
Return an end timer message. This interface allows the caller to add detailed information and then write the message.

Specified by:
createTimerEndMessage in interface ILog
Parameters:
name - The timer name.
language - The language used for the script ( i.e. java )
Returns:
A timer end message. This message has the result, event, and note initialized.

createTimerEndMessage

protected ILogMessage createTimerEndMessage(java.lang.String name,
                                            java.lang.String language,
                                            double delta)
Return an end timer message. This interface allows the caller to add detailed information and then write the message.

Parameters:
name - The timer name.
language - The language used for the script ( i.e. java )
Returns:
A timer end message. This message has the result, event, and note initialized.

createVPMessage

public ILogMessage createVPMessage(int resultCode,
                                   java.lang.String type,
                                   java.lang.String name,
                                   java.lang.String language)
Return a verification point message. This method allows the caller to add detailed information and then write the message.

Specified by:
createVPMessage in interface ILog
Parameters:
resultCode - One of the ILog.LOG_ codes.
type - One of the VP_TYPE_ codes.
name - The verification point name.
language - The language used for the script ( i.e. java )
Returns:
A verification point message. This message has the result, event, and note initialized.

configuration

public void configuration(java.lang.String language)
Write the system configuration into the log. This method reads the configuration from the "system" utility and logs it.

Specified by:
configuration in interface ILog
Parameters:
language - The language used for the script ( i.e. java )

createConfigurationMessage

public ILogMessage createConfigurationMessage(java.lang.String language)
Create a system configuration message. This method allows the caller to add detailed information and then write the message.

Specified by:
createConfigurationMessage in interface ILog
Parameters:
language - The language used for the script ( i.e. java )
Returns:
A configuration message. This message has the result, event, and note initialized.

createGUIActionMessage

public ILogMessage createGUIActionMessage(int resultCode,
                                          java.lang.String method,
                                          java.lang.String methodSignature,
                                          java.lang.Object[] args,
                                          java.lang.String testObjectRole,
                                          java.lang.String testObjectName)
Creates a GUI Action message. This method allows the caller to add detailed information and then write the message.

Specified by:
createGUIActionMessage in interface ILog
Parameters:
resultCode - The Result code PASS/FAILURE/WARNING/INFOMATION
method - The method that is getting called in the AUT
methodSignature - The signature of the method
args - The arguments passed to the method
testObjectRole - The role of the test object
testObjectName - The test object name
Returns:

createAssignActionMessage

public ILogMessage createAssignActionMessage(int resultCode,
                                             java.lang.String method,
                                             java.lang.String methodSignature,
                                             java.lang.Object[] args,
                                             java.lang.String testObjectRole,
                                             java.lang.String testObjectName,
                                             java.lang.Object returnValue,
                                             java.lang.String propName)
Creates a GUI Action message. This method allows the caller to add detailed information and then write the message.

Specified by:
createAssignActionMessage in interface ILog
Parameters:
resultCode - The Result code PASS/FAILURE/WARNING/INFOMATION
method - The method that is getting called in the AUT
methodSignature - The signature of the method
args - The arguments passed to the method
testObjectRole - The role of the test object
testObjectName - The test object name
returnValue - Returned value of the method
propName - Property name
Returns:

createGUIActionMessage

public ILogMessage createGUIActionMessage(int resultCode,
                                          java.lang.String method,
                                          java.lang.String methodSignature,
                                          java.lang.Object[] args,
                                          java.lang.String testObjectRole,
                                          java.lang.String testObjectName,
                                          java.awt.image.BufferedImage screenSnapshot)
Creates a GUI Action message. This method allows the caller to add detailed information and then write the message.

Specified by:
createGUIActionMessage in interface ILog
Parameters:
resultCode - The Result code PASS/FAILURE/WARNING/INFOMATION
method - The method that is getting called in the AUT
methodSignature - The signature of the method
args - The arguments passed to the method
testObjectRole - The role of the test object
testObjectName - The test object name
screenSnapshot - The screen snapshot.
Returns:

writeGUIAction

public void writeGUIAction(ILogMessage message)
Writes an Gui Action message in the log

Specified by:
writeGUIAction in interface ILog
Parameters:
message - The Gui Action Message

exception

public void exception(java.lang.String note,
                      java.lang.String context,
                      java.lang.String throwableName,
                      java.lang.String throwableMessage,
                      java.lang.String scriptName,
                      int line,
                      java.lang.String stackTrace,
                      java.lang.String language)
Write an exception message. Include the classname, the detail message and the stack as three separate properties.

Specified by:
exception in interface ILog

exception

public void exception(java.lang.String note,
                      java.lang.String context,
                      java.lang.String throwableName,
                      java.lang.String throwableMessage,
                      java.lang.String scriptName,
                      int line,
                      java.lang.String stackTrace,
                      java.lang.String language,
                      java.awt.image.BufferedImage screenSnapshot)
Write an exception message. Include the classname, the detail message and the stack as three separate properties. Also include a screen snapshot taken at the time of the exception.

Specified by:
exception in interface ILog

createTestResultMessage

public ILogMessage createTestResultMessage(java.lang.String headline,
                                           boolean passed,
                                           java.lang.String additionalInfo)
Creates a test result message.

Specified by:
createTestResultMessage in interface ILog
Parameters:
headline - The headline describing the test
passed - A boolean indicating if the test passed or failed.
additionalInfo - Additional information about the test
Since:
RFT1.0

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

getNextUserSnapshotNumber

protected int getNextUserSnapshotNumber()
As the user logs snapshots we need to generate unique names for them. This increases a count used to identify the snapshot file.


getNextUserSnapshotName

protected java.lang.String getNextUserSnapshotName()
As the user logs snapshots we need to generate unique names for them. This increases a count used to identify the snapshot file and returns the unique name.


setLogName

public void setLogName(java.lang.String log_Name)

getLogName

public java.lang.String getLogName()

getScreenShotFile

protected java.lang.String getScreenShotFile(java.lang.String scriptName)
As multiple exceptions are caught, unique numbers are needed for the exceptions screensnapshots The method is called by the logs (HTML etc) to obtain the unique name for the exception snapshots.


setLogGUIAction

public void setLogGUIAction(boolean logGuiAction)
Sets the option to log the GUI Action during playback

Specified by:
setLogGUIAction in interface ILog
Parameters:
logGuiAction - true if the Gui Action is to be logged

isLogGuiActionEnabled

public boolean isLogGuiActionEnabled(java.lang.String methodName)
Returns true if Gui Actions are to be logged.

Specified by:
isLogGuiActionEnabled in interface ILog
Returns:
true if GUI Actions are to be logged.

setLogScreenSnapshotAction

public void setLogScreenSnapshotAction(boolean logSanpShot)
Sets the option to log the Screen Snapshot for GUI Action during playback

Specified by:
setLogScreenSnapshotAction in interface ILog
Parameters:
logSanpShot - true if the Screen Snapshot for Gui Action is to be logged

isLogScreenSnapshotActionEnabled

public boolean isLogScreenSnapshotActionEnabled()
Returns true if Screen Snapshot for Gui Actions are to be logged.

Specified by:
isLogScreenSnapshotActionEnabled in interface ILog
Returns:
true if Screen Snapshot for GUI Actions are to be logged.

setCurrentLogFilter

public void setCurrentLogFilter(int filterLevel)
Set the log filter for the playback. If invalid values are given, then the default setting is used

Specified by:
setCurrentLogFilter in interface ILog
Parameters:
filterLevel - -1 - Disable logging 0 - Log only Failures 1 - Log Failures & Warnings 2 - Log Failures, Warnings & Pass 3 - Log Failures, Warnings, Pass & Information (Default)

getCurrentLogFilter

public final int getCurrentLogFilter()
Return the current log filter level.

Specified by:
getCurrentLogFilter in interface ILog
Returns:
The filter level -1 - Disable logging 0 - Log only Failures 1 - Log Failures & Warnings 2 - Log Failures, Warnings & Pass 3 - Log Failures, Warnings, Pass & Information (Default)

isLoggingEnabled

protected boolean isLoggingEnabled(int resultCode,
                                   int eventCode)
Return true if the resultCode is within the current log filters.

Parameters:
resultCode - The resultCode (PASS/WARNING/INFORMATION/FAILURE)
eventCode - The events to check (APPLICATION_START,SCRIPT_START etc..)
Returns:
true if event code is either of SCRIPT_START or SCRIPT_END, or the result is within the current log filter level

getCurrentDatapool

protected DatapoolStore getCurrentDatapool()

logRootException

public final void logRootException(java.lang.String scriptName,
                                   java.lang.String language,
                                   java.lang.String msg,
                                   java.lang.Throwable e,
                                   java.lang.String headline)
The API can be used if failures occur prior to start of execution of script.

Specified by:
logRootException in interface ILog
Parameters:
scriptName - The script name
language - The language used
msg - The localized message
e - The Throwable object

shouldBringUpLog

public final boolean shouldBringUpLog()
Returns true if the log viewer is to be opened at the end of the command line playback.

Returns:
true if the log is to be opened, false otherwise
Since:
RFT 8.0
See Also:
openLogViewer

getSimplifiedScriptElement

public static TestElement getSimplifiedScriptElement(int ssLine)

getSSGroupForLine

protected static java.lang.String getSSGroupForLine(int ssLine)

setLogType

public void setLogType(java.lang.String logType)
Set the log type for the Log

Parameters:
logType - The log type

getLogType

public final java.lang.String getLogType()
Return the type for the log

Specified by:
getLogType in interface ILog
Returns:

setScriptPlaybackParams

public void setScriptPlaybackParams(IScriptPlaybackParams scriptPlaybackParams)
Set the ScriptPlaybackParams

Parameters:
scriptPlaybackParams -

getScriptPlaybackParams

public IScriptPlaybackParams getScriptPlaybackParams()
Get the ScriptPlaybackParams

Returns:

createMessage

public final ILogMessage createMessage()
Create an instance of a log message. The ILogMessage allows more detailed information to be written to the log file (i.e. name/value pairs).

Specified by:
createMessage in interface ISimpleLog
Overrides:
createMessage in class SimpleLogAdapter

createMessage

public final ILogMessage createMessage(int resultCode,
                                       int eventCode,
                                       java.lang.String headline)
Create an instance of a log message specifying the status, event and note. The ILogMessage allows more detailed information to be written to the log file (i.e. name/value pairs)

Specified by:
createMessage in interface ISimpleLog
Overrides:
createMessage in class SimpleLogAdapter
Parameters:
resultCode - One of the LOG_ codes.
eventCode - One of the EVENT_ codes.
headline - Simple (one line) description of the message being specified.

appendLogProperties

public final void appendLogProperties(ILogMessage logMessage)
Custom Log Participants can append log properties to the events they are interested at.

Parameters:
logMessage - The LogMessage

createLogParticipantMessage

public final ILogMessage createLogParticipantMessage()
Create an instance of a log message for custom log participants. The ILogMessage allows more detailed information to be written to the log file (i.e. name/value pairs).


processPreGuiAction

public final void processPreGuiAction(ClientTestObject clientTestObject,
                                      ILogMessage logMessage)
Custom log Participants can cache properties before any Gui Action takes place on the AUT

Specified by:
processPreGuiAction in interface ILog
Parameters:
clientTestObject -
logMessage -

processPostGuiAction

public final void processPostGuiAction(ILogMessage logMessage)
Custom log Participants can add more properties after any Gui Action takes place on the AUT

Specified by:
processPostGuiAction in interface ILog
Parameters:
logMessage -

getSummaryEvent

public final ILogMessage getSummaryEvent(java.lang.String key)
Return the events that are very specific and unique to the execution.

Parameters:
key - The Key. Refer ILog documentation
Returns:
The ILogMessage for the execution

getScriptName

public final java.lang.String getScriptName()
Return the script name that has initiated the playback of the script

Returns:
The scriptname