org.xwiki.test.jmock
Class AbstractComponentTestCase

java.lang.Object
  extended by org.xwiki.test.jmock.AbstractMockingTestCase
      extended by org.xwiki.test.jmock.AbstractComponentTestCase

Deprecated. starting with 4.3.1 use ComponentManagerRule instead

@Deprecated
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.

Consider using this class only for integration tests.


Field Summary
 
Fields inherited from class org.xwiki.test.jmock.AbstractMockingTestCase
mockery
 
Constructor Summary
AbstractComponentTestCase()
          Deprecated.  
 
Method Summary
 MockingComponentManager getComponentManager()
          Deprecated.  
 org.xwiki.test.internal.MockConfigurationSource getConfigurationSource()
          Deprecated.  
 void registerComponent(Class<?> componentClass)
          Deprecated.  
protected  void registerComponents()
          Deprecated. Register custom/mock components
 void setUp()
          Deprecated. Tests that require fine-grained initializations can override this method and not call super.
 void tearDown()
          Deprecated. Clean up test states.
 
Methods inherited from class org.xwiki.test.jmock.AbstractMockingTestCase
getMockery, registerMockComponent, registerMockComponent, registerMockComponent, registerMockComponent, registerMockComponent, registerMockComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractComponentTestCase

public AbstractComponentTestCase()
Deprecated. 
Method Detail

setUp

public void setUp()
           throws Exception
Deprecated. 
Tests that require fine-grained initializations can override this method and not call super.

Throws:
Exception

tearDown

public void tearDown()
              throws Exception
Deprecated. 
Clean up test states.

Throws:
Exception

registerComponents

protected void registerComponents()
                           throws Exception
Deprecated. 
Register custom/mock components

Throws:
Exception

getComponentManager

public MockingComponentManager getComponentManager()
                                            throws Exception
Deprecated. 
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 org.xwiki.test.internal.MockConfigurationSource getConfigurationSource()
Deprecated. 
Returns:
a modifiable mock configuration source

registerComponent

public void registerComponent(Class<?> componentClass)
                       throws Exception
Deprecated. 
Throws:
Exception
Since:
3.2M3


Copyright © 2004–2014 XWiki. All rights reserved.