|
IBM Rational Functional Tester Version 8.2.1 IBM Rational Functional Tester API Reference Project Version 2.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rational.test.ft.services.SimpleLogAdapter
com.rational.test.ft.services.LogAdapter
public class LogAdapter
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
|
| 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 |
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 |
|---|
public static final java.lang.String spaceDelimeter
| Constructor Detail |
|---|
public LogAdapter(java.lang.String logName)
public LogAdapter()
| Method Detail |
|---|
protected void setTopResult(int result)
public boolean getCurrentScriptResult()
ILog
getCurrentScriptResult in interface ILogpublic boolean getLastScriptResult()
ILog
getLastScriptResult in interface ILogpublic boolean getTestResult()
ILog
getTestResult in interface ILogpublic java.lang.String getLogDirectory()
getLogDirectory in interface ILogpublic java.lang.String getLogFilename()
getLogFilename in interface ILogpublic void setLogDirectory(java.lang.String logDirectory)
public java.lang.String ensureLogDirectory()
public void info(java.lang.String note)
info in interface ILognote - The note to write to the log.
public void scriptStart(java.lang.String name,
IScriptDefinition scriptDef)
scriptStart in interface ILogname - The script name.language - The language used for the script ( i.e. java )
public void scriptEnd(java.lang.String name,
java.lang.String language)
scriptEnd in interface ILogname - The script name.language - The language used for the script ( i.e. java )
public void callScript(java.lang.String name,
java.lang.String language)
callScript in interface ILogname - The script being called.language - The language used for the script ( i.e. java )
public void applicationStart(java.lang.String name,
java.lang.String language)
applicationStart in interface ILogname - The application's name.language - The language used for the script ( i.e. java )
public void applicationStart(java.lang.String name,
int status,
java.lang.String description,
java.lang.String language)
applicationStart in interface ILogname - The application's namestatus - Result of starting the application
(@see ISimpleLog.LOG_FAILUREdescription - Additional text for the status
(e.g. reason for failure)language - The language used for the script ( i.e. java )ISimpleLog.LOG_WARNING,
ISimpleLog.LOG_INFORMATION
public ILogMessage createApplicationStartMessage(java.lang.String name,
int status,
java.lang.String description,
java.lang.String language)
createApplicationStartMessage in interface ILogname - The application's name.status - Result of starting the application
(@see ISimpleLog.LOG_FAILUREdescription - Additional text for the status
(e.g. reason for failure)language - The language used for the script ( i.e. java )
ISimpleLog.LOG_WARNING,
ISimpleLog.LOG_INFORMATION
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)
createApplicationStartMessage in interface ILogname - The application's name.status - Result of starting the application
(@see ISimpleLog.LOG_FAILUREdescription - Additional text for the status
(e.g. reason for failure)language - The language used for the script ( i.e. java )
ISimpleLog.LOG_WARNING,
ISimpleLog.LOG_INFORMATION
public void timerStart(java.lang.String name,
java.lang.String language)
timerStart in interface ILogname - The timer name.language - The language used for the script ( i.e. java )public double getTimerValue(java.lang.String name)
getTimerValue in interface ILogname - The timer name.
public double getTimerAndEnd(java.lang.String name,
java.lang.String language)
getTimerAndEnd in interface ILogname - The timer name.language - The language used for the script ( i.e. java )
public ILogMessage createTimerStartMessage(java.lang.String name,
java.lang.String language)
createTimerStartMessage in interface ILogname - The timer name.language - The language used for the script ( i.e. java )
public void timerEnd(java.lang.String name,
java.lang.String language)
timerEnd in interface ILogname - The timer name.language - The language used for the script ( i.e. java )
public ILogMessage createTimerEndMessage(java.lang.String name,
java.lang.String language)
createTimerEndMessage in interface ILogname - The timer name.language - The language used for the script ( i.e. java )
protected ILogMessage createTimerEndMessage(java.lang.String name,
java.lang.String language,
double delta)
name - The timer name.language - The language used for the script ( i.e. java )
public ILogMessage createVPMessage(int resultCode,
java.lang.String type,
java.lang.String name,
java.lang.String language)
createVPMessage in interface ILogresultCode - 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 )
public void configuration(java.lang.String language)
configuration in interface ILoglanguage - The language used for the script ( i.e. java )public ILogMessage createConfigurationMessage(java.lang.String language)
createConfigurationMessage in interface ILoglanguage - The language used for the script ( i.e. java )
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)
createGUIActionMessage in interface ILogresultCode - The Result code PASS/FAILURE/WARNING/INFOMATIONmethod - The method that is getting called in the AUTmethodSignature - The signature of the methodargs - The arguments passed to the methodtestObjectRole - The role of the test objecttestObjectName - The test object name
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)
createAssignActionMessage in interface ILogresultCode - The Result code PASS/FAILURE/WARNING/INFOMATIONmethod - The method that is getting called in the AUTmethodSignature - The signature of the methodargs - The arguments passed to the methodtestObjectRole - The role of the test objecttestObjectName - The test object namereturnValue - Returned value of the methodpropName - Property name
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)
createGUIActionMessage in interface ILogresultCode - The Result code PASS/FAILURE/WARNING/INFOMATIONmethod - The method that is getting called in the AUTmethodSignature - The signature of the methodargs - The arguments passed to the methodtestObjectRole - The role of the test objecttestObjectName - The test object namescreenSnapshot - The screen snapshot.
public void writeGUIAction(ILogMessage message)
writeGUIAction in interface ILogmessage - The Gui Action Message
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)
exception in interface ILog
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)
exception in interface ILog
public ILogMessage createTestResultMessage(java.lang.String headline,
boolean passed,
java.lang.String additionalInfo)
createTestResultMessage in interface ILogheadline - The headline describing the testpassed - A boolean indicating if the test
passed or failed.additionalInfo - Additional information about the testpublic boolean viewerKnowsHowToBringUpComparator()
viewerKnowsHowToBringUpComparator in interface ILogprotected int getNextUserSnapshotNumber()
protected java.lang.String getNextUserSnapshotName()
public void setLogName(java.lang.String log_Name)
public java.lang.String getLogName()
protected java.lang.String getScreenShotFile(java.lang.String scriptName)
public void setLogGUIAction(boolean logGuiAction)
setLogGUIAction in interface ILoglogGuiAction - true if the Gui Action is to be loggedpublic boolean isLogGuiActionEnabled(java.lang.String methodName)
isLogGuiActionEnabled in interface ILogpublic void setLogScreenSnapshotAction(boolean logSanpShot)
setLogScreenSnapshotAction in interface ILoglogSanpShot - true if the Screen Snapshot for Gui Action is to be loggedpublic boolean isLogScreenSnapshotActionEnabled()
isLogScreenSnapshotActionEnabled in interface ILogpublic void setCurrentLogFilter(int filterLevel)
setCurrentLogFilter in interface ILogfilterLevel - -1 - Disable logging
0 - Log only Failures
1 - Log Failures & Warnings
2 - Log Failures, Warnings & Pass
3 - Log Failures, Warnings, Pass & Information (Default)public final int getCurrentLogFilter()
getCurrentLogFilter in interface ILog
protected boolean isLoggingEnabled(int resultCode,
int eventCode)
resultCode - The resultCode (PASS/WARNING/INFORMATION/FAILURE)eventCode - The events to check (APPLICATION_START,SCRIPT_START etc..)
protected DatapoolStore getCurrentDatapool()
public final void logRootException(java.lang.String scriptName,
java.lang.String language,
java.lang.String msg,
java.lang.Throwable e,
java.lang.String headline)
logRootException in interface ILogscriptName - The script namelanguage - The language usedmsg - The localized messagee - The Throwable objectpublic final boolean shouldBringUpLog()
openLogViewerpublic static TestElement getSimplifiedScriptElement(int ssLine)
protected static java.lang.String getSSGroupForLine(int ssLine)
public void setLogType(java.lang.String logType)
logType - The log typepublic final java.lang.String getLogType()
getLogType in interface ILogpublic void setScriptPlaybackParams(IScriptPlaybackParams scriptPlaybackParams)
scriptPlaybackParams - public IScriptPlaybackParams getScriptPlaybackParams()
public final ILogMessage createMessage()
createMessage in interface ISimpleLogcreateMessage in class SimpleLogAdapter
public final ILogMessage createMessage(int resultCode,
int eventCode,
java.lang.String headline)
createMessage in interface ISimpleLogcreateMessage in class SimpleLogAdapterresultCode - One of the LOG_ codes.eventCode - One of the EVENT_ codes.headline - Simple (one line) description of the message
being specified.public final void appendLogProperties(ILogMessage logMessage)
logMessage - The LogMessagepublic final ILogMessage createLogParticipantMessage()
public final void processPreGuiAction(ClientTestObject clientTestObject,
ILogMessage logMessage)
processPreGuiAction in interface ILogclientTestObject - logMessage - public final void processPostGuiAction(ILogMessage logMessage)
processPostGuiAction in interface ILoglogMessage - public final ILogMessage getSummaryEvent(java.lang.String key)
key - The Key. Refer ILog documentation
public final java.lang.String getScriptName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||