info.joseluismartin.mock
Class EasyMockReplacer

java.lang.Object
  extended by info.joseluismartin.mock.EasyMockReplacer
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor

public class EasyMockReplacer
extends Object
implements org.springframework.beans.factory.config.BeanFactoryPostProcessor

A BeanFactoryPostProcessor that replaces configured interfaces with EasyMock Proxys for Testing.

Author:
Jose Luis Martin - (jlm@joseluismartin.info)

Constructor Summary
EasyMockReplacer()
           
 
Method Summary
 boolean add(Class<?> clazz)
          Add Class to replace with EasyMock proxy
 void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory)
          PostProcess BeanFactory and replace configured classes wiht EasyMocks proxys
 boolean remove(Class<?> clazz)
          Remove Class from replaced classes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EasyMockReplacer

public EasyMockReplacer()
Method Detail

postProcessBeanFactory

public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory)
                            throws org.springframework.beans.BeansException
PostProcess BeanFactory and replace configured classes wiht EasyMocks proxys

Specified by:
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
Parameters:
factory - the Spring factory
Throws:
org.springframework.beans.BeansException - if postprocessor fail

add

public boolean add(Class<?> clazz)
Add Class to replace with EasyMock proxy

Parameters:
clazz - Class to replace.
Returns:
true if replaced

remove

public boolean remove(Class<?> clazz)
Remove Class from replaced classes

Parameters:
clazz - Class to remove
Returns:
true if removed


Copyright © 2012 JDAL. All Rights Reserved.