Package ghidra.util
Class TestSuiteUtilities
java.lang.Object
ghidra.util.TestSuiteUtilities
A set of static utilities to facilitate JUnit testing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateTestSuites(File baseDir, String className, String pkgName) Create the Java source file a JUnit TestSuite which includes all TestCases within a package directory.static intcreateTestSuites(File baseDir, String className, String pkgName, boolean recurse) Create the Java source file a JUnit TestSuite which includes all TestCases within a package directory.getClassNames(String pkgName, Class<?> searchClass) Get all class names within the named package which extend or implement the specified search class.static junit.framework.TestSuitegetPkgTestSuite(String pkgName) Build JUnit test suite for the specified package only.getSubPkgNames(String pkgName) Get all potential package names within the named package.static junit.framework.TestSuitegetTestSuite(String pkgName) Build JUnit test suite for the specified package.static voidCommand-line utilities.
-
Constructor Details
-
TestSuiteUtilities
public TestSuiteUtilities()
-
-
Method Details
-
getTestSuite
Build JUnit test suite for the specified package. TestSuite includes sub-TestSuites for each sub-package.- Parameters:
pkgName- the java package name- Returns:
- test suite
-
getPkgTestSuite
Build JUnit test suite for the specified package only.- Parameters:
pkgName- the java package name- Returns:
- test suite
-
getClassNames
Get all class names within the named package which extend or implement the specified search class.- Parameters:
pkgName- package namesearchClass- base or interface class to search for.
-
getSubPkgNames
Get all potential package names within the named package.- Parameters:
pkgName- package name
-
createTestSuites
public static void createTestSuites(File baseDir, String className, String pkgName) throws IOException Create the Java source file a JUnit TestSuite which includes all TestCases within a package directory.- Parameters:
baseDir- the base package directoryclassName- the class namepkgName- the java package name- Throws:
IOException
-
createTestSuites
public static int createTestSuites(File baseDir, String className, String pkgName, boolean recurse) throws IOException Create the Java source file a JUnit TestSuite which includes all TestCases within a package directory.- Parameters:
baseDir-className-pkgName-recurse-- Throws:
IOException
-
main
Command-line utilities.Parameter usage:
createAllTests <baseDirPath> <className> <topPackage>- Parameters:
args-
-