org.xwiki.test
Class AbstractComponentTestCase
java.lang.Object
org.xwiki.test.AbstractMockingTestCase
org.xwiki.test.AbstractComponentTestCase
public abstract class AbstractComponentTestCase
- extends AbstractMockingTestCase
Tests which needs to have XWiki Components set up should extend this class which makes the Component Manager
available. Use this class for JUnit 4.x tests. XWiki 2.2M1 also introduced
AbstractMockingComponentTestCase which provides automatic mocking for injected component
dependencies and which is thus better when writing pure unit tests, isolated from the rest.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractComponentTestCase
public AbstractComponentTestCase()
setUp
public void setUp()
throws Exception
- Tests that require fine-grained initializations can override this method and not call super.
- Throws:
Exception
tearDown
public void tearDown()
throws Exception
- Clean up test states.
- Throws:
Exception
registerComponents
protected void registerComponents()
throws Exception
- Register custom/mock components
- Throws:
Exception
getComponentManager
public EmbeddableComponentManager getComponentManager()
throws Exception
- Specified by:
getComponentManager in class AbstractMockingTestCase
- Returns:
- a configured Component Manager (which uses the plexus.xml file in the test resources directory) which can
then be put in the XWiki Context for testing.
- Throws:
Exception
getConfigurationSource
public MockConfigurationSource getConfigurationSource()
- Returns:
- a modifiable mock configuration source
registerComponent
public void registerComponent(Class<?> componentClass)
throws Exception
- Throws:
Exception- Since:
- 3.2M3
Copyright © 2004-2012 XWiki. All Rights Reserved.