Package org.nuxeo.runtime.test.runner
Interface RunnerFeature
-
- All Known Implementing Classes:
ConditionalIgnoreRule.Feature
,ContainerFeature
,DocumentRoutingFeature
,FileEventsTrackingFeature
,H2OnlyFeature
,LogCaptureFeature
,LogFeature
,ManagementFeature
,MDCFeature
,MockitoFeature
,NuxeoThemeFeature
,RandomBug.Feature
,RestartFeature
,RestServerFeature
,RuntimeFeature
,ServletContainerFeature
,SimpleFeature
,TransactionalFeature
,WebDriverFeature
,WebEngineFeature
,WebEngineFeatureCore
,WithFrameworkPropertyFeature
public interface RunnerFeature
These are the states the runner goes through when using runtime feature:CREATE FRAMEWORK new feature() --> constructor COLLECT DEFINED DEPLOYMENTS feature.initialize() --> can be used to configure nuxeo home or register JNDI objects START FRAMEWORK feature.start() feature.beforeRun() feature.configure() --> can be used to add guice bindings and to dynamically deploy components using the harness for each test method: feature.testCreated() feature.beforeSetup feature.beforeMethodRun() --> test method interceptor testMethod() feature.afterMethodRun() --> test method interceptor feature.afterTeardown() feature.afterRun() --> cleanup that require framework to be started STOP FRAMEWORK feature.stop() --> destructor
- Author:
- Bogdan Stefanescu
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
afterMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
After a test method was ran.default void
afterRun(FeaturesRunner runner)
After tests were run.default void
afterTeardown(FeaturesRunner runner)
Deprecated.since 11.1, useafterTeardown(FeaturesRunner, FrameworkMethod, Object)
insteaddefault void
afterTeardown(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
After the call of the @After methodsdefault void
beforeMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
Before a test method is invoked.default void
beforeRun(FeaturesRunner runner)
Before running tests.default void
beforeSetup(FeaturesRunner runner)
Deprecated.since 11.1, usebeforeSetup(FeaturesRunner, FrameworkMethod, Object)
insteaddefault void
beforeSetup(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test)
Before entering in the @Before methodsdefault void
configure(FeaturesRunner runner, com.google.inject.Binder binder)
Configures Guice bindings if any is required by the feature.default void
initialize(FeaturesRunner runner)
Called when preparing to run the test class.default void
start(FeaturesRunner runner)
Features are initialized.default void
stop(FeaturesRunner runner)
Before exiting the test.default void
testCreated(Object test)
Notification that a test instance was created.
-
-
-
Method Detail
-
initialize
default void initialize(FeaturesRunner runner) throws Exception
Called when preparing to run the test class. Framework is not started at this point. Here is time for the feature to configure the runner from annotations on the test class.- Throws:
Exception
-
configure
default void configure(FeaturesRunner runner, com.google.inject.Binder binder)
Configures Guice bindings if any is required by the feature. This is called after the framework is started and before Guice module is built. The tests are launched after guice module is built.
-
beforeRun
default void beforeRun(FeaturesRunner runner) throws Exception
Before running tests. At this point Guice modules are registered and injector created.- Throws:
Exception
-
afterRun
default void afterRun(FeaturesRunner runner) throws Exception
After tests were run.- Throws:
Exception
-
start
default void start(FeaturesRunner runner) throws Exception
Features are initialized. Runner is ready to create the injector.- Throws:
Exception
-
testCreated
default void testCreated(Object test) throws Exception
Notification that a test instance was created. Can be used by features to make custom injection or other preparation of the test instance.- Throws:
Exception
-
stop
default void stop(FeaturesRunner runner) throws Exception
Before exiting the test.- Throws:
Exception
-
beforeSetup
@Deprecated default void beforeSetup(FeaturesRunner runner) throws Exception
Deprecated.since 11.1, usebeforeSetup(FeaturesRunner, FrameworkMethod, Object)
insteadBefore entering in the @Before methods- Throws:
Exception
-
beforeSetup
default void beforeSetup(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) throws Exception
Before entering in the @Before methods- Throws:
Exception
-
afterTeardown
@Deprecated default void afterTeardown(FeaturesRunner runner) throws Exception
Deprecated.since 11.1, useafterTeardown(FeaturesRunner, FrameworkMethod, Object)
insteadAfter the call of the @After methods- Throws:
Exception
-
afterTeardown
default void afterTeardown(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) throws Exception
After the call of the @After methods- Throws:
Exception
-
beforeMethodRun
default void beforeMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) throws Exception
Before a test method is invoked.- Throws:
Exception
-
afterMethodRun
default void afterMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) throws Exception
After a test method was ran.- Throws:
Exception
-
-