Class TestGeneious


  • public class TestGeneious
    extends java.lang.Object
    Provides methods to facilitate writing test cases for Geneious plugins
    • Method Detail

      • initialize

        public static void initialize()
        Initialize various public api utility methods. This is done automatically when Geneious starts, but when writing test cases, it is sometimes necessary to call this method before the test cases can be run.
      • isRunningTest

        public static boolean isRunningTest()
        Checks whether we are currently running from tests or whether Geneious is running normally. As of 2007-07-19, this property defaults to true and is set to false by main() when running in non-testing mode.

        Most code shouldn't depend on this method because in tests most code should do the same as normally (otherwise we can't test the normal code!). However there are few cases where this is not the case, e.g. if we accidentally submit error reports while running from a test then we'd like to flag those incidents as tests so they don't show up in our bug count

        Returns:
        true if the code is currently running from tests (e.g. JUnit or Abbot tests)
        See Also:
        setNotRunningTest(), Geneious.isClient()
      • setNotRunningTest

        public static void setNotRunningTest()
        This is the first thing called by the application main() method. If it is never called (which will be the case when running unit tests), then isRunningTest() will default to true.
        Throws:
        java.lang.IllegalStateException - if this method is called more than once.
        See Also:
        isRunningTest()
      • isRunningApplication

        @Deprecated
        public static boolean isRunningApplication()
        Deprecated.
        Returns:
        true if the Geneious application is running. The only time this will be false is if some part of Geneious is being executed without the Geneious application running. (e.g. from test cases that do not start the full Geneious application or from applets)
        See Also:
        setRunningApplication(), isRunningTest()
      • setRunningApplication

        public static void setRunningApplication()
        This is second thing (after setNotRunningTest() when starting the Geneious application. If it is never called (which will be the case when running unit tests that don't start the full application), then isRunningApplication() will default to false.
        Throws:
        java.lang.IllegalStateException - if this method is called more than once.
        See Also:
        isRunningApplication()