Package de.gebit.integrity.providers

## Interface TestResourceProvider

- All Known Implementing Classes:
    `AbstractCompoundTestResourceProvider`, `AbstractTestResourceProvider`, `ArchiveTestResourceProvider`, `FilesystemArchiveTestResourceProvider`, `FilesystemTestResourceProvider`, `InMemoryTestResourceProvider`

      public interface TestResourceProvider

  A test resource provider is used by the test runner to enumerate and retrieve the necessary resources, which are then parsed and linked into the test model. The classloader to use for resolving any Java references is also provided by the resource provider.

  Test resource providers must be thread-safe with regard to all methods defined in `TestResourceProvider`, as they are used in multi-threaded script loading, in which resources are opened and closed in parallel!

  Author:
    Rene Schneider - initial API and implementation

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `closeResource​(TestResource aResourceName, InputStream aResourceStream)` | Closes a specified resources' stream (and all the stuff opened for this stream in the background).
    `ClassLoader` | `getClassLoader()` | Returns the classloader to use for all dynamic class resolving needs.
    `TestResource[]` | `getResourceNames()` | Returns all known resource names.
    `InputStream` | `openResource​(TestResource aResourceName)` | Opens a specific named resource.

- - ### Method Detail

    - #### getResourceNames

          TestResource[] getResourceNames()

      Returns all known resource names.
      Returns:

    - #### openResource

          InputStream openResource​(TestResource aResourceName)
                            throws IOException

      Opens a specific named resource. This should return an `InputStream` at the start of the data of the respective resources, and it is only expected to work if the resource is one of those enumerated by a call to `getResourceNames()`.
      Parameters:
        `aResourceName` - the resource to be opened
      Returns:
        an `InputStream` to read the resource
      Throws:
        `IOException`

    - #### closeResource

          void closeResource​(TestResource aResourceName,
                             InputStream aResourceStream)
                      throws IOException

      Closes a specified resources' stream (and all the stuff opened for this stream in the background).
      Parameters:
        `aResourceName` - the resource to be closed
        `aResourceStream` - the resource stream to close
      Throws:
        `IOException`

    - #### getClassLoader

          ClassLoader getClassLoader()

      Returns the classloader to use for all dynamic class resolving needs.
      Returns:
        the classloader to use