Package com.hp.lft.report
Interface UnitTestReporter
public interface UnitTestReporter
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Ends all report levels.void
Ends the report level.void
closeCurrentReportLevel
(com.hp.lft.report.internal.ReportEventType type) Ends the report level.void
closeCurrentReportLevel
(com.hp.lft.report.internal.ReportEventType type, Status status) Ends the report level.void
closeCurrentReportLevel
(Status status) Ends the report level.Returns the status of the current execution context.void
init
(ReportConfiguration configuration) Initializes the providedReportConfiguration
.boolean
Indicates whether this instance of the test failed.void
openReportLevel
(String key, com.hp.lft.report.internal.ReportEventType nodeType, String title) Adds a level to the report.void
openReportLevel
(String key, com.hp.lft.report.internal.ReportEventType nodeType, String title, String description) Adds a level to the report.void
openReportLevel
(String key, com.hp.lft.report.internal.ReportEventType nodeType, String title, String description, Map<String, Object> data) Adds a level to the report.void
reportRuntimeError
(Throwable throwable) Reports a Throwable occurred during execution.void
updateReportStatus
(Status nodeStatus) Updates the report status.void
updateReportStatus
(Status status, Throwable throwable) Updates the report status to failed and supplies aThrowable
as the reason.
-
Method Details
-
isCurrentTestFailed
boolean isCurrentTestFailed()Indicates whether this instance of the test failed.- Returns:
- true if this instance failed; otherwise, false.
-
openReportLevel
void openReportLevel(String key, com.hp.lft.report.internal.ReportEventType nodeType, String title) throws ReportException Adds a level to the report.- Parameters:
key
- the node key.nodeType
- the type of node.title
- the label of the node.- Throws:
ReportException
- if error occurs in the report
-
openReportLevel
void openReportLevel(String key, com.hp.lft.report.internal.ReportEventType nodeType, String title, String description) throws ReportException Adds a level to the report.- Parameters:
key
- the node key.nodeType
- the type of node.title
- the label of the node.description
- the description displayed in the Details pane for this node.- Throws:
ReportException
- if error occurs in the report
-
openReportLevel
void openReportLevel(String key, com.hp.lft.report.internal.ReportEventType nodeType, String title, String description, Map<String, Object> data) throws ReportExceptionAdds a level to the report.- Parameters:
key
- the node key.nodeType
- the type of node.title
- the label of the node.description
- the description displayed in the Details pane for this node.data
- additional data for the report.- Throws:
ReportException
- if error occurs in the report
-
closeCurrentReportLevel
Ends the report level.- Throws:
ReportException
- if error occurs in the report
-
closeCurrentReportLevel
void closeCurrentReportLevel(com.hp.lft.report.internal.ReportEventType type) throws ReportException Ends the report level.- Parameters:
type
- the type of node.- Throws:
ReportException
- if error occurs in the report
-
closeCurrentReportLevel
Ends the report level.- Parameters:
status
- the status of node.- Throws:
ReportException
- if error occurs in the report
-
closeCurrentReportLevel
void closeCurrentReportLevel(com.hp.lft.report.internal.ReportEventType type, Status status) throws ReportException Ends the report level.- Parameters:
type
- the type of node.status
- status of the node.- Throws:
ReportException
- if error occurs in the report
-
closeAllReportLevels
void closeAllReportLevels()Ends all report levels. -
updateReportStatus
Updates the report status.- Parameters:
nodeStatus
- the node status.
-
updateReportStatus
Updates the report status to failed and supplies aThrowable
as the reason. A Runtime error node will be added to the report with the suppliedThrowable
.- Parameters:
status
- the nodethrowable
- the reason for the report failure.
-
init
Initializes the providedReportConfiguration
.- Parameters:
configuration
-ReportConfiguration
.- Throws:
ReportException
- if error occurs in the report
-
reportRuntimeError
Reports a Throwable occurred during execution.- Parameters:
throwable
- the Throwable that occurred during execution.
-
getCurrentExecutionContextStatus
Status getCurrentExecutionContextStatus()Returns the status of the current execution context. The execution context is equivalent to any superior structure that contains operations (e.g.: test method, reporting context, etc.).- Returns:
- The status of the current execution context as a
Status
.
-