Custom plugins can get defined in framework.xml. The framework.xml file is a simple file where you can configure different beans to be instantiated in JTAF Core. One of these beans is the PluginManager where custom plugins may be defined.
The PluginManager lets you include custom parsing plugins, command runner plugins, and test runner plugins.
By adding properties to the PluginManager bean, you can declare a list of as many custom plugins for that class of plugins as want to.
For example, in order to declare a testRunnerPlugin and a couple commandRunnerPlugins, you can include the following in your framework.xml file:
Framework.xml
<bean id="PluginManager" class="org.finra.jtaf.core.plugins.parsing.PluginManager">
<property name="testRunnerPlugins">
<list>
<bean class="com.mycompany.plugins.SetupAndTearDownBeforeTestPlugin" />
</list>
<property name="commandRunnerPlugins">
<list>
<bean class="com.mycompany.plugins.PerformActionBeforeEveryCommandPlugin1" />
<bean class="com.mycompany.plugins.PerformActionBeforeEveryCommandPlugin2" />
</list>
</property>
</bean>
Parsing Plugins
The full list of plugin interfaces available, their framework.xml property names, and descriptions of when actions are performed is below:
IPostParseAllPlugin (framework.xml property name: postParseAllPlugins) – executes after all tests are parsed
IPostParseSuitePlugin (framework.xml property name: postParseSuitePlugins) – executes after each test suite is parsed
IPostParseTestPlugin (framework.xml property name: postParseTestPlugins) – executes after each test is parsed
IPostParseStrategyPlugin (framework.xml property name: postParseStrategyPlugins) – executes after the test strategy is parsed
Runner Plugins
ITestRunnerPlugin (framework.xml property name: testRunnerPlugins) – executes before and/or after each test runs
ICommandRunnerPlugin (framework.xml property name: commandRunnerPlugins) – executes before and/or after each command in the tests runs