Package com.tngtech.jgiven.report
Interface ReportBlockConverter
-
public interface ReportBlockConverter
Converts elements of the report model into standalone text blocks.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
convertCaseFooterBlock(java.lang.String errorMessage, java.util.List<java.lang.String> stackTraceLines)
Is invoked if the case failed with an exception.java.lang.String
convertCaseHeaderBlock(int caseNr, ExecutionStatus executionStatus, long duration, java.lang.String description)
Convert scenario case number and parameters into case header.java.lang.String
convertCasesTableBlock(CasesTable casesTable)
Is invoked at the end of a scenario, when the scenario has multiple case and a data table.java.lang.String
convertFeatureHeaderBlock(java.lang.String featureName, ReportStatistics statistics, java.lang.String description)
Convert feature name and execution statistics into feature header.java.lang.String
convertFirstStepBlock(int depth, java.util.List<Word> words, StepStatus status, long durationInNanos, java.lang.String extendedDescription, boolean caseIsUnsuccessful, java.lang.String currentSectionTitle)
Convert the words that make up the first step into a block.java.lang.String
convertScenarioFooterBlock(ExecutionStatus executionStatus)
Is invoked at the end of a scenario.java.lang.String
convertScenarioHeaderBlock(java.lang.String name, ExecutionStatus executionStatus, long duration, java.util.List<Tag> tagNames, java.lang.String extendedDescription)
Convert scenario name and more meta information into scenario header.java.lang.String
convertStatisticsBlock(com.google.common.collect.ListMultimap<java.lang.String,ReportStatistics> featureStatistics, ReportStatistics totalStatistics)
Convert a set of execution statistics into a statistics table.java.lang.String
convertStepBlock(int depth, java.util.List<Word> words, StepStatus status, long durationInNanos, java.lang.String extendedDescription, boolean caseIsUnsuccessful)
Convert the words that make up a step into a block.
-
-
-
Method Detail
-
convertStatisticsBlock
java.lang.String convertStatisticsBlock(com.google.common.collect.ListMultimap<java.lang.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
java.lang.String convertFeatureHeaderBlock(java.lang.String featureName, ReportStatistics statistics, java.lang.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
java.lang.String convertScenarioHeaderBlock(java.lang.String name, ExecutionStatus executionStatus, long duration, java.util.List<Tag> tagNames, java.lang.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
java.lang.String convertCaseHeaderBlock(int caseNr, ExecutionStatus executionStatus, long duration, java.lang.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
java.lang.String convertFirstStepBlock(int depth, java.util.List<Word> words, StepStatus status, long durationInNanos, java.lang.String extendedDescription, boolean caseIsUnsuccessful, java.lang.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
java.lang.String convertStepBlock(int depth, java.util.List<Word> words, StepStatus status, long durationInNanos, java.lang.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
java.lang.String convertCasesTableBlock(CasesTable casesTable)
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
-
convertCaseFooterBlock
java.lang.String convertCaseFooterBlock(java.lang.String errorMessage, java.util.List<java.lang.String> stackTraceLines)
Is invoked if the case failed with an exception.- Parameters:
errorMessage
- the message describing the errorstackTraceLines
- the stacktrace lines if present
-
convertScenarioFooterBlock
java.lang.String convertScenarioFooterBlock(ExecutionStatus executionStatus)
Is invoked at the end of a scenario.- Parameters:
executionStatus
- was the scenario successful
-
-