Class CategoryHandler

  extended by net.sourceforge.sqlunit.handlers.CategoryHandler
All Implemented Interfaces:

public class CategoryHandler
extends java.lang.Object
implements IHandler

The CategoryHandler processes the contents of a Category tag in the input SQLUnit XML file. It decides whether a test falls into a user-defined category, which we will call the global category. The decision is made following these rules:

  1. If the current test's category tags is not present or is empty, the test matches and is executed;
  2. If the global category is not set, the test matches and is executed;
  3. The contents of the current test's category tag is parsed as a comma separated list and a check is made whether the global category matches (in the terms of regular expession matching) at least one element of that list. If it matches, the test then falls in the given global category.
The global category is provided in one of the following ways, sorted by priority:

$Revision: 1.5 $
Ivan Ivanov

Constructor Summary
Method Summary
 java.lang.Object process(org.jdom.Element elCategory)
          Processes the JDOM Element representing a Category Declaration.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CategoryHandler()
Method Detail


public java.lang.Object process(org.jdom.Element elCategory)
                         throws java.lang.Exception
Processes the JDOM Element representing a Category Declaration.

Specified by:
process in interface IHandler
elCategory - the JDOM Element to use.
a Boolean.TRUE if Category matches the test category, else Boolean.FALSE. Caller must cast appropriately. If category is not specified globally, then it is ignored.
if - there was a problem handling the category element.
java.lang.Exception - if something went wrong with the process call.