|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.component.embed.EmbeddableComponentManager
org.xwiki.test.TestComponentManager
public class TestComponentManager
Initialize a Component Manager and uses the AllComponents and
ComponentList annotations to decide what components to discover and register.
Also offers helper APIs to register components and in-memory configuration sources.
| Field Summary | |
|---|---|
protected org.xwiki.test.internal.ComponentRegistrator |
componentRegistrator
Used to register components. |
| Constructor Summary | |
|---|---|
TestComponentManager()
|
|
| Method Summary | |
|---|---|
void |
initializeTest(Object testClassInstance)
Initialize the test component manager by registering components based on the presence of AllComponents and ComponentList annotations. |
void |
registerComponent(Class<?> testClass)
Register components associated to the provided class. |
void |
registerComponent(Type roleType,
Object instance)
Registers a component (with a default role hint). |
void |
registerComponent(Type roleType,
String roleHint,
Object instance)
Registers a component. |
org.xwiki.configuration.internal.MemoryConfigurationSource |
registerMemoryConfigurationSource()
Register in-memory data source for the default and "xwikiproperties" configuration sources. |
void |
shutdownTest()
Cleans up the test component manager by disposing components registered in it. |
| Methods inherited from class org.xwiki.component.embed.EmbeddableComponentManager |
|---|
createLogger, dispose, getComponentDescriptor, getComponentDescriptorList, getComponentDescriptorList, getComponentEventManager, getComponentInstance, getInstance, getInstance, getInstanceList, getInstanceMap, getParent, hasComponent, hasComponent, initialize, registerComponent, registerComponent, release, setComponentEventManager, setParent, unregisterComponent, unregisterComponent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.xwiki.test.internal.ComponentRegistrator componentRegistrator
| Constructor Detail |
|---|
public TestComponentManager()
| Method Detail |
|---|
public org.xwiki.configuration.internal.MemoryConfigurationSource registerMemoryConfigurationSource()
throws Exception
Exception - in case the registration fails
public void registerComponent(Type roleType,
String roleHint,
Object instance)
throws Exception
roleType - the type of the component role to registerroleHint - the role hint of the component to registerinstance - the instance to register
Exception - in case of an error during registration
public void registerComponent(Type roleType,
Object instance)
throws Exception
roleType - the type of the component role to registerinstance - the instance to register
Exception - in case of an error during registration
public void registerComponent(Class<?> testClass)
throws Exception
testClass - the class containing the annotations
Exception - in case of an error during registration
public void initializeTest(Object testClassInstance)
throws Exception
AllComponents and ComponentList annotations.
Also calls methods annotated with BeforeComponent.
testClassInstance - the test instance on which the annotations are present
Exception - if an error happens during initialization
public void shutdownTest()
throws Exception
Exception - if an error happens during clean up
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||