Package org.apache.rat.testhelpers.data
Class AbstractTestDataProvider
java.lang.Object
org.apache.rat.testhelpers.data.AbstractTestDataProvider
- Direct Known Subclasses:
ReportTestDataProvider
Generates a list of TestData to test an implementation.
The tests work by creating a Path Consumer to construct a directory under the test base directory and creating files and/or
directories within that directory. A test validator is created to validate the expected results of the operation and a
Each
Use of this class ensures consistent testing across all available UIs.
TestData
object is created for each test.
Each
TestData represents a single test of a command line option or set of options.
Use of this class ensures consistent testing across all available UIs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.common.collect.ImmutableList<org.apache.commons.lang3.tuple.ImmutablePair<org.apache.commons.cli.Option,String[]>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidconfigTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.CONFIGURATIONtests.protected abstract voidconfigurationNoDefaultsTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.CONFIGURATION_NO_DEFAULTStests.protected abstract voidcounterMaxTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.COUNTER_MAXtests.protected abstract voidcounterMinTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.COUNTER_MINtests.protected abstract voiddryRunTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.DRY_RUNtests.protected abstract voideditCopyrightTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EDIT_COPYRIGHTtests.protected abstract voideditLicenseTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EDIT_ADDtests.protected abstract voideditOverwriteTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EDIT_OVERWRITEtests.getOptionTestMap(UIOptionCollection<?> optionCollection) Generates a map of TestData indexed by the testName.getOptionTests(UIOptionCollection<?> optionCollection) Generates a list of test data for Option testing.protected abstract voidhelpLicenses(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.HELP_LICENSEStests.protected abstract voidinputExcludeFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_FILEtests.protected abstract voidinputExcludeParsedScmTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_PARSE_SCMtests.protected abstract voidinputExcludeSizeTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_SIZEtests.protected abstract voidinputExcludeStdTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_STDtests.protected abstract voidinputExcludeTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDEtests.protected abstract voidinputIncludeFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.INCLUDE_FILEtests.protected abstract voidinputIncludeStdTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.INCLUDE_STDtests.protected abstract voidinputIncludeTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.INCLUDEtests.protected abstract voidinputSourceTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.SOURCEtests.protected abstract voidlicenseFamiliesApprovedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_APPROVED_FILEtests.protected abstract voidlicenseFamiliesApprovedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_APPROVEDtests.protected abstract voidlicenseFamiliesDeniedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_DENIED_FILEtests.protected abstract voidlicenseFamiliesDeniedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_DENIEDtests.protected abstract voidlicensesApprovedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_APPROVED_FILEtests.protected abstract voidlicensesApprovedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_APPROVEDtests.protected abstract voidlicensesDeniedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_DENIED_FILEtests.protected abstract voidlicensesDeniedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_DENIEDtests.protected abstract voidlogLevelTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LOG_LEVELtests.protected abstract voidoutputArchiveTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_ARCHIVEtests.protected abstract voidoutputFamiliesTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_FAMILIEStests.protected abstract voidoutputFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_FILEtests.protected abstract voidoutputLicensesTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_LICENSEStests.protected abstract voidoutputStandardTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_STANDARDtests.protected abstract voidoutputStyleTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_STYLEtests.
-
Field Details
-
NO_OPTIONS
public static final com.google.common.collect.ImmutableList<org.apache.commons.lang3.tuple.ImmutablePair<org.apache.commons.cli.Option,String[]>> NO_OPTIONS
-
-
Constructor Details
-
AbstractTestDataProvider
public AbstractTestDataProvider()
-
-
Method Details
-
getOptionTestMap
Generates a map of TestData indexed by the testName.- Parameters:
optionCollection- the collection of options for the UI under test.- Returns:
- the map of testName to Test Data.
-
getOptionTests
Generates a list of test data for Option testing. This is different from UI testing as this is to test that the command line is properly parsed into a configuration.- Parameters:
optionCollection- the collection of options for the UI under test.- Returns:
- a set of TestData for the tests.
-
inputExcludeFileTest
protected abstract void inputExcludeFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_FILEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputExcludeTest
protected abstract void inputExcludeTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputExcludeStdTest
protected abstract void inputExcludeStdTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_STDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputExcludeParsedScmTest
protected abstract void inputExcludeParsedScmTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_PARSE_SCMtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputExcludeSizeTest
protected abstract void inputExcludeSizeTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EXCLUDE_SIZEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputIncludeFileTest
protected abstract void inputIncludeFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.INCLUDE_FILEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputIncludeTest
protected abstract void inputIncludeTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.INCLUDEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputIncludeStdTest
protected abstract void inputIncludeStdTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.INCLUDE_STDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
inputSourceTest
Execute anArg.SOURCEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
helpLicenses
Execute anArg.HELP_LICENSEStests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licensesApprovedFileTest
protected abstract void licensesApprovedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_APPROVED_FILEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licensesApprovedTest
protected abstract void licensesApprovedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_APPROVEDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licensesDeniedTest
protected abstract void licensesDeniedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_DENIEDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licensesDeniedFileTest
protected abstract void licensesDeniedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.LICENSES_DENIED_FILEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licenseFamiliesApprovedFileTest
protected abstract void licenseFamiliesApprovedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_APPROVED_FILEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licenseFamiliesApprovedTest
protected abstract void licenseFamiliesApprovedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_APPROVEDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licenseFamiliesDeniedFileTest
protected abstract void licenseFamiliesDeniedFileTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_DENIED_FILEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
licenseFamiliesDeniedTest
protected abstract void licenseFamiliesDeniedTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.FAMILIES_DENIEDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
counterMaxTest
Execute anArg.COUNTER_MAXtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
counterMinTest
Execute anArg.COUNTER_MINtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
configTest
Execute anArg.CONFIGURATIONtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
configurationNoDefaultsTest
protected abstract void configurationNoDefaultsTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.CONFIGURATION_NO_DEFAULTStests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
dryRunTest
Execute anArg.DRY_RUNtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
editCopyrightTest
protected abstract void editCopyrightTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EDIT_COPYRIGHTtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
editLicenseTest
Execute anArg.EDIT_ADDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
editOverwriteTest
protected abstract void editOverwriteTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.EDIT_OVERWRITEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
logLevelTest
Execute anArg.LOG_LEVELtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
outputArchiveTest
protected abstract void outputArchiveTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_ARCHIVEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
outputFamiliesTest
protected abstract void outputFamiliesTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_FAMILIEStests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
outputFileTest
Execute anArg.OUTPUT_FILEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
outputLicensesTest
protected abstract void outputLicensesTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_LICENSEStests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
outputStandardTest
protected abstract void outputStandardTest(Set<TestData> result, org.apache.commons.cli.Option option) Execute anArg.OUTPUT_STANDARDtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-
outputStyleTest
Execute anArg.OUTPUT_STYLEtests.- Parameters:
result- the set of configured tests.option- the specific option being tested.
-