com.evanmclean.evlib.junit
Class TestAll

java.lang.Object
  extended by com.evanmclean.evlib.junit.TestAll

public final class TestAll
extends Object

Generates a test suite for the entire Java implementation. Runs all Java test cases in the source tree that extend TestCase and are of a specified type.

A typical implementation of a test suite class that uses this object is:

 public class AllTests
 {
   public static Test suite() throws Throwable
   {
     return TestAll.getSuite("target/test-classes", "com.company.app.sub1",
       "UNIT");
   }
 }
 

See getSuite(String, String, String) for more details.

Author:
Evan McLean McLean Computer Services (see the overview for copyright and licensing.)

Field Summary
static String DEFAULT_TEST_TYPE
          The default test type value for test_type, which is "UNIT".
 
Method Summary
static junit.framework.Test getSuite(String class_root, String package_root)
          Dynamically create a test suite from a set of class files in a directory tree, using the default test_type of "UNIT".
static junit.framework.Test getSuite(String class_root, String package_root, String test_type)
          Dynamically create a test suite from a set of class files in a directory tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TEST_TYPE

public static final String DEFAULT_TEST_TYPE
The default test type value for test_type, which is "UNIT".

See Also:
Constant Field Values
Method Detail

getSuite

public static junit.framework.Test getSuite(String class_root,
                                            String package_root)
                                     throws Throwable
Dynamically create a test suite from a set of class files in a directory tree, using the default test_type of "UNIT".

Parameters:
class_root - The directory containing the classes. e.g., /product/classes
package_root - Where to start looking for packages within the package tree. e.g., com.company.app.sub1 will only run tests in package com.company.app.sub1 or below.
Returns:
The test suite.
Throws:
Throwable

getSuite

public static junit.framework.Test getSuite(String class_root,
                                            String package_root,
                                            String test_type)
                                     throws Throwable
Dynamically create a test suite from a set of class files in a directory tree.

Parameters:
class_root - The directory containing the classes. e.g., /product/classes
package_root - Where to start looking for packages within the package tree. e.g., com.company.app.sub1 will only run tests in package com.company.app.sub1 or below.
test_type - Tye type of test case to load. All test cases with public static final String TEST_ALL_TEST_TYPE defined to match the value of test_type will be loaded. The default value (specified by DEFAULT_TEST_TYPE) is "UNIT".
Returns:
The test suite.
Throws:
Throwable