Using Categories

Categories are used to filter relevant test stories for the report.

Specifying Category

To add a category to a test case or test method use JUnit's @Category annotation.

We provide some predefined categories in the testdoc-annotations project.

Filter by Category

To filter by category use the properties includeCategories and excludeCategories. Specify the fully qualified type name of the category class or interface.

To include only those categories listed use

<includeCategories>
  <include>de.smartics.testdoc.categories.Technical</include>
  <include>org.mycompany.categories.MyCategory</include>
</includeCategories>

To exclude only some categories use

<excludeCategories>
  <exclude>de.smartics.testdoc.categories.Technical</exclude>
  <exclude>org.mycompany.categories.MyCategory</exclude>
</excludeCategories>

Both properties can be used together. Only those test cases persist that are tagged with categories found in includeCategories and are not found in excludeCategories. There is a special keyword "ALL" that explicitly includes or excludes all categories.

<configuration>
  <outputName>technical-only</outputName>
  <name>Technical Only</name>
  <description>Only the technical test stories.</description>
  <includeCategories>
    <include>de.smartics.testdoc.categories.Technical</include>
  </includeCategories>
  <excludeCategories>
    <exclude>ALL</exclude>
  </excludeCategories>
</configuration>

Labels for Categories

To provide labels for self defined categories please refer to Labels for Categories.