Package org.testng
Class Reporter
java.lang.Object
org.testng.Reporter
This class is used for test methods to log messages that will be included in the HTML reports
generated by TestNG.
Implementation details
The reporter keeps a combined output of strings (in m_output) and also a record of which method output which line. In order to do this, callers specify what the current method is with setCurrentTestResult() and the Reporter maintains a mapping of each test result with a list of integers. These integers are indices in the combined output (avoids duplicating the output).
Implementation details
The reporter keeps a combined output of strings (in m_output) and also a record of which method output which line. In order to do this, callers specify what the current method is with setCurrentTestResult() and the Reporter maintains a mapping of each test result with a list of integers. These integers are indices in the combined output (avoids duplicating the output).
Created on Nov 2, 2005
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Erase the content of all the output generated so far.static ITestResult
static boolean
getOutput
(ITestResult tr) static void
Log the passed string to the HTML reports.static void
Log the passed string to the HTML reports.static void
Log the passed string to the HTML reports if the current verbosity is equal to or greater than the one passed as a parameter.static void
Log the passed string to the HTML reports if the current verbosity is equal to or greater than the one passed as a parameter.static void
static void
setEscapeHtml
(boolean escapeHtml)
-
Constructor Details
-
Reporter
public Reporter()
-
-
Method Details
-
setCurrentTestResult
-
getOutput
-
clear
public static void clear()Erase the content of all the output generated so far. -
getEscapeHtml
public static boolean getEscapeHtml()- Returns:
- If true, use HTML entities for special HTML characters (<, >, &, ...).
-
setEscapeHtml
public static void setEscapeHtml(boolean escapeHtml) - Parameters:
escapeHtml
- If true, use HTML entities for special HTML characters (<, >, &, ...).
-
log
Log the passed string to the HTML reports.- Parameters:
s
- The message to log
-
log
Log the passed string to the HTML reports if the current verbosity is equal to or greater than the one passed as a parameter. If logToStandardOut is true, the string will also be printed on standard out.- Parameters:
s
- The message to loglevel
- The verbosity of this messagelogToStandardOut
- Whether to print this string on standard out too
-
log
Log the passed string to the HTML reports. If logToStandardOut is true, the string will also be printed on standard out.- Parameters:
s
- The message to loglogToStandardOut
- Whether to print this string on standard out too
-
log
Log the passed string to the HTML reports if the current verbosity is equal to or greater than the one passed as a parameter.- Parameters:
s
- The message to loglevel
- The verbosity of this message
-
getCurrentTestResult
- Returns:
- the current test result.
-
getOutput
-