junit.extensions.awt
Class AWTTestSuite

java.lang.Object
  |
  +--junit.framework.TestSuite
        |
        +--junit.extensions.awt.AWTTestSuite
All Implemented Interfaces:
junit.framework.Test

public class AWTTestSuite
extends junit.framework.TestSuite

Similar to TestSuite, except that it auto-generates a suite based on test scripts matching certain criteria.

By default, generate a suite of all scripts found in a given directory for which the accept method returns true. Note that there is no guarantee of the order of the scripts.


Constructor Summary
AWTTestSuite(java.lang.Class testClass)
          Constructs a suite of tests from all the scripts found in the current directory.
AWTTestSuite(java.lang.Class testClass, java.lang.String dirname)
          Constructs a suite of tests from all the scripts found in the given directory.
AWTTestSuite(java.lang.Class testClass, java.lang.String dirname, boolean recurse)
          Constructs an AWTTestSuite from all the scripts in the given directory, recursing if recurse is true.
 
Method Summary
protected  boolean accept(java.io.File file)
          Return whether to accept the given file.
protected  java.util.Vector findTestScripts(java.io.File dir, java.util.Vector files)
          Add all test scripts in the given directory and below that start with the given prefix.
 java.io.File getDirectory()
          Returns the directory in which to begine the script search.
 boolean recurse()
          Return whether to recurse into the base directory.
 
Methods inherited from class junit.framework.TestSuite
addTest, addTestSuite, countTestCases, getName, run, runTest, setName, testAt, testCount, tests, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AWTTestSuite

public AWTTestSuite(java.lang.Class testClass)
Constructs a suite of tests from all the scripts found in the current directory. Does not recurse to subdirectories.

AWTTestSuite

public AWTTestSuite(java.lang.Class testClass,
                    java.lang.String dirname)
Constructs a suite of tests from all the scripts found in the given directory. Does not recurse to subdirectories.

AWTTestSuite

public AWTTestSuite(java.lang.Class testClass,
                    java.lang.String dirname,
                    boolean recurse)
Constructs an AWTTestSuite from all the scripts in the given directory, recursing if recurse is true.
Method Detail

accept

protected boolean accept(java.io.File file)
Return whether to accept the given file. The default implementation omits common backup files.

recurse

public boolean recurse()
Return whether to recurse into the base directory.

getDirectory

public java.io.File getDirectory()
Returns the directory in which to begine the script search.

findTestScripts

protected java.util.Vector findTestScripts(java.io.File dir,
                                           java.util.Vector files)
Add all test scripts in the given directory and below that start with the given prefix.