TProd - the type of ApplicationContextProducer that can provide specific typeT - the type of application context instancepublic abstract class AbstractApplicationContextLifecycleHandler<TProd extends ApplicationContextProducer<T>,T extends TestScopeApplicationContext> extends Object
The application context lifecycle handler, which is responsible for instantiating the application context prior the test and destroying it as soon as it's not needed any longer.
Currently the application context can be created once for whole test case or separately for each individual test.
The strategy on how the application context is being instantiated is being determined from the ContextLifeCycle annotation defined on the test class. By default all the tests in the same test case share the same
instance of application context.
ApplicationContextProducer,
ContextLifeCycle,
ContextLifeCycleMode| Constructor and Description |
|---|
AbstractApplicationContextLifecycleHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterSuite(org.jboss.arquillian.test.spi.event.suite.AfterSuite event)
The before test event handler.
|
void |
afterTest(org.jboss.arquillian.test.spi.event.suite.After event)
The after test event handler.
|
void |
beforeClass(org.jboss.arquillian.test.spi.event.suite.BeforeClass event)
The before class event handler.
|
void |
beforeTest(org.jboss.arquillian.test.spi.event.suite.Before event)
The before test event handler.
|
protected abstract T |
getApplicationContext()
Retrieves the application context.
|
protected abstract Class<TProd> |
getProducerClass()
Retrieves the
ApplicationContextProducer instance. |
protected abstract void |
setApplicationContext(T applicationContext)
Sets the application context instance.
|
public AbstractApplicationContextLifecycleHandler()
protected abstract T getApplicationContext()
Retrieves the application context.
protected abstract void setApplicationContext(T applicationContext)
Sets the application context instance.
applicationContext - the application context instanceprotected abstract Class<TProd> getProducerClass()
Retrieves the ApplicationContextProducer instance.
ApplicationContextProducer instancepublic void beforeClass(@Observes
org.jboss.arquillian.test.spi.event.suite.BeforeClass event)
The before class event handler.
Delegates to the registered ApplicationContextProducer instances in order to create the application
context.
event - the before class eventpublic void beforeTest(@Observes
org.jboss.arquillian.test.spi.event.suite.Before event)
The before test event handler.
Delegates to the registered ApplicationContextProducer instances in order to create the application
context.
event - the before test eventpublic void afterTest(@Observes
org.jboss.arquillian.test.spi.event.suite.After event)
The after test event handler.
Delegates to the registered ApplicationContextProducer instances in order to create the application
context.
event - the after test eventpublic void afterSuite(@Observes
org.jboss.arquillian.test.spi.event.suite.AfterSuite event)
The before test event handler.
Delegates to the registered ApplicationContextProducer instances in order to create the application
context.
event - the after suite eventCopyright © 2013 JBoss by Red Hat. All Rights Reserved.