Package org.testng.reporters
Class VerboseReporter
- java.lang.Object
-
- org.testng.TestListenerAdapter
-
- org.testng.reporters.VerboseReporter
-
- All Implemented Interfaces:
IConfigurationListener
,IResultListener
,IResultListener2
,ITestListener
,ITestNGListener
public class VerboseReporter extends TestListenerAdapter
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 Class Summary
Nested Classes Modifier and Type Class Description private static class
VerboseReporter.Status
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LISTENER_PREFIX
Default prefix for messages printed out by this reporterprivate java.lang.String
prefix
private java.lang.String
suiteName
-
Constructor Summary
Constructors Constructor Description VerboseReporter()
Deprecated.UnusedVerboseReporter(java.lang.String prefix)
Create VerboseReporter with custom prefix
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeConfiguration(ITestResult tr)
Invoked before a configuration method is invoked.private java.lang.String
getMethodDeclaration(ITestNGMethod method)
protected void
log(java.lang.String message)
private void
logResults()
Print out test summaryprivate void
logTestResult(VerboseReporter.Status st, ITestResult itr, boolean isConfMethod)
Log meaningful message for passed in arguments.void
onConfigurationFailure(ITestResult tr)
Invoked whenever a configuration method failed.void
onConfigurationSkip(ITestResult tr)
Invoked whenever a configuration method was skipped.void
onConfigurationSuccess(ITestResult tr)
Invoked whenever a configuration method succeeded.void
onFinish(ITestContext context)
Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.void
onStart(ITestContext ctx)
Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.void
onTestFailedButWithinSuccessPercentage(ITestResult tr)
Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.void
onTestFailure(ITestResult tr)
Invoked each time a test fails.void
onTestSkipped(ITestResult tr)
Invoked each time a test is skipped.void
onTestStart(ITestResult tr)
Invoked each time before a test will be invoked.void
onTestSuccess(ITestResult tr)
Invoked each time a test succeeds.private ITestNGMethod[]
resultsToMethods(java.util.List<ITestResult> results)
java.lang.String
toString()
-
Methods inherited from class org.testng.TestListenerAdapter
getAllTestMethods, getConfigurationFailures, getConfigurationSkips, getFailedButWithinSuccessPercentageTests, getFailedTests, getPassedTests, getSkippedTests, getTestContexts, getTimedoutTests, onTestFailedWithTimeout, setAllTestMethods, setFailedButWithinSuccessPercentageTests, setFailedTests, setPassedTests, setSkippedTests
-
-
-
-
Field Detail
-
LISTENER_PREFIX
public static final java.lang.String LISTENER_PREFIX
Default prefix for messages printed out by this reporter- See Also:
- Constant Field Values
-
suiteName
private java.lang.String suiteName
-
prefix
private final java.lang.String prefix
-
-
Method Detail
-
beforeConfiguration
public void beforeConfiguration(ITestResult tr)
Description copied from interface:IConfigurationListener
Invoked before a configuration method is invoked.- Specified by:
beforeConfiguration
in interfaceIConfigurationListener
- Overrides:
beforeConfiguration
in classTestListenerAdapter
-
onConfigurationFailure
public void onConfigurationFailure(ITestResult tr)
Description copied from interface:IConfigurationListener
Invoked whenever a configuration method failed.- Specified by:
onConfigurationFailure
in interfaceIConfigurationListener
- Overrides:
onConfigurationFailure
in classTestListenerAdapter
- See Also:
IConfigurationListener.onConfigurationFailure(org.testng.ITestResult)
-
onConfigurationSkip
public void onConfigurationSkip(ITestResult tr)
Description copied from interface:IConfigurationListener
Invoked whenever a configuration method was skipped.- Specified by:
onConfigurationSkip
in interfaceIConfigurationListener
- Overrides:
onConfigurationSkip
in classTestListenerAdapter
- See Also:
IConfigurationListener.onConfigurationSkip(org.testng.ITestResult)
-
onConfigurationSuccess
public void onConfigurationSuccess(ITestResult tr)
Description copied from interface:IConfigurationListener
Invoked whenever a configuration method succeeded.- Specified by:
onConfigurationSuccess
in interfaceIConfigurationListener
- Overrides:
onConfigurationSuccess
in classTestListenerAdapter
- See Also:
IConfigurationListener.onConfigurationSuccess(org.testng.ITestResult)
-
onTestStart
public void onTestStart(ITestResult tr)
Description copied from interface:ITestListener
Invoked each time before a test will be invoked. TheITestResult
is only partially filled with the references to class, method, start millis and status.- Specified by:
onTestStart
in interfaceITestListener
- Overrides:
onTestStart
in classTestListenerAdapter
- Parameters:
tr
- the partially filledITestResult
- See Also:
ITestResult.STARTED
-
onTestFailure
public void onTestFailure(ITestResult tr)
Description copied from interface:ITestListener
Invoked each time a test fails.- Specified by:
onTestFailure
in interfaceITestListener
- Overrides:
onTestFailure
in classTestListenerAdapter
- Parameters:
tr
-ITestResult
containing information about the run test- See Also:
ITestResult.FAILURE
-
onTestFailedButWithinSuccessPercentage
public void onTestFailedButWithinSuccessPercentage(ITestResult tr)
Description copied from interface:ITestListener
Invoked each time a method fails but has been annotated with successPercentage and this failure still keeps it within the success percentage requested.- Specified by:
onTestFailedButWithinSuccessPercentage
in interfaceITestListener
- Overrides:
onTestFailedButWithinSuccessPercentage
in classTestListenerAdapter
- Parameters:
tr
-ITestResult
containing information about the run test- See Also:
ITestResult.SUCCESS_PERCENTAGE_FAILURE
-
onTestSkipped
public void onTestSkipped(ITestResult tr)
Description copied from interface:ITestListener
Invoked each time a test is skipped.- Specified by:
onTestSkipped
in interfaceITestListener
- Overrides:
onTestSkipped
in classTestListenerAdapter
- Parameters:
tr
-ITestResult
containing information about the run test- See Also:
ITestResult.SKIP
-
onTestSuccess
public void onTestSuccess(ITestResult tr)
Description copied from interface:ITestListener
Invoked each time a test succeeds.- Specified by:
onTestSuccess
in interfaceITestListener
- Overrides:
onTestSuccess
in classTestListenerAdapter
- Parameters:
tr
-ITestResult
containing information about the run test- See Also:
ITestResult.SUCCESS
-
onStart
public void onStart(ITestContext ctx)
Description copied from interface:ITestListener
Invoked before running all the test methods belonging to the classes inside the <test> tag and calling all their Configuration methods.- Specified by:
onStart
in interfaceITestListener
- Overrides:
onStart
in classTestListenerAdapter
-
onFinish
public void onFinish(ITestContext context)
Description copied from interface:ITestListener
Invoked after all the test methods belonging to the classes inside the <test> tag have run and all their Configuration methods have been called.- Specified by:
onFinish
in interfaceITestListener
- Overrides:
onFinish
in classTestListenerAdapter
-
resultsToMethods
private ITestNGMethod[] resultsToMethods(java.util.List<ITestResult> results)
-
logResults
private void logResults()
Print out test summary
-
logTestResult
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
- status of passed in itritr
- test result to be describedisConfMethod
- is itr describing configuration method
-
log
protected void log(java.lang.String message)
-
getMethodDeclaration
private java.lang.String getMethodDeclaration(ITestNGMethod method)
- Parameters:
method
- method to be described- Returns:
- FQN of a class + method declaration for a method passed in ie. test.triangle.CheckCount.testCheckCount(java.lang.String)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classTestListenerAdapter
-
-