Package net.masterthought.cucumber
Class Configuration
- java.lang.Object
-
- net.masterthought.cucumber.Configuration
-
public class Configuration extends Object
-
-
Constructor Summary
Constructors Constructor Description Configuration(File reportDirectory, String projectName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClassificationFiles(List<String> classificationFiles)Adds properties files which house classifications in key value pairings.voidaddClassifications(String name, String value)Adds metadata that will be displayed at the main page of the report.voidaddPresentationModes(PresentationMode presentationMode)Sets how the report should be presented.voidaddReducingMethod(ReducingMethod reducingMethod)Sets how the report should be reduced, merged or modified.booleancontainsPresentationMode(PresentationMode presentationMode)Checks if the configuration has givenPresentationModeset.booleancontainsQualifier(@NonNull String jsonFileName)Checks whether an explicit qualifier was specified for a given json file.booleancontainsReducingMethod(ReducingMethod reducingMethod)Checks if the configuration has givenReducingMethodset.StringgetBuildNumber()Gets the build number for this report.List<String>getClassificationFiles()Returns the list of properties files.List<Map.Entry<String,String>>getClassifications()Returns the classification for the report.StringgetDirectorySuffix()Returns directory suffixStringgetDirectorySuffixWithSeparator()Returns directory suffix with separator prepended if necessaryFilegetEmbeddingDirectory()Gets directory where the attachments are stored.Set<Status>getNotFailingStatuses()Gets statuses which do not fail scenario.StringgetProjectName()Returns the project name.StringgetQualifier(@NonNull String jsonFileName)Retrieves explicit qualifier to use for a given json file.List<ReducingMethod>getReducingMethods()Gets how the report should be reduced, merged or modified.FilegetReportDirectory()Returns directory where the report should be stored.SortingMethodgetSortingMethod()Returns the default sorting method.Collection<Pattern>getTagsToExcludeFromChart()intgetTrendsLimit()Returns number of historical reports presented by trends.FilegetTrendsStatsFile()Returns file with history with trends.booleanisTrendsAvailable()Checks if the trends page should be generated and displayed.booleanisTrendsStatsFile()Checks if the file for the trends was set.voidremoveQualifier(@NonNull String jsonFileName)Removes explicit qualifier for a given json file.voidsetBuildNumber(String buildNumber)Sets number of the build.voidsetDirectorySuffix(String directorySuffix)Sets directory suffix.voidsetNotFailingStatuses(Set<Status> notFailingStatuses)voidsetQualifier(@NonNull String jsonFileName, @NonNull String qualifier)Sets explicit qualifier to use for the given json file.voidsetSortingMethod(SortingMethod sortingMethod)Configure how items will be sorted in the report by default.voidsetTagsToExcludeFromChart(String... patterns)Stores the regex patterns to be used for filtering out tags from the 'Tags Overview' chartvoidsetTrends(File trendsFile, int limit)Sets configuration limit for trends.voidsetTrendsStatsFile(File trendsFile)CallssetTrends(File, int)with zero limit.
-
-
-
Method Detail
-
getReportDirectory
public File getReportDirectory()
Returns directory where the report should be stored.- Returns:
- directory for the report
-
getTrendsStatsFile
public File getTrendsStatsFile()
Returns file with history with trends.- Returns:
- file with trends
-
isTrendsStatsFile
public boolean isTrendsStatsFile()
Checks if the file for the trends was set.- Returns:
trueif the file location was provided, otherwisefalse
-
setTrendsStatsFile
public void setTrendsStatsFile(File trendsFile)
CallssetTrends(File, int)with zero limit.- Parameters:
trendsFile- file with trends
-
getTrendsLimit
public int getTrendsLimit()
Returns number of historical reports presented by trends.- Returns:
- number of reports in trends
-
isTrendsAvailable
public boolean isTrendsAvailable()
Checks if the trends page should be generated and displayed.- Returns:
trueif the page with trends should be displayed
-
setTrends
public void setTrends(File trendsFile, int limit)
Sets configuration limit for trends. When the limit is set to 0 then all items will be stored and displayed. To disable saving and displaying trends page set to -1. Otherwise number of previous builds is equal to provided limit.- Parameters:
trendsFile- file where information about previous builds is storedlimit- number of builds that should be presented (older builds are skipped)
-
getBuildNumber
public String getBuildNumber()
Gets the build number for this report.- Returns:
- build number
-
setBuildNumber
public void setBuildNumber(String buildNumber)
Sets number of the build.- Parameters:
buildNumber- number of the build
-
getProjectName
public String getProjectName()
Returns the project name.- Returns:
- name of the project
-
setDirectorySuffix
public void setDirectorySuffix(String directorySuffix)
Sets directory suffix.- Parameters:
directorySuffix- directory suffix
-
getDirectorySuffix
public String getDirectorySuffix()
Returns directory suffix- Returns:
- directory suffix
-
getDirectorySuffixWithSeparator
public String getDirectorySuffixWithSeparator()
Returns directory suffix with separator prepended if necessary- Returns:
- directory suffix with prepended separator
-
getEmbeddingDirectory
public File getEmbeddingDirectory()
Gets directory where the attachments are stored.- Returns:
- directory for attachment
-
getTagsToExcludeFromChart
public Collection<Pattern> getTagsToExcludeFromChart()
- Returns:
- Patterns to be used to filter out tags in the 'Tags Overview' chart. Returns an empty list by default.
-
setTagsToExcludeFromChart
public void setTagsToExcludeFromChart(String... patterns)
Stores the regex patterns to be used for filtering out tags from the 'Tags Overview' chart- Parameters:
patterns- Regex patterns to match against tags- Throws:
ValidationException- when any of the given strings is not a valid regex pattern.
-
addClassifications
public void addClassifications(String name, String value)
Adds metadata that will be displayed at the main page of the report. It is useful when there is a few reports are generated at the same time but with different parameters/configurations.- Parameters:
name- name of the propertyvalue- value of the property
-
getClassifications
public List<Map.Entry<String,String>> getClassifications()
Returns the classification for the report.
-
setSortingMethod
public void setSortingMethod(SortingMethod sortingMethod)
Configure how items will be sorted in the report by default.- Parameters:
sortingMethod- how the items should be sorted
-
getSortingMethod
public SortingMethod getSortingMethod()
Returns the default sorting method.
-
addReducingMethod
public void addReducingMethod(ReducingMethod reducingMethod)
Sets how the report should be reduced, merged or modified.- Parameters:
reducingMethod- type of reduction
-
getReducingMethods
public List<ReducingMethod> getReducingMethods()
Gets how the report should be reduced, merged or modified.- Returns:
- type of reduction
-
containsReducingMethod
public boolean containsReducingMethod(ReducingMethod reducingMethod)
Checks if the configuration has givenReducingMethodset.- Parameters:
reducingMethod- method to validate- Returns:
trueif method was set, otherwisefalse
-
addPresentationModes
public void addPresentationModes(PresentationMode presentationMode)
Sets how the report should be presented.- Parameters:
presentationMode- method used for presentation
-
containsPresentationMode
public boolean containsPresentationMode(PresentationMode presentationMode)
Checks if the configuration has givenPresentationModeset.- Parameters:
presentationMode- method used for presentation- Returns:
trueif mode was set, otherwisefalse
-
addClassificationFiles
public void addClassificationFiles(List<String> classificationFiles)
Adds properties files which house classifications in key value pairings. When these properties files get processed these classifications get displayed on the main page of the report as metadata in the order in which they appear within the file.
-
getClassificationFiles
public List<String> getClassificationFiles()
Returns the list of properties files.
-
getNotFailingStatuses
public Set<Status> getNotFailingStatuses()
Gets statuses which do not fail scenario.
-
setQualifier
public void setQualifier(@NonNull String jsonFileName, @NonNull String qualifier)
Sets explicit qualifier to use for the given json file.- Parameters:
jsonFileName- JSON file name - without the extensionqualifier- Qualifier to use
-
getQualifier
public String getQualifier(@NonNull String jsonFileName)
Retrieves explicit qualifier to use for a given json file.- Parameters:
jsonFileName- JSON file name - without the extension- Returns:
- Qualifier specified for this file or
nullif none specified
-
containsQualifier
public boolean containsQualifier(@NonNull String jsonFileName)
Checks whether an explicit qualifier was specified for a given json file.- Parameters:
jsonFileName- JSON file name - without the extension- Returns:
trueif the qualifier was specified,falseotherwise
-
removeQualifier
public void removeQualifier(@NonNull String jsonFileName)
Removes explicit qualifier for a given json file.- Parameters:
jsonFileName- JSON file name - without the extension
-
-