Package de.gebit.integrity.runner.providers

## Class AbstractTestResourceProvider

- java.lang.Object
- - de.gebit.integrity.runner.providers.AbstractTestResourceProvider

- All Implemented Interfaces:
    `TestResourceProvider`
  Direct Known Subclasses:
    `ArchiveTestResourceProvider`, `FilesystemTestResourceProvider`

      public abstract class AbstractTestResourceProvider
      extends Object
      implements TestResourceProvider

  Base class for test resource providers. Provides some convenience base implementations.
  Author:
    Rene Schneider - initial API and implementation

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `INTEGRITY_TEST_FILES_SUFFIX` | The default suffix indicating a file is an Integrity test file.
    `protected Set<TestResource>` | `resourceFiles` | The resources in this provider.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractTestResourceProvider()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `addResource​(TestResource aResource)` | Adds a given resource to the `resourceFiles`.
    `protected void` | `createAndAddResource​(String aResourceName)` | Convenience method to create and add a new `TestResource`.
    `protected TestResource` | `createResource​(String aResourceName)` | Convenience method to create a new `TestResource` instance wrapping a certain test resource name.
    `ClassLoader` | `getClassLoader()` | Returns the classloader to use for all dynamic class resolving needs.
    `TestResource[]` | `getResourceNames()` | Returns all known resource names.
    `void` | `setClassLoader​(ClassLoader aClassLoader)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface de.gebit.integrity.providers.TestResourceProvider

      `closeResource, openResource`

- - ### Field Detail

    - #### INTEGRITY_TEST_FILES_SUFFIX

          public static final String INTEGRITY_TEST_FILES_SUFFIX

      The default suffix indicating a file is an Integrity test file.
      See Also:
        Constant Field Values

    - #### resourceFiles

          protected Set<TestResource> resourceFiles

      The resources in this provider. This abstract class supports an "early-evaluation" model: resources are discovered and added early, before they're actually requested. This thing does not have to be thread-safe, as the resource discovery phase is not expected to be run in parallel on multiple threads (and if an implementor would do such a thing, he is responsible to protect against thread interferences).

  - ### Constructor Detail

    - #### AbstractTestResourceProvider

          public AbstractTestResourceProvider()

  - ### Method Detail

    - #### setClassLoader

          public void setClassLoader​(ClassLoader aClassLoader)

    - #### getClassLoader

          public ClassLoader getClassLoader()

      Description copied from interface: `TestResourceProvider`
      Returns the classloader to use for all dynamic class resolving needs.
      Specified by:
        `getClassLoader` in interface `TestResourceProvider`
      Returns:
        the classloader to use

    - #### getResourceNames

          public TestResource[] getResourceNames()

      Description copied from interface: `TestResourceProvider`
      Returns all known resource names.
      Specified by:
        `getResourceNames` in interface `TestResourceProvider`
      Returns:

    - #### addResource

          protected void addResource​(TestResource aResource)

      Adds a given resource to the `resourceFiles`.
      Parameters:
        `aResource` - the resource to add

    - #### createResource

          protected TestResource createResource​(String aResourceName)

      Convenience method to create a new `TestResource` instance wrapping a certain test resource name.
      Parameters:
        `aResourceName` - the resource name to wrap
      Returns:
        the resource instance

    - #### createAndAddResource

          protected void createAndAddResource​(String aResourceName)

      Convenience method to create and add a new `TestResource`.
      Parameters:
        `aResourceName` - the resource name to wrap