|
||||||||||
| 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 TestedClasspublic TestedClass getProxiedClass()
TestedClasspublic 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 fails
public 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 fails
public 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 accessed
public 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 accessed
public 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 accessed
public 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 accessed
public 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 accessed
public 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 accessed
public 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 accessed
public 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 accessed
public 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 | |||||||||