Package org.nuxeo.runtime.test.runner
Interface RunnerFeature
- All Known Implementing Classes:
ConditionalIgnoreRule.Feature,ContainerFeature,DocumentRoutingFeature,FileEventsTrackingFeature,H2OnlyFeature,LogCaptureFeature,LogFeature,ManagementFeature,MDCFeature,MockitoFeature,RandomBug.Feature,RestartFeature,RestServerFeature,RuntimeFeature,ServletContainerFeature,SimpleFeature,TransactionalFeature,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
Modifier and TypeMethodDescriptiondefault voidafterMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) After a test method was ran.default voidafterRun(FeaturesRunner runner) After tests were run.default voidafterTeardown(FeaturesRunner runner) Deprecated.default voidafterTeardown(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) After the call of the @After methodsdefault voidbeforeMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) Before a test method is invoked.default voidbeforeRun(FeaturesRunner runner) Before running tests.default voidbeforeSetup(FeaturesRunner runner) Deprecated.since 11.1, usebeforeSetup(FeaturesRunner, FrameworkMethod, Object)insteaddefault voidbeforeSetup(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, Object test) Before entering in the @Before methodsdefault voidconfigure(FeaturesRunner runner, com.google.inject.Binder binder) Configures Guice bindings if any is required by the feature.default voidinitialize(FeaturesRunner runner) Called when preparing to run the test class.default voidstart(FeaturesRunner runner) Features are initialized.default voidstop(FeaturesRunner runner) Before exiting the test.default voidtestCreated(Object test) Notification that a test instance was created.
-
Method Details
-
initialize
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
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
Before running tests. At this point Guice modules are registered and injector created.- Throws:
Exception
-
afterRun
After tests were run.- Throws:
Exception
-
start
Features are initialized. Runner is ready to create the injector.- Throws:
Exception
-
testCreated
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
Before exiting the test.- Throws:
Exception
-
beforeSetup
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.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
-
afterTeardown(FeaturesRunner, FrameworkMethod, Object)instead