Class AbstractTestDataProvider

java.lang.Object
org.apache.rat.testhelpers.data.AbstractTestDataProvider
Direct Known Subclasses:
ReportTestDataProvider

public abstract class AbstractTestDataProvider extends Object
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 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 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

      public final Map<String,TestData> getOptionTestMap(UIOptionCollection<?> optionCollection)
      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

      public final Set<TestData> getOptionTests(UIOptionCollection<?> optionCollection)
      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 an Arg.EXCLUDE_FILE tests.
      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 an Arg.EXCLUDE tests.
      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 an Arg.EXCLUDE_STD tests.
      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 an Arg.EXCLUDE_PARSE_SCM tests.
      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 an Arg.EXCLUDE_SIZE tests.
      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 an Arg.INCLUDE_FILE tests.
      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 an Arg.INCLUDE tests.
      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 an Arg.INCLUDE_STD tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • inputSourceTest

      protected abstract void inputSourceTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.SOURCE tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • helpLicenses

      protected abstract void helpLicenses(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.HELP_LICENSES tests.
      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 an Arg.LICENSES_APPROVED_FILE tests.
      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 an Arg.LICENSES_APPROVED tests.
      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 an Arg.LICENSES_DENIED tests.
      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 an Arg.LICENSES_DENIED_FILE tests.
      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 an Arg.FAMILIES_APPROVED_FILE tests.
      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 an Arg.FAMILIES_APPROVED tests.
      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 an Arg.FAMILIES_DENIED_FILE tests.
      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 an Arg.FAMILIES_DENIED tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • counterMaxTest

      protected abstract void counterMaxTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.COUNTER_MAX tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • counterMinTest

      protected abstract void counterMinTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.COUNTER_MIN tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • configTest

      protected abstract void configTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.CONFIGURATION tests.
      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)
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • dryRunTest

      protected abstract void dryRunTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.DRY_RUN tests.
      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 an Arg.EDIT_COPYRIGHT tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • editLicenseTest

      protected abstract void editLicenseTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.EDIT_ADD tests.
      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 an Arg.EDIT_OVERWRITE tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • logLevelTest

      protected abstract void logLevelTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.LOG_LEVEL tests.
      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 an Arg.OUTPUT_ARCHIVE tests.
      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 an Arg.OUTPUT_FAMILIES tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • outputFileTest

      protected abstract void outputFileTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.OUTPUT_FILE tests.
      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 an Arg.OUTPUT_LICENSES tests.
      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 an Arg.OUTPUT_STANDARD tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.
    • outputStyleTest

      protected abstract void outputStyleTest(Set<TestData> result, org.apache.commons.cli.Option option)
      Execute an Arg.OUTPUT_STYLE tests.
      Parameters:
      result - the set of configured tests.
      option - the specific option being tested.