com.rational.test.ft.services

Class HTMLLog

  • All Implemented Interfaces:
    ILog, ISimpleLog


    public class HTMLLog
    extends LogExtensionAdapter
    A simple log implementation that writes out the log messages in HTML format. The messages will be written to either System.out or to a file if one is specified and can be opened.
    • Constructor Detail

      • HTMLLog

        public HTMLLog()
        Construct an HTMLLog object.
        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)
    • 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 an html file with the specified name. If this file can not be opened then java.io.IOException is thrown.
        Specified by:
        initLog in class LogExtensionAdapter
        Throws:
        LogException
        Parameters:
        fileName - The name of the html file.
      • 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