Class TestApplicationUtils


  • public class TestApplicationUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.File getInstallationDirectory()
      Returns the directory containing the installation of this application.
      static java.io.File getUniqueTempFolder()
      Creates a folder that is unique for the current installation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TestApplicationUtils

        public TestApplicationUtils()
    • Method Detail

      • getInstallationDirectory

        public static java.io.File getInstallationDirectory()
        Returns the directory containing the installation of this application. The value returned here will either be an actual installation directory or the parent directory of a cloned repository. This method will work in the various modes of operation, including:
        • Development Mode - running from a repo clone, from inside of an IDE or the command-line. In this mode a sample directory structure is:
                          /.../git_repos/ghidra_clone/ghidra/Ghidra/Features/Base/src/...
           
                          which means this method will return 'ghidra_clone'
           
        • Batch Testing Mode - running from a test server, but not from inside a complete build. This mode uses jar files for the compiled source code, but is running from within the structure of a cloned repo. In this mode a sample directory structure is:
                          /.../git_repos/ghidra_clone/ghidra/Ghidra/Features/Base/src/...
           
                          which means this method will return 'ghidra_clone'
           
        • Eclipse Release Development Mode - running from a full application release. This mode uses jar files from the installation for dependencies. The user test files are run from within an Eclipse that has been linked with the application installation. In this mode a sample directory structure is:
                          /.../Software/ghidra_10.0/Ghidra/Features/Base/lib/Base.jar
           
                          which means this method will return 'ghidra_10.0'
           
        Returns:
        the installation directory
      • getUniqueTempFolder

        public static java.io.File getUniqueTempFolder()
        Creates a folder that is unique for the current installation. This allows clients to have multiple clones (for development mode) or multiple installations (for release mode) on their machine, running tests from each repo simultaneously.
        Returns:
        a folder that is unique for the current installation