public class ReportNGUtils extends Object
| Constructor and Description |
|---|
ReportNGUtils() |
| Modifier and Type | Method and Description |
|---|---|
String |
escapeHTMLString(String s)
Works like
escapeString(String) but also replaces line breaks with
<br /> tags and preserves significant whitespace. |
String |
escapeString(String s)
Replace any angle brackets, quotes, apostrophes or ampersands with the
corresponding XML/HTML entities to avoid problems displaying the String in
an XML document.
|
String |
formatDuration(long elapsed) |
String |
formatDuration(long startMillis,
long endMillis) |
List<String> |
getAllOutput()
Retieves the output from all calls to
org.testng.Reporter#log(String)
across all tests. |
String |
getArguments(ITestResult result) |
List<Throwable> |
getCauses(Throwable t)
Convert a Throwable into a list containing all of its causes.
|
String |
getDependentGroups(ITestResult result) |
String |
getDependentMethods(ITestResult result) |
long |
getDuration(ITestContext context)
Returns the aggregate of the elapsed times for each test result.
|
long |
getEndTime(ISuite suite,
IInvokedMethod method,
List<IInvokedMethod> methods) |
String |
getSkipExceptionMessage(ITestResult result) |
long |
getStartTime(List<IInvokedMethod> methods)
Find the earliest start time of the specified methods.
|
List<String> |
getTestOutput(ITestResult result)
Retrieves all log messages associated with a particular test result.
|
boolean |
hasArguments(ITestResult result) |
boolean |
hasDependentGroups(ITestResult result) |
boolean |
hasDependentMethods(ITestResult result) |
boolean |
hasGroups(ISuite suite) |
boolean |
hasSkipException(ITestResult result) |
String |
stripThreadName(String threadId)
TestNG returns a compound thread ID that includes the thread name and its numeric ID,
separated by an 'at' sign.
|
public long getDuration(ITestContext context)
context - The test results.public String formatDuration(long startMillis, long endMillis)
public String formatDuration(long elapsed)
public List<Throwable> getCauses(Throwable t)
t - The throwable for which the causes are to be returned.Throwables.public List<String> getTestOutput(ITestResult result)
result - Which test result to look-up.public List<String> getAllOutput()
org.testng.Reporter#log(String)
across all tests.public boolean hasArguments(ITestResult result)
public String getArguments(ITestResult result)
public boolean hasDependentGroups(ITestResult result)
result - The test result to be checked for dependent groups.public String getDependentGroups(ITestResult result)
public boolean hasDependentMethods(ITestResult result)
result - The test result to be checked for dependent methods.public String getDependentMethods(ITestResult result)
public boolean hasSkipException(ITestResult result)
public String getSkipExceptionMessage(ITestResult result)
public boolean hasGroups(ISuite suite)
public String escapeString(String s)
s - The String to escape.public String escapeHTMLString(String s)
escapeString(String) but also replaces line breaks with
<br /> tags and preserves significant whitespace.s - The String to escape.public String stripThreadName(String threadId)
threadId - The compound thread ID.public long getStartTime(List<IInvokedMethod> methods)
methods - A list of test methods.public long getEndTime(ISuite suite,
IInvokedMethod method,
List<IInvokedMethod> methods)