Class TestGeneious
- java.lang.Object
-
- com.biomatters.geneious.publicapi.plugin.TestGeneious
-
public class TestGeneious extends java.lang.Object
Provides methods to facilitate writing test cases for Geneious plugins
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
initialize()
Initialize various public api utility methods.static void
initializeAllBundledPlugins()
Initializes all plugins that are bundled with Geneious so that that variousPluginUtilities
methods are able to access them.static void
initializeAllPlugins()
Initializes all available plugins so that that variousPluginUtilities
methods are able to access them.static void
initializePlugins(GeneiousPlugin... plugins)
Initializes plugins so that variousPluginUtilities
methods are able to access them.static void
initializePlugins(java.lang.String... pluginNames)
Initializes plugins so that variousPluginUtilities
methods are able to access them.static boolean
isRunningApplication()
Deprecated.UseGeneious.isClient()
insteadstatic boolean
isRunningTest()
Checks whether we are currently running from tests or whether Geneious is running normally.static void
setNotRunningTest()
This is the first thing called by the application main() method.static void
setRunningApplication()
This is second thing (aftersetNotRunningTest()
when starting the Geneious application.
-
-
-
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.
-
initializePlugins
public static void initializePlugins(java.lang.String... pluginNames)
Initializes plugins so that variousPluginUtilities
methods are able to access them. For example if your test case relies on importing a file type that another plugin provides support for, then you would call this method followed by a call toPluginUtilities.importDocuments(java.io.File, jebl.util.ProgressListener)
.- Parameters:
pluginNames
- A list of fully qualified class names of plugins to initialize. If no plugins are specified, then all available plugins are initialized. The behaviour where Geneious initializes all plugins if this is an empty list will be deprecated in future. UseinitializeAllPlugins()
instead.- See Also:
initializePlugins(GeneiousPlugin[])
,initializeAllPlugins()
,initializeAllBundledPlugins()
-
initializeAllPlugins
public static void initializeAllPlugins()
Initializes all available plugins so that that variousPluginUtilities
methods are able to access them. For example if your test case relies on iterating through all DocumentOperations, you would call this method followed by a call toPluginUtilities.getDocumentOperations()
.- Since:
- Geneious 3.8
- See Also:
initializePlugins(GeneiousPlugin[])
,initializeAllBundledPlugins()
-
initializeAllBundledPlugins
public static void initializeAllBundledPlugins()
Initializes all plugins that are bundled with Geneious so that that variousPluginUtilities
methods are able to access them. For example if your test case relies on iterating through all DocumentOperations, you would call this method followed by a call toPluginUtilities.getDocumentOperations()
.- Since:
- Geneious 3.8
- See Also:
initializePlugins(GeneiousPlugin[])
,initializeAllPlugins()
-
initializePlugins
public static void initializePlugins(GeneiousPlugin... plugins)
Initializes plugins so that variousPluginUtilities
methods are able to access them. For example if your test case relies on importing a file type that another plugin provides support for, then you would call this method followed by a call toPluginUtilities.importDocuments(java.io.File, jebl.util.ProgressListener)
.- Parameters:
plugins
- A list of plugins to initialize.- Since:
- Geneious 3.8
- See Also:
initializePlugins(String[])
,initializeAllPlugins()
-
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), thenisRunningTest()
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.UseGeneious.isClient()
instead- 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 (aftersetNotRunningTest()
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), thenisRunningApplication()
will default to false.- Throws:
java.lang.IllegalStateException
- if this method is called more than once.- See Also:
isRunningApplication()
-
-