|
||||||||||
| 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.ComponentManagerRule
public class ComponentManagerRule
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.
Note: We need to implement the deprecated MethodRule for the time being for the following reason:
https://github.com/KentBeck/junit/issues/351
| Constructor Summary | |
|---|---|
ComponentManagerRule()
|
|
| Method Summary | |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runners.model.FrameworkMethod method,
Object target)
|
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. |
| Methods inherited from class org.xwiki.component.embed.EmbeddableComponentManager |
|---|
createLogger, 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 |
| Constructor Detail |
|---|
public ComponentManagerRule()
| 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 org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runners.model.FrameworkMethod method,
Object target)
apply in interface org.junit.rules.MethodRule
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||