org.test4j.tools.reflector.imposteriser
类 ClassImposteriser

java.lang.Object
  继承者 org.test4j.tools.reflector.imposteriser.ClassImposteriser
所有已实现的接口:
Imposteriser

public class ClassImposteriser
extends Object
implements Imposteriser

This class lets you imposterise abstract and concrete classes without calling the constructors of the mocked class.


嵌套类摘要
static class ClassImposteriser.ClassWithSuperclassToWorkAroundCglibBug
           
 
字段摘要
static Imposteriser INSTANCE
           
 
方法摘要
 boolean canImposterise(Class type)
          Reports if the Imposteriser is able to imposterise a given type.
<T> T
imposterise(Invokable mockObject, Class<T> mockedType, Class... ancilliaryTypes)
          Creates an imposter for a given type that forwards Invocations to an Invokable object.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

INSTANCE

public static final Imposteriser INSTANCE
方法详细信息

canImposterise

public boolean canImposterise(Class type)
从接口 Imposteriser 复制的描述
Reports if the Imposteriser is able to imposterise a given type.

指定者:
接口 Imposteriser 中的 canImposterise
参数:
type - The type in question.
返回:
True if this imposteriser can imposterise type, false otherwise.

imposterise

public <T> T imposterise(Invokable mockObject,
                         Class<T> mockedType,
                         Class... ancilliaryTypes)
从接口 Imposteriser 复制的描述
Creates an imposter for a given type that forwards Invocations to an Invokable object.

指定者:
接口 Imposteriser 中的 imposterise
类型参数:
T - The static type of the imposter that is created.
参数:
mockObject - The object that is to receive invocations forwarded from the imposter.
mockedType - The class representing the static type of the imposter.
ancilliaryTypes - Other types for the imposter. It must be possible to dynamically cast the imposter to these types. These types must all be interfaces because Java only allows single inheritance of classes.
返回:
A new imposter. The imposter must implement the mockedType and all the ancialliaryTypes.


Copyright © 2013. All rights reserved.