Package ghidra.util

Class TestSuiteUtilities

java.lang.Object
ghidra.util.TestSuiteUtilities

public class TestSuiteUtilities extends Object
A set of static utilities to facilitate JUnit testing.
  • Constructor Details

    • TestSuiteUtilities

      public TestSuiteUtilities()
  • Method Details

    • getTestSuite

      public static junit.framework.TestSuite getTestSuite(String pkgName)
      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

      public static junit.framework.TestSuite getPkgTestSuite(String pkgName)
      Build JUnit test suite for the specified package only.
      Parameters:
      pkgName - the java package name
      Returns:
      test suite
    • getClassNames

      public static Iterator<String> getClassNames(String pkgName, Class<?> searchClass)
      Get all class names within the named package which extend or implement the specified search class.
      Parameters:
      pkgName - package name
      searchClass - base or interface class to search for.
    • getSubPkgNames

      public static Iterator<String> getSubPkgNames(String pkgName)
      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 directory
      className - the class name
      pkgName - 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

      public static void main(String[] args)
      Command-line utilities.

      Parameter usage:

          createAllTests <baseDirPath> <className> <topPackage>
       
      Parameters:
      args -