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 the 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(String identifier, ExecutionStatus executionStatus, List<Tag> tags) Is invoked at the end of a scenario.convertScenarioHeaderBlock(String identifier, String name, ExecutionStatus executionStatus, long duration, List<Tag> tags, String extendedDescription) Converts a scenario's header information into a formatted string block.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 the feature header.- Parameters:
featureName- the feature's namestatistics- the execution statistics for the featuredescription- the description, may benull
-
convertScenarioHeaderBlock
String convertScenarioHeaderBlock(String identifier, String name, ExecutionStatus executionStatus, long duration, List<Tag> tags, String extendedDescription) Converts a scenario's header information into a formatted string block.- Parameters:
identifier- the unique identifier for the scenarioname- the name of the scenarioexecutionStatus- the execution status of the scenario, such as SUCCESS or FAILEDduration- the execution duration of the scenario in millisecondstags- a list of tags associated with the scenarioextendedDescription- an extended description for the scenario; may be null- Returns:
- a formatted string block representing the scenario header
-
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 run?description- 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 successfully?durationInNanos- how long did the step take?extendedDescription- detailed description of the step, may benullcaseIsUnsuccessful- was the scenario case executed successfully?currentSectionTitle- 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 successfully?durationInNanos- how long did the step take?extendedDescription- detailed description of the step, may benullcaseIsUnsuccessful- 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
-