org.xwiki.test.jmock
Class MockingComponentManager

java.lang.Object
  extended by org.xwiki.component.embed.EmbeddableComponentManager
      extended by org.xwiki.test.jmock.MockingComponentManager
All Implemented Interfaces:
org.xwiki.component.manager.ComponentManager

Deprecated. starting with 4.3.1 use MockitoComponentManagerRule instead

@Deprecated
public class MockingComponentManager
extends EmbeddableComponentManager

Adds method to EmbeddableComponentManager to easily register mock components when writing tests.

Since:
4.2M1
Version:
$Id: 7bfc332eccc361bf44d55fb2fc2d3e8bae6e9e62 $

Constructor Summary
MockingComponentManager()
          Deprecated.  
 
Method Summary
<T> T
registerMockComponent(org.jmock.Mockery mockery, Type role)
          Deprecated. Register a mock component.
<T> T
registerMockComponent(org.jmock.Mockery mockery, Type role, String hint)
          Deprecated. Register a mock component.
<T> T
registerMockComponent(org.jmock.Mockery mockery, Type role, String hint, String mockId)
          Deprecated. Register a mock component.
<T> T
registerMockComponentWithId(org.jmock.Mockery mockery, Type role, String mockId)
          Deprecated. Register a mock component.
 
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

MockingComponentManager

public MockingComponentManager()
Deprecated. 
Method Detail

registerMockComponent

public <T> T registerMockComponent(org.jmock.Mockery mockery,
                                   Type role,
                                   String hint,
                                   String mockId)
                        throws Exception
Deprecated. 
Register a mock component.

Type Parameters:
T - the component role class
Parameters:
mockery - the JMock mockery instance to create the mock component
role - the role of the component to register
hint - the hint of the component to register
mockId - the JMock id (this is needed when registering several mocks for the same interface)
Returns:
the registered mock component instance
Throws:
Exception - if the registration failed

registerMockComponent

public <T> T registerMockComponent(org.jmock.Mockery mockery,
                                   Type role,
                                   String hint)
                        throws Exception
Deprecated. 
Register a mock component.

Type Parameters:
T - the component role class
Parameters:
mockery - the JMock mockery instance to create the mock component
role - the role of the component to register
hint - the hint of the component to register
Returns:
the registered mock component instance
Throws:
Exception - if the registration failed

registerMockComponent

public <T> T registerMockComponent(org.jmock.Mockery mockery,
                                   Type role)
                        throws Exception
Deprecated. 
Register a mock component.

Type Parameters:
T - the component role class
Parameters:
mockery - the JMock mockery instance to create the mock component
role - the role of the component to register
Returns:
the registered mock component instance
Throws:
Exception - if the registration failed

registerMockComponentWithId

public <T> T registerMockComponentWithId(org.jmock.Mockery mockery,
                                         Type role,
                                         String mockId)
                              throws Exception
Deprecated. 
Register a mock component.

Type Parameters:
T - the component role class
Parameters:
mockery - the JMock mockery instance to create the mock component
role - the role of the component to register
mockId - the JMock id (this is needed when registering several mocks for the same interface)
Returns:
the registered mock component instance
Throws:
Exception - if the registration failed


Copyright © 2004-2013 XWiki. All Rights Reserved.