Package org.seedstack.seed.testing.spi
Interface TestPlugin
-
public interface TestPluginInterface for implementing test plugins that can alter the behavior of tests run with SeedStack.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidafterShutdown(TestContext testContext)This method is executed after shutting down the SeedStack environment used for testing.default String[]arguments(TestContext testContext)Allow the plugin to specify arguments used for launching the SeedStack environment used for testing.default voidbeforeLaunch(TestContext testContext)This method is executed before launching the SeedStack environment used for testing.default Map<String,String>configurationProperties(TestContext testContext)Allow the plugin to specify configuration properties for the SeedStack environment used for testing.default List<Class<? extends TestDecorator>>decorators()Returns the list ofTestDecoratorto apply to each test.booleanenabled(TestContext testContext)This method should return true to enable the plugin or false to completely disable it.default Optional<Class<? extends Exception>>expectedException(TestContext testContext)Allow the plugin to specify the exception that is expected to be the outcome of the SeedStack environment launch.default Map<String,String>kernelParameters(TestContext testContext)Allow the plugin to specify kernel parameters for the SeedStack environment used for testing.default Optional<? extends org.seedstack.seed.spi.SeedLauncher>launcher(TestContext testContext)Allow the plugin to specify a particularSeedLauncherto be used to launch the SeedStack environment used for testing.default LaunchModelaunchMode(TestContext testContext)Allow the plugin to specify a particularLaunchModefor the test.default booleanseparateThread(TestContext testContext)Allow the plugin to specify if the launch should occur in a separate thread or the main thread.
-
-
-
Method Detail
-
enabled
boolean enabled(TestContext testContext)
This method should return true to enable the plugin or false to completely disable it.- Parameters:
testContext- the test context.- Returns:
- true if the plugin should be enabled, false otherwise.
-
decorators
default List<Class<? extends TestDecorator>> decorators()
Returns the list ofTestDecoratorto apply to each test.- Returns:
- the list of
TestDecoratorclasses.
-
beforeLaunch
default void beforeLaunch(TestContext testContext)
This method is executed before launching the SeedStack environment used for testing.- Parameters:
testContext- the test context.
-
afterShutdown
default void afterShutdown(TestContext testContext)
This method is executed after shutting down the SeedStack environment used for testing.- Parameters:
testContext- the test context.
-
arguments
default String[] arguments(TestContext testContext)
Allow the plugin to specify arguments used for launching the SeedStack environment used for testing.- Parameters:
testContext- the test context.- Returns:
- the arguments used for launching the test environment.
-
configurationProperties
default Map<String,String> configurationProperties(TestContext testContext)
Allow the plugin to specify configuration properties for the SeedStack environment used for testing.- Parameters:
testContext- the test context.- Returns:
- the configuration properties for the test environment.
-
expectedException
default Optional<Class<? extends Exception>> expectedException(TestContext testContext)
Allow the plugin to specify the exception that is expected to be the outcome of the SeedStack environment launch.- Parameters:
testContext- the test context.- Returns:
- the exception that is expected to be the outcome of the test environment launch.
-
launchMode
default LaunchMode launchMode(TestContext testContext)
Allow the plugin to specify a particularLaunchModefor the test. TheLaunchMode.ANYmode specifies that this plugin doesn't require a particular mode.- Parameters:
testContext- the test context.- Returns:
- the launch mode to be used for the test environment.
-
launcher
default Optional<? extends org.seedstack.seed.spi.SeedLauncher> launcher(TestContext testContext)
Allow the plugin to specify a particularSeedLauncherto be used to launch the SeedStack environment used for testing.- Parameters:
testContext- the test context.- Returns:
- the
SeedLauncherto be used to launch the test environment.
-
separateThread
default boolean separateThread(TestContext testContext)
Allow the plugin to specify if the launch should occur in a separate thread or the main thread.- Parameters:
testContext- the test context.- Returns:
- true if the launch should be done in a new thread, false if it should be done in the main thread.
-
kernelParameters
default Map<String,String> kernelParameters(TestContext testContext)
Allow the plugin to specify kernel parameters for the SeedStack environment used for testing.- Parameters:
testContext- the test context.- Returns:
- the kernel parameters for the test environment.
-
-