Class RecursiveTestSuite
java.lang.Object
junit.framework.TestSuite
com.gargoylesoftware.base.testing.RecursiveTestSuite
- All Implemented Interfaces:
junit.framework.Test
public class RecursiveTestSuite
extends junit.framework.TestSuite
A launching point for executing test cases. This recusively walks through
the directory structure looking for classes that end in Test.class. It then
loads these classes to see if they are instances of TestCase. If so, they
are added to the test suite. Once all directories have been scanned, the
test cases are executed.
- Version:
- $Revision: 1.3 $
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRecursiveTestSuite
(File startingPath, TestFilter testFilter) Create an instanceRecursiveTestSuite
(String startingPath, TestFilter testFilter) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionprivate Set
findAllTestClasses
(File startingDirectory) private void
findAllTestClasses
(File directory, List list) private junit.framework.Test
getTestForClass
(Class clazz) Return a test suite containing all the tests for the specified class.static void
Main entry point.void
testFoo()
Dummy test so that JUnit doesn't complain that this suite doesn't have any tests.Methods inherited from class junit.framework.TestSuite
addTest, addTestSuite, countTestCases, createTest, getName, getTestConstructor, run, runTest, setName, testAt, testCount, tests, toString, warning
-
Field Details
-
testFilter_
-
-
Constructor Details
-
RecursiveTestSuite
Create a new instance- Parameters:
startingPath
- The directory that we will start our descent in.testFilter
- The object that will filter out tests that we don't wish to run- Throws:
IOException
- If anything goes wrong during the directory scanning.
-
RecursiveTestSuite
Create an instance- Parameters:
startingPath
- The directory that we will start our descent in.testFilter
- The object that will filter out tests that we don't wish to run- Throws:
IOException
- If anything goes wrong during the directory scanning.
-
-
Method Details
-
main
Main entry point.- Parameters:
args
- The arguments
-
testFoo
public void testFoo()Dummy test so that JUnit doesn't complain that this suite doesn't have any tests. -
getTestForClass
Return a test suite containing all the tests for the specified class. If the class has a suite() method then it will be used to get the tests, otherwise reflection will be used.- Parameters:
clazz
- Description of Parameter- Returns:
- The testSuiteForClass value
-
findAllTestClasses
- Parameters:
startingDirectory
- Description of Parameter- Returns:
- Description of the Returned Value
- Throws:
IOException
- Description of Exception
-
findAllTestClasses
- Parameters:
directory
- Description of Parameterlist
- Description of Parameter- Throws:
IOException
- Description of Exception
-