IncludeCategories (JUnit API)
Date: 2018-08-04

org.junit.experimental.categories

## Class IncludeCategories

- java.lang.Object
- - org.junit.experimental.categories.IncludeCategories

- All Implemented Interfaces:
    FilterFactory

      public final class IncludeCategories
      extends java.lang.Object

  `FilterFactory` to include categories. The `Filter` that is created will filter out tests that are categorized with any of the given categories. Usage from command line: `--filter=org.junit.experimental.categories.IncludeCategories=pkg.of.Cat1,pkg.of.Cat2` Usage from API: `new IncludeCategories().createFilter(Cat1.class, Cat2.class);`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.junit.runner.FilterFactory

      `FilterFactory.FilterNotCreatedException`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IncludeCategories()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Filter` | `createFilter(FilterFactoryParams params)` Creates a `Categories.CategoryFilter` given a `FilterFactoryParams` argument.
    `protected Filter` | `createFilter(java.util.List<java.lang.Class<?>> categories)` Creates a `Filter` which is only passed by tests that are categorized with any of the specified categories.

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

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

- - ### Constructor Detail

    - #### IncludeCategories

          public IncludeCategories()

  - ### Method Detail

    - #### createFilter

          protected Filter createFilter(java.util.List<java.lang.Class<?>> categories)

      Creates a `Filter` which is only passed by tests that are categorized with any of the specified categories.
      Parameters:
        `categories` - Category classes.

    - #### createFilter

          public Filter createFilter(FilterFactoryParams params)
                              throws FilterFactory.FilterNotCreatedException

      Creates a `Categories.CategoryFilter` given a `FilterFactoryParams` argument.
      Specified by:
        `createFilter` in interface `FilterFactory`
      Parameters:
        `params` - Parameters needed to create the `Filter`
      Throws:
        `FilterFactory.FilterNotCreatedException`