Class ReportGenerator
- java.lang.Object
-
- com.sun.identity.shared.test.tools.ReportGenerator
-
public class ReportGenerator extends Object
This class generates HTML report based ontestNGresult XML file.
-
-
Constructor Summary
Constructors Constructor Description ReportGenerator(String dataDir, String templateDir, String outputDir)Creates an instance ofReportGeneratorobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateHTMLReports()Creates HTML report.static StringgetFileContent(String fileName)Returns content of a file.static voidmain(String[] args)static voidwriteToFile(String content, String fileName)Writes content to a file.
-
-
-
Constructor Detail
-
ReportGenerator
public ReportGenerator(String dataDir, String templateDir, String outputDir)
Creates an instance ofReportGeneratorobject.- Parameters:
dataDir- Directory where code>testNG result XML resides.templateDir- Directory where HTML templates reside.outputDir- Directory to place the HTML reports.
-
-
Method Detail
-
createHTMLReports
public void createHTMLReports() throws ParserConfigurationException, SAXException, IOExceptionCreates HTML report.- Throws:
ParserConfigurationException- if thetestNGreport XML is not well formed.SAXException- if thetestNGreport XML is not well formed.IOException- if thetestNGreport XML is not accessible.
-
writeToFile
public static void writeToFile(String content, String fileName) throws IOException
Writes content to a file.- Parameters:
content- Content to be written.fileName- Name of file of which content is written to.- Throws:
IOException- if content cannot be written.
-
getFileContent
public static String getFileContent(String fileName) throws IOException
Returns content of a file.- Parameters:
fileName- Name of the file.- Returns:
- Content of a file.
- Throws:
IOException- if connect cannot be read.
-
main
public static void main(String[] args)
-
-