Package com.tngtech.jgiven.report
Interface ReportBlockConverter
public interface ReportBlockConverter
Converts elements of the report model into standalone text blocks.
-
Method Summary
Modifier and TypeMethodDescriptionconvertCaseFooterBlock
(String errorMessage, List<String> stackTraceLines) Is invoked if the case failed with an exception.convertCaseHeaderBlock
(int caseNr, ExecutionStatus executionStatus, long duration, String description) Convert scenario case number and parameters into case header.convertCasesTableBlock
(CasesTable casesTable) Is invoked at the end of a scenario, when the scenario has multiple case and a data table.convertFeatureHeaderBlock
(String featureName, ReportStatistics statistics, String description) Convert feature name and execution statistics into feature header.convertFirstStepBlock
(int depth, List<Word> words, StepStatus status, long durationInNanos, String extendedDescription, boolean caseIsUnsuccessful, String currentSectionTitle) Convert the words that make up the first step into a block.convertScenarioFooterBlock
(ExecutionStatus executionStatus) Is invoked at the end of a scenario.convertScenarioHeaderBlock
(String name, ExecutionStatus executionStatus, long duration, List<Tag> tagNames, String extendedDescription) Convert scenario name and more meta information into scenario header.convertStatisticsBlock
(com.google.common.collect.ListMultimap<String, ReportStatistics> featureStatistics, ReportStatistics totalStatistics) Convert a set of execution statistics into a statistics table.convertStepBlock
(int depth, List<Word> words, StepStatus status, long durationInNanos, String extendedDescription, boolean caseIsUnsuccessful) Convert the words that make up a step into a block.
-
Method Details
-
convertStatisticsBlock
String convertStatisticsBlock(com.google.common.collect.ListMultimap<String, ReportStatistics> featureStatistics, ReportStatistics totalStatistics) Convert a set of execution statistics into a statistics table.- Parameters:
featureStatistics
- a map from feature names to statisticstotalStatistics
- the total statistics for all features combined
-
convertFeatureHeaderBlock
String convertFeatureHeaderBlock(String featureName, ReportStatistics statistics, String description) Convert feature name and execution statistics into feature header.- Parameters:
featureName
- the feature's namestatistics
- the execution statistics for the featuredescription
- the description, may benull
-
convertScenarioHeaderBlock
String convertScenarioHeaderBlock(String name, ExecutionStatus executionStatus, long duration, List<Tag> tagNames, String extendedDescription) Convert scenario name and more meta information into scenario header.The name corresponds to the test method name
- Parameters:
name
- the name of the scenarioexecutionStatus
- was the scenario successfulduration
- how long did the scenario runtagNames
- names of the tags if scenario is taggedextendedDescription
- detailed description of the scenario, may benull
-
convertCaseHeaderBlock
String convertCaseHeaderBlock(int caseNr, ExecutionStatus executionStatus, long duration, String description) Convert scenario case number and parameters into case header.It is guaranteed that
parameterNames.size() == caseArgument.size()
- Parameters:
caseNr
- the number of the case, starting from 1executionStatus
- whether the case was successfulduration
- how long did the scenario case rundescription
- a short description of this case, may benull
-
convertFirstStepBlock
String convertFirstStepBlock(int depth, List<Word> words, StepStatus status, long durationInNanos, String extendedDescription, boolean caseIsUnsuccessful, String currentSectionTitle) Convert the words that make up the first step into a block.- Parameters:
depth
- the depth of the stepwords
- the words to be convertedstatus
- was the step executed successfullydurationInNanos
- how long did the step takeextendedDescription
- detailed description of the step, may benull
caseIsUnsuccessful
- was the scenario case executed successfullycurrentSectionTitle
- the current section's title, may benull
-
convertStepBlock
String convertStepBlock(int depth, List<Word> words, StepStatus status, long durationInNanos, String extendedDescription, boolean caseIsUnsuccessful) Convert the words that make up a step into a block.- Parameters:
depth
- the depth of the stepwords
- the words to be convertedstatus
- was the step executed successfullydurationInNanos
- how long did the step takeextendedDescription
- detailed description of the step, may benull
caseIsUnsuccessful
- was the scenario case executed successfully
-
convertCasesTableBlock
Is invoked at the end of a scenario, when the scenario has multiple case and a data table.- Parameters:
casesTable
- the data table of the scenario
-