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 void
addClassificationFiles(List<String> classificationFiles)
Adds properties files which house classifications in key value pairings.void
addClassifications(String name, String value)
Adds metadata that will be displayed at the main page of the report.void
addCustomCssFiles(List<String> customCssFiles)
Adds custom static css files to each html page.void
addCustomJsFiles(List<String> customJsFiles)
Adds custom static js files to each html page.void
addPresentationModes(PresentationMode presentationMode)
Sets how the report should be presented.void
addReducingMethod(ReducingMethod reducingMethod)
Sets how the report should be reduced, merged or modified.boolean
containsPresentationMode(PresentationMode presentationMode)
Checks if the configuration has givenPresentationMode
set.boolean
containsQualifier(@NonNull String jsonFileName)
Checks whether an explicit qualifier was specified for a given json file.boolean
containsReducingMethod(ReducingMethod reducingMethod)
Checks if the configuration has givenReducingMethod
set.String
getBuildNumber()
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.List<String>
getCustomCssFiles()
Returns the list of custom css files.List<String>
getCustomJsFiles()
Returns the list of custom js files.String
getDirectorySuffix()
Returns directory suffixString
getDirectorySuffixWithSeparator()
Returns directory suffix with separator prepended if necessaryFile
getEmbeddingDirectory()
Gets directory where the attachments are stored.Set<Status>
getNotFailingStatuses()
Gets statuses which do not fail scenario.String
getProjectName()
Returns the project name.String
getQualifier(@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.File
getReportDirectory()
Returns directory where the report should be stored.SortingMethod
getSortingMethod()
Returns the default sorting method.Collection<Pattern>
getTagsToExcludeFromChart()
int
getTrendsLimit()
Returns number of historical reports presented by trends.File
getTrendsStatsFile()
Returns file with history with trends.boolean
isTrendsAvailable()
Checks if the trends page should be generated and displayed.boolean
isTrendsStatsFile()
Checks if the file for the trends was set.void
removeQualifier(@NonNull String jsonFileName)
Removes explicit qualifier for a given json file.void
setBuildNumber(String buildNumber)
Sets number of the build.void
setDirectorySuffix(String directorySuffix)
Sets directory suffix.void
setNotFailingStatuses(Set<Status> notFailingStatuses)
void
setQualifier(@NonNull String jsonFileName, @NonNull String qualifier)
Sets explicit qualifier to use for the given json file.void
setSortingMethod(SortingMethod sortingMethod)
Configure how items will be sorted in the report by default.void
setTagsToExcludeFromChart(String... patterns)
Stores the regex patterns to be used for filtering out tags from the 'Tags Overview' chartvoid
setTrends(File trendsFile, int limit)
Sets configuration limit for trends.void
setTrendsStatsFile(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:
true
if 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:
true
if 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 givenReducingMethod
set.- Parameters:
reducingMethod
- method to validate- Returns:
true
if 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 givenPresentationMode
set.- Parameters:
presentationMode
- method used for presentation- Returns:
true
if 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
null
if 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:
true
if the qualifier was specified,false
otherwise
-
removeQualifier
public void removeQualifier(@NonNull String jsonFileName)
Removes explicit qualifier for a given json file.- Parameters:
jsonFileName
- JSON file name - without the extension
-
addCustomCssFiles
public void addCustomCssFiles(List<String> customCssFiles)
Adds custom static css files to each html page.
-
addCustomJsFiles
public void addCustomJsFiles(List<String> customJsFiles)
Adds custom static js files to each html page.
-
-