Nuxeo Enterprise Platform 5.4

org.nuxeo.runtime.test.runner
Class SimpleFeature

java.lang.Object
  extended by org.nuxeo.runtime.test.runner.SimpleFeature
All Implemented Interfaces:
RunnerFeature
Direct Known Subclasses:
CoreFeature, DistributionFeature, JettyFeature, NuxeoThemeFeature, PlatformFeature, RuntimeFeature, WebDriverFeature, WebEngineFeature

public class SimpleFeature
extends java.lang.Object
implements 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()
 CREATE INJECTOR => feature.configure() --> can be used to add guice bindings and to dynamically deploy components using the harness
 feature.beforeRun()
 feature.beforeMethodRun()  --> test method interceptor
 feature.afterMethodRun()   --> test method interceptor
 feature.afterRun() --> cleanup that require framework to be started
 STOP FRAMEWORK
 feature.stop()  --> destructor
 

Author:
Bogdan Stefanescu

Constructor Summary
SimpleFeature()
           
 
Method Summary
 void afterMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, java.lang.Object test)
          After a test method was ran.
 void afterRun(FeaturesRunner runner)
          After tests were run.
 void beforeMethodRun(FeaturesRunner runner, org.junit.runners.model.FrameworkMethod method, java.lang.Object test)
          Before a test method is invoked.
 void beforeRun(FeaturesRunner runner)
          Before running tests.
 void configure(FeaturesRunner runner, com.google.inject.Binder binder)
          Configures Guice bindings if any is required by the feature.
 void initialize(FeaturesRunner runner)
          Called when preparing to run the test class.
 void start(FeaturesRunner runner)
          Features are initialized.
 void stop(FeaturesRunner runner)
          Before exiting the test.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleFeature

public SimpleFeature()
Method Detail

afterRun

public void afterRun(FeaturesRunner runner)
              throws java.lang.Exception
Description copied from interface: RunnerFeature
After tests were run.

Specified by:
afterRun in interface RunnerFeature
Throws:
java.lang.Exception

beforeRun

public void beforeRun(FeaturesRunner runner)
               throws java.lang.Exception
Description copied from interface: RunnerFeature
Before running tests. At this point Guice modules are registered and injector created.

Specified by:
beforeRun in interface RunnerFeature
Throws:
java.lang.Exception

start

public void start(FeaturesRunner runner)
           throws java.lang.Exception
Description copied from interface: RunnerFeature
Features are initialized. Runner is ready to create the injector.

Specified by:
start in interface RunnerFeature
Throws:
java.lang.Exception

stop

public void stop(FeaturesRunner runner)
          throws java.lang.Exception
Description copied from interface: RunnerFeature
Before exiting the test.

Specified by:
stop in interface RunnerFeature
Throws:
java.lang.Exception

configure

public void configure(FeaturesRunner runner,
                      com.google.inject.Binder binder)
Description copied from interface: RunnerFeature
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.

Specified by:
configure in interface RunnerFeature

initialize

public void initialize(FeaturesRunner runner)
                throws java.lang.Exception
Description copied from interface: RunnerFeature
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.

Specified by:
initialize in interface RunnerFeature
Throws:
java.lang.Exception

afterMethodRun

public void afterMethodRun(FeaturesRunner runner,
                           org.junit.runners.model.FrameworkMethod method,
                           java.lang.Object test)
                    throws java.lang.Exception
Description copied from interface: RunnerFeature
After a test method was ran.

Specified by:
afterMethodRun in interface RunnerFeature
Throws:
java.lang.Exception

beforeMethodRun

public void beforeMethodRun(FeaturesRunner runner,
                            org.junit.runners.model.FrameworkMethod method,
                            java.lang.Object test)
                     throws java.lang.Exception
Description copied from interface: RunnerFeature
Before a test method is invoked.

Specified by:
beforeMethodRun in interface RunnerFeature
Throws:
java.lang.Exception

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.