Top Description Inners Fields Constructors Methods
org.testng.reporters

public Class TestHTMLReporter

extends Object
implements ITestListener
Class Inheritance
All Implemented Interfaces
org.testng.ITestListener, org.testng.ITestNGListener
Imports
java.io.IOException, .PrintWriter, java.util.Arrays, .Collection, .Comparator, .Date, .List, .Objects, org.testng.ITestContext, .ITestListener, .ITestNGMethod, .ITestResult, .Reporter, .TestRunner, org.testng.annotations.CustomAttribute, org.testng.internal.Utils, org.testng.log4testng.Logger

This class implements an HTML reporter for individual tests.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final Comparator<ITestResult>
private static final String
private ITestContext
private static final Comparator<ITestResult>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static String
public static void
generateLog(ITestContext testContext, String host, String outputDirectory, Collection<ITestResult> failedConfs, Collection<ITestResult> skippedConfs, Collection<ITestResult> passedTests, Collection<ITestResult> failedTests, Collection<ITestResult> skippedTests, Collection<ITestResult> percentageTests)

public static void
private static String
private static void
public void
onFinish(ITestContext
The test context
context
)

Overrides default org.testng.ITestListener.onFinish.

Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.
public void
onStart(ITestContext
The test context
context
)

Overrides default org.testng.ITestListener.onStart.

Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONFIGURATION_COMPARATORback to summary
private static final Comparator<ITestResult> CONFIGURATION_COMPARATOR
m_testContextback to summary
private ITestContext m_testContext
NAME_COMPARATORback to summary
private static final Comparator<ITestResult> NAME_COMPARATOR

Constructor Detail

TestHTMLReporterback to summary
public TestHTMLReporter()

Method Detail

arrayToStringback to summary
private static String arrayToString(String[] array)
generateLogback to summary
public static void generateLog(ITestContext testContext, String host, String outputDirectory, Collection<ITestResult> failedConfs, Collection<ITestResult> skippedConfs, Collection<ITestResult> passedTests, Collection<ITestResult> failedTests, Collection<ITestResult> skippedTests, Collection<ITestResult> percentageTests)
generateTableback to summary
public static void generateTable(PrintWriter pw, String title, Collection<ITestResult> tests, String cssClass, Comparator<ITestResult> comparator)
getOutputFileback to summary
private static String getOutputFile(ITestContext context)
logback to summary
private static void log(String s)
onFinishback to summary
public void onFinish(ITestContext context)

Overrides default org.testng.ITestListener.onFinish.

Doc from org.testng.ITestListener.onFinish.

Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.

Parameters
context:ITestContext

The test context

Annotations
@Override
onStartback to summary
public void onStart(ITestContext context)

Overrides default org.testng.ITestListener.onStart.

Doc from org.testng.ITestListener.onStart.

Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.

Parameters
context:ITestContext

The test context

Annotations
@Override
org.testng.reporters back to summary

private Class TestHTMLReporter.ConfigurationComparator

extends Object
implements Comparator<ITestResult>
Class Inheritance
  • java.lang.Object
  • org.testng.reporters.TestHTMLReporter.ConfigurationComparator
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static int
public int
compare(ITestResult
the first object to be compared.
o1
,
ITestResult
the second object to be compared.
o2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ConfigurationComparatorback to summary
private ConfigurationComparator()

Method Detail

annotationValueback to summary
private static int annotationValue(ITestNGMethod method)
compareback to summary
public int compare(ITestResult o1, ITestResult o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
o1:ITestResult

the first object to be compared.

o2:ITestResult

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override
org.testng.reporters back to summary

private Class TestHTMLReporter.NameComparator

extends Object
implements Comparator<ITestResult>
Class Inheritance
All Implemented Interfaces
java.util.Comparator

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
compare(ITestResult
the first object to be compared.
o1
,
ITestResult
the second object to be compared.
o2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NameComparatorback to summary
private NameComparator()

Method Detail

compareback to summary
public int compare(ITestResult o1, ITestResult o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
o1:ITestResult

the first object to be compared.

o2:ITestResult

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override