JUnit-addons
version 1.4

junitx.util
Class SimpleTestFilter

java.lang.Object
  |
  +--junitx.util.SimpleTestFilter
All Implemented Interfaces:
TestFilter

public class SimpleTestFilter
extends java.lang.Object
implements TestFilter

Simple filter for test classes (ending with 'Test'). Also provides convenient methods to extract the name and package of a class.

Version:
$Revision: 1.6 $ $Date: 2003/04/28 05:18:28 $
Author:
Vladimir R. Bossicard

Constructor Summary
SimpleTestFilter()
          Constructs an empty SimpleTestFilter object.
 
Method Summary
static java.lang.String getClassName(java.lang.Class cls)
          Returns the name of a given class.
static java.lang.String getClassName(java.lang.String classpath)
          Returns the name of a given class.
static java.lang.String getPackageName(java.lang.Class cls)
          Returns the package name of a given class or an empty string if the class wasn't in a package.
static java.lang.String getPackageName(java.lang.String classpath)
          Returns the path and package name of a given class or null if the class wasn't in a package.
 boolean include(java.lang.Class cls)
          Returns true if: the class is neither an interface nor abstract
 boolean include(java.lang.String classpath)
          Returns true if: the name of the class ends with 'Test'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTestFilter

public SimpleTestFilter()
Constructs an empty SimpleTestFilter object.

Method Detail

include

public boolean include(java.lang.String classpath)
Returns true if:

Specified by:
include in interface TestFilter
See Also:
getClassName(String), getPackageName(String)

include

public boolean include(java.lang.Class cls)
Returns true if:

Specified by:
include in interface TestFilter
See Also:
getClassName(Class), getPackageName(Class)

getClassName

public static java.lang.String getClassName(java.lang.Class cls)
Returns the name of a given class.


getPackageName

public static java.lang.String getPackageName(java.lang.Class cls)
Returns the package name of a given class or an empty string if the class wasn't in a package.


getClassName

public static java.lang.String getClassName(java.lang.String classpath)
Returns the name of a given class.


getPackageName

public static java.lang.String getPackageName(java.lang.String classpath)
Returns the path and package name of a given class or null if the class wasn't in a package. Note that the patch is also included into the classpath!


JUnit-addons
version 1.4

Copyright © 2002-2003 Vladimir R. Bossicard. All Rights Reserved.