Class TestWithPlugin
java.lang.Object
test.de.iip_ecosphere.platform.support.TestWithPlugin
Plugin-based test, aiming at inheriting plugin loading.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classRepresents a plugin location. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprivate static Stringprivate static booleanprivate static List<TestWithPlugin.PluginLocation> static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPluginLocation(String parent, String folder, boolean descriptorOnly, String... appends) Adds a new plugin location; the install folder is eitherfolderor the suffix after the last ".".static voidaddPluginLocation(String parent, String folder, String... appends) Adds a new plugin location for full classpath loading; the install folder is eitherfolderor the suffix after the last ".".static voidaddPluginLocation(String parent, String folder, String installFolder, boolean descriptorOnly, String... appends) Adds a new plugin location.static voidaddRunAfterLoading(Runnable runnable) Adds functions to be executed after loading.static voidclear()Removes all plugin locations.private static File[]collectAppends(File base, String[] appends) Collects the appended plugins.static voidenableLocalPlugins(boolean enable) Whether local plugins shall be enabled.private static FilefindPluginFolder(String parent, String child) Triesparent/childas plugin folder.static voidLoads plugins statically.static voidsetInstallDir(String dir) Sets the folder where the plugins are installed.voidsetup()Sets up plugins.
-
Field Details
-
PROP_AAS_PLUGIN
- See Also:
-
loaded
private static boolean loaded -
locations
-
installDir
-
runAfterLoading
-
enableLocalPlugins
private static boolean enableLocalPlugins
-
-
Constructor Details
-
TestWithPlugin
public TestWithPlugin()
-
-
Method Details
-
addPluginLocation
Adds a new plugin location for full classpath loading; the install folder is eitherfolderor the suffix after the last ".".- Parameters:
parent- the parent folder (in git workspace, typically a prefix offolder)folder- the plugin folder within the parent folder (in git workspace)appends- optional plugins to be appended
-
addPluginLocation
public static void addPluginLocation(String parent, String folder, boolean descriptorOnly, String... appends) Adds a new plugin location; the install folder is eitherfolderor the suffix after the last ".".- Parameters:
parent- the parent folder (in git workspace, typically a prefix offolder)folder- the plugin folder within the parent folder (in git workspace)descriptorOnly- shall only be descriptor JARs loaded or the full classpathappends- optional plugins to be appended
-
addPluginLocation
public static void addPluginLocation(String parent, String folder, String installFolder, boolean descriptorOnly, String... appends) Adds a new plugin location.- Parameters:
parent- the parent folder (in git workspace, typically a prefix offolder)folder- the plugin folder within the parent folder (in git workspace)installFolder- (in unpacked plugins)descriptorOnly- shall only be descriptor JARs loaded or the full classpathappends- optional plugins to be appended
-
collectAppends
Collects the appended plugins.- Parameters:
base- the base folder for relocationappends- the appended plugins- Returns:
- the appended plugins, may be null
-
enableLocalPlugins
public static void enableLocalPlugins(boolean enable) Whether local plugins shall be enabled.- Parameters:
enable- enable or disable (default is enabled)
-
setInstallDir
Sets the folder where the plugins are installed.- Parameters:
dir- the folder
-
loadPlugins
public static void loadPlugins()Loads plugins statically. -
findPluginFolder
Triesparent/childas plugin folder. If it does not exist, search forparent/child-*(appended maven version).- Parameters:
parent- the parentchild- the child to search for- Returns:
- the plugin folder, may not exist
-
addRunAfterLoading
Adds functions to be executed after loading.- Parameters:
runnable- the runnable to add
-
clear
public static void clear()Removes all plugin locations. -
setup
public void setup()Sets up plugins. Non-static so that loading is inherited.
-