Top Description Fields Constructors Methods
org.testng.reporters

public Class SuiteHTMLReporter

extends Object
implements IReporter
Class Inheritance
All Implemented Interfaces
org.testng.IReporter, org.testng.ITestNGListener
Annotations
@Deprecated
Static Imports
org.testng.internal.Utils.isStringNotEmpty

Deprecated

- This reporter is deprecated as of TestNG 7.9.0 in favour of org.testng.reporters.jq.Main

This class implements an HTML reporter for suites.
Authors
cbeust, Alexandru Popescu

Field Summary

Modifier and TypeField and Description
public static final String
AFTER

Generate information about the methods that were run

public static final String
public static final String
private static final String
public static final String
private final Map<String, ITestClass>
private String
public static final String
public static final String
public static final String
public static final String
private static final String
private static final String
private static final String
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
createColor(ITestNGMethod tm)

Generate a HTML color based on the class of the method

private String
dumpMethods(ITestNGMethod[] testMethods)

private String
private void
private void
private void
generateIndex(List<ISuite> suites)

Generate the main index.html file that lists all the suites and their result

private void
private void
private void
generateMethodsAndGroups(XmlSuite xmlSuite, ISuite suite)

Generate information about methods and groups

private void
generateMethodsChronologically(XmlSuite xmlSuite, ISuite suite, String outputFileName, boolean alphabetical)

protected String

Returns:

the name of the output directory of the report
generateOutputDirectoryName
(String
the output directory specified by the user
outputDirectory
)

Overridable by subclasses to create different directory names (e.g. with timestamps).

public void
generateReport(List<XmlSuite>
The list of XmlSuite
xmlSuites
,
List<ISuite>
The list of ISuite
suites
,
String
The output directory
outputDirectory
)

Overrides default org.testng.IReporter.generateReport.

Generate a report for the given suites into the specified output directory.
private void
private void
generateSuiteResult(String suiteName, ISuiteResult sr, String cssClass, StringBuilder tableOfContents)

private void
generateSuites(XmlSuite
- The XmlSuite suite.
xmlSuite
,
ISuite
- The ISuite object.
suite
)

Writes a property file for each suite result.

private void
private void
private static String
private String
private String
private String
pluralize(int count, String singular)

private ISuiteResult[]
private String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AFTERback to summary
public static final String AFTER

Generate information about the methods that were run

BEFOREback to summary
public static final String BEFORE
CLASSESback to summary
public static final String CLASSES
CLOSE_TDback to summary
private static final String CLOSE_TD
GROUPSback to summary
public static final String GROUPS
m_classesback to summary
private final Map<String, ITestClass> m_classes
m_outputDirectoryback to summary
private String m_outputDirectory
METHODS_ALPHABETICALback to summary
public static final String METHODS_ALPHABETICAL
METHODS_CHRONOLOGICALback to summary
public static final String METHODS_CHRONOLOGICAL
METHODS_NOT_RUNback to summary
public static final String METHODS_NOT_RUN
REPORTER_OUTPUTback to summary
public static final String REPORTER_OUTPUT
SPback to summary
private static final String SP
SP2back to summary
private static final String SP2
TD_A_TARGET_MAIN_FRAME_HREFback to summary
private static final String TD_A_TARGET_MAIN_FRAME_HREF
TESTNG_XMLback to summary
public static final String TESTNG_XML

Constructor Detail

SuiteHTMLReporterback to summary
public SuiteHTMLReporter()

Method Detail

createColorback to summary
private String createColor(ITestNGMethod tm)

Generate a HTML color based on the class of the method

dumpMethodsback to summary
private String dumpMethods(ITestNGMethod[] testMethods)
generateClassback to summary
private String generateClass(ITestClass cls)
generateClassesback to summary
private void generateClasses(XmlSuite xmlSuite)
generateExcludedMethodsReportback to summary
private void generateExcludedMethodsReport(XmlSuite xmlSuite, ISuite suite)
generateIndexback to summary
private void generateIndex(List<ISuite> suites)

Generate the main index.html file that lists all the suites and their result

generateIndexback to summary
private void generateIndex(XmlSuite xmlSuite, ISuite sr)
generateMainback to summary
private void generateMain(XmlSuite xmlSuite, ISuite sr)
generateMethodsAndGroupsback to summary
private void generateMethodsAndGroups(XmlSuite xmlSuite, ISuite suite)

Generate information about methods and groups

generateMethodsChronologicallyback to summary
private void generateMethodsChronologically(XmlSuite xmlSuite, ISuite suite, String outputFileName, boolean alphabetical)
generateOutputDirectoryNameback to summary
protected String generateOutputDirectoryName(String outputDirectory)

Overridable by subclasses to create different directory names (e.g. with timestamps).

Parameters
outputDirectory:String

the output directory specified by the user

Returns:String

the name of the output directory of the report

generateReportback to summary
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String outputDirectory)

Overrides default org.testng.IReporter.generateReport.

Doc from org.testng.IReporter.generateReport.

Generate a report for the given suites into the specified output directory.

Parameters
xmlSuites:List<XmlSuite>

The list of XmlSuite

suites:List<ISuite>

The list of ISuite

outputDirectory:String

The output directory

Annotations
@Override
generateReporterOutputback to summary
private void generateReporterOutput(XmlSuite xmlSuite)
generateSuiteResultback to summary
private void generateSuiteResult(String suiteName, ISuiteResult sr, String cssClass, StringBuilder tableOfContents)
generateSuitesback to summary
private void generateSuites(XmlSuite xmlSuite, ISuite suite)

Writes a property file for each suite result.

Parameters
xmlSuite:XmlSuite

- The XmlSuite suite.

suite:ISuite

- The ISuite object.

generateTableOfContentsback to summary
private void generateTableOfContents(XmlSuite xmlSuite, ISuite suite)
generateXmlFileback to summary
private void generateXmlFile(XmlSuite xmlSuite)
getMethodNameback to summary
private static String getMethodName(String name)
getOutputDirectoryback to summary
private String getOutputDirectory(XmlSuite xmlSuite)
makeTitleback to summary
private String makeTitle(ISuite suite)
pluralizeback to summary
private String pluralize(int count, String singular)
sortResultsback to summary
private ISuiteResult[] sortResults(Collection<ISuiteResult> r)
tdback to summary
private String td(String s)