|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--junitx.framework.TestProxy
The TestProxyImpl is beeing used to create a TestProxy in each package which contains testcases of package private classes which should be tested. A TestProxy stores information gathered by reflection on a class which should be tested and to access classes which are defined package private.
Constructor Summary | |
TestProxy()
|
Method Summary | |
void |
dumpKeys()
dumps constructor and method keys of proxied class. |
java.lang.Object |
get(java.lang.Object anObject,
java.lang.String aFieldName)
gets the value of a field. |
boolean |
getBoolean(java.lang.Object anObject,
java.lang.String aFieldName)
gets the boolean value of a field. |
byte |
getByte(java.lang.Object anObject,
java.lang.String aFieldName)
gets the byte value of a field. |
char |
getChar(java.lang.Object anObject,
java.lang.String aFieldName)
gets the char value of a field. |
double |
getDouble(java.lang.Object anObject,
java.lang.String aFieldName)
gets the double value of a field. |
float |
getFloat(java.lang.Object anObject,
java.lang.String aFieldName)
gets the float value of a field. |
int |
getInt(java.lang.Object anObject,
java.lang.String aFieldName)
gets the int value of a field. |
long |
getLong(java.lang.Object anObject,
java.lang.String aFieldName)
gets the long value of a field. |
TestedClass |
getProxiedClass()
gets the proxied class |
short |
getShort(java.lang.Object anObject,
java.lang.String aFieldName)
gets the short value of a field. |
java.lang.String |
getTestedClassName()
gets the real tested class name |
void |
init(TestedClass aTestedClass)
initializes a proxy. |
java.lang.Object |
invoke(java.lang.Object anObject,
java.lang.String aMethodName,
java.lang.Object[] anArgArray)
invokes a method of a tested class. |
java.lang.Object |
invokeWithKey(java.lang.Object anObject,
java.lang.String aMethodKey,
java.lang.Object[] anArgArray)
invokes a method of a class receiving simple data type arguments. |
abstract java.lang.Object |
newInstance(java.lang.Object[] anArgArray)
invokes a constructor of a tested class. |
abstract java.lang.Object |
newInstanceWithKey(java.lang.String aConstructorKey,
java.lang.Object[] anArgArray)
invokes a constructor of a class receiving simple data type arguments. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TestProxy()
Method Detail |
public void init(TestedClass aTestedClass)
TestProxyFactory
class uses the
newInstance
method of the reflection API to create an
instance of this class.aTestedClass
- an instance of TestedClass
public TestedClass getProxiedClass()
TestedClass
public java.lang.String getTestedClassName()
String
public java.lang.Object invoke(java.lang.Object anObject, java.lang.String aMethodName, java.lang.Object[] anArgArray) throws TestAccessException
anObject
- an object to processaMethodName
- a String method nameanArgArray
- a list of arguments to the method to be invokedTestAccessException
- if the invocation failspublic abstract java.lang.Object newInstance(java.lang.Object[] anArgArray) throws TestAccessException
anArgArray
- a list of arguments to the constructor to be invokedTestAccessException
- if the invocation failspublic java.lang.Object invokeWithKey(java.lang.Object anObject, java.lang.String aMethodKey, java.lang.Object[] anArgArray) throws TestAccessException
anObject
- an object to processaMethodKey
- a String method name with argument typesanArgArray
- a list of arguments to the method to be invokedTestAccessException
- public abstract java.lang.Object newInstanceWithKey(java.lang.String aConstructorKey, java.lang.Object[] anArgArray) throws TestAccessException
aConstructorKey
- constructor argument types as keyanArgArray
- a list of arguments to the constructor to be
invokedTestAccessException
- public java.lang.Object get(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic boolean getBoolean(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic byte getByte(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic char getChar(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic double getDouble(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic float getFloat(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic int getInt(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic long getLong(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic short getShort(java.lang.Object anObject, java.lang.String aFieldName) throws TestAccessException
anObject
- object to be processedaFieldName
- a String field nameTestAccessException
- if the field cannot be accessedpublic void dumpKeys()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |