Top Description Inners Fields Constructors Methods
org.testng.reporters

public Class VerboseReporter

extends Object
implements IConfigurationListener, ITestListener
Class Inheritance
All Implemented Interfaces
org.testng.ITestListener, org.testng.ITestNGListener, org.testng.IConfigurationListener
Imports
java.util.Arrays, .Collection, .Optional, java.util.stream.Collectors, org.testng.IConfigurationListener, .ITestContext, .ITestListener, .ITestNGMethod, .ITestResult, org.testng.annotations.CustomAttribute, org.testng.internal.Utils

Reporter printing out detailed messages about what TestNG is going to run and what is the status of what has been just run.

To see messages from this reporter, either run Ant in verbose mode ('ant -v') or set verbose level to 5 or higher

Since
6.4

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
public static final String
LISTENER_PREFIX

Default prefix for messages printed out by this reporter

private final String
private String

Constructor Summary

AccessConstructor and Description
public
VerboseReporter(String
prefix for messages printed out by this reporter
prefix
)

Create VerboseReporter with custom prefix

Method Summary

Modifier and TypeMethod and Description
public void
beforeConfiguration(ITestResult
The test result
tr
)

Overrides default org.testng.IConfigurationListener.beforeConfiguration.

Invoked before a configuration method is invoked.
private String

Returns:

FQN of a class + method declaration for a method passed in ie. test.triangle.CheckCount.testCheckCount(java.lang.String)
getMethodDeclaration
(ITestNGMethod
method to be described
method
,
ITestResult tr)

protected void
log(String message)

private void
logResults(ITestContext context)

Print out test summary

private void
logTestResult(VerboseReporter.Status
status of passed in itr
st
,
ITestResult
test result to be described
itr
,
boolean
is itr describing configuration method
isConfMethod
)

Log meaningful message for passed in arguments.

public void
onConfigurationFailure(ITestResult
The test result
tr
)

Overrides default org.testng.IConfigurationListener.onConfigurationFailure.

Invoked whenever a configuration method failed.
public void
onConfigurationSkip(ITestResult
The test result
tr
)

Overrides default org.testng.IConfigurationListener.onConfigurationSkip.

Invoked whenever a configuration method was skipped.
public void
onConfigurationSuccess(ITestResult
The test result
tr
)

Overrides default org.testng.IConfigurationListener.onConfigurationSuccess.

Invoked whenever a configuration method succeeded.
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
ctx
)

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.
public void
onTestFailedButWithinSuccessPercentage(ITestResult
ITestResult containing information about the run test
tr
)

Overrides default org.testng.ITestListener.onTestFailedButWithinSuccessPercentage.

Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.
public void
onTestFailure(ITestResult
ITestResult containing information about the run test
tr
)

Overrides default org.testng.ITestListener.onTestFailure.

Invoked each time a test fails.
public void
onTestSkipped(ITestResult
ITestResult containing information about the run test
tr
)

Overrides default org.testng.ITestListener.onTestSkipped.

Invoked each time a test is skipped.
public void
onTestStart(ITestResult
the partially filled ITestResult
tr
)

Overrides default org.testng.ITestListener.onTestStart.

Invoked each time before a test will be invoked.
public void
onTestSuccess(ITestResult
ITestResult containing information about the run test
tr
)

Overrides default org.testng.ITestListener.onTestSuccess.

Invoked each time a test succeeds.
private ITestNGMethod[]
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

LISTENER_PREFIXback to summary
public static final String LISTENER_PREFIX

Default prefix for messages printed out by this reporter

prefixback to summary
private final String prefix
suiteNameback to summary
private String suiteName

Constructor Detail

VerboseReporterback to summary
public VerboseReporter(String prefix)

Create VerboseReporter with custom prefix

Parameters
prefix:String

prefix for messages printed out by this reporter

Method Detail

beforeConfigurationback to summary
public void beforeConfiguration(ITestResult tr)

Overrides default org.testng.IConfigurationListener.beforeConfiguration.

Doc from org.testng.IConfigurationListener.beforeConfiguration.

Invoked before a configuration method is invoked.

Parameters
tr:ITestResult

The test result

Annotations
@Override
getMethodDeclarationback to summary
private String getMethodDeclaration(ITestNGMethod method, ITestResult tr)
Parameters
method:ITestNGMethod

method to be described

Returns:String

FQN of a class + method declaration for a method passed in ie. test.triangle.CheckCount.testCheckCount(java.lang.String)

logback to summary
protected void log(String message)
logResultsback to summary
private void logResults(ITestContext context)

Print out test summary

logTestResultback to summary
private void logTestResult(VerboseReporter.Status st, ITestResult itr, boolean isConfMethod)

Log meaningful message for passed in arguments. Message itself is of form: $status: "$suiteName" - $methodDeclaration ($actualArguments) finished in $x ms ($run of $totalRuns)

Parameters
st:VerboseReporter.Status

status of passed in itr

itr:ITestResult

test result to be described

isConfMethod:boolean

is itr describing configuration method

onConfigurationFailureback to summary
public void onConfigurationFailure(ITestResult tr)

Overrides default org.testng.IConfigurationListener.onConfigurationFailure.

Doc from org.testng.IConfigurationListener.onConfigurationFailure.

Invoked whenever a configuration method failed.

Parameters
tr:ITestResult

The test result

Annotations
@Override
onConfigurationSkipback to summary
public void onConfigurationSkip(ITestResult tr)

Overrides default org.testng.IConfigurationListener.onConfigurationSkip.

Doc from org.testng.IConfigurationListener.onConfigurationSkip.

Invoked whenever a configuration method was skipped.

Parameters
tr:ITestResult

The test result

Annotations
@Override
onConfigurationSuccessback to summary
public void onConfigurationSuccess(ITestResult tr)

Overrides default org.testng.IConfigurationListener.onConfigurationSuccess.

Doc from org.testng.IConfigurationListener.onConfigurationSuccess.

Invoked whenever a configuration method succeeded.

Parameters
tr:ITestResult

The test result

Annotations
@Override
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 ctx)

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
ctx:ITestContext

The test context

Annotations
@Override
onTestFailedButWithinSuccessPercentageback to summary
public void onTestFailedButWithinSuccessPercentage(ITestResult tr)

Overrides default org.testng.ITestListener.onTestFailedButWithinSuccessPercentage.

Doc from org.testng.ITestListener.onTestFailedButWithinSuccessPercentage.

Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.

Parameters
tr:ITestResult

ITestResult containing information about the run test

Annotations
@Override
onTestFailureback to summary
public void onTestFailure(ITestResult tr)

Overrides default org.testng.ITestListener.onTestFailure.

Doc from org.testng.ITestListener.onTestFailure.

Invoked each time a test fails.

Parameters
tr:ITestResult

ITestResult containing information about the run test

Annotations
@Override
onTestSkippedback to summary
public void onTestSkipped(ITestResult tr)

Overrides default org.testng.ITestListener.onTestSkipped.

Doc from org.testng.ITestListener.onTestSkipped.

Invoked each time a test is skipped.

Parameters
tr:ITestResult

ITestResult containing information about the run test

Annotations
@Override
onTestStartback to summary
public void onTestStart(ITestResult tr)

Overrides default org.testng.ITestListener.onTestStart.

Doc from org.testng.ITestListener.onTestStart.

Invoked each time before a test will be invoked. The ITestResult is only partially filled with the references to class, method, start millis and status.

Parameters
tr:ITestResult

the partially filled ITestResult

Annotations
@Override
onTestSuccessback to summary
public void onTestSuccess(ITestResult tr)

Overrides default org.testng.ITestListener.onTestSuccess.

Doc from org.testng.ITestListener.onTestSuccess.

Invoked each time a test succeeds.

Parameters
tr:ITestResult

ITestResult containing information about the run test

Annotations
@Override
resultsToMethodsback to summary
private ITestNGMethod[] resultsToMethods(Collection<ITestResult> results)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
org.testng.reporters back to summary

private final Enum VerboseReporter.Status

extends Enum<VerboseReporter.Status>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final VerboseReporter.Status
public static final VerboseReporter.Status
public static final VerboseReporter.Status
public static final VerboseReporter.Status
public static final VerboseReporter.Status

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static VerboseReporter.Status
public static VerboseReporter.Status[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FAILUREback to summary
public static final VerboseReporter.Status FAILURE
SKIPback to summary
public static final VerboseReporter.Status SKIP
STARTEDback to summary
public static final VerboseReporter.Status STARTED
SUCCESSback to summary
public static final VerboseReporter.Status SUCCESS
SUCCESS_PERCENTAGE_FAILUREback to summary
public static final VerboseReporter.Status SUCCESS_PERCENTAGE_FAILURE

Constructor Detail

Statusback to summary
private Status()

Method Detail

valueOfback to summary
public static VerboseReporter.Status valueOf(String name)
valuesback to summary
public static VerboseReporter.Status[] values()