junitx.framework
Class TestedClass

java.lang.Object
  |
  +--junitx.framework.TestedClass

public class TestedClass
extends java.lang.Object

TestedClass contains new methods for managing a tested class through a TestProxy as well as some wrappers to access methods of the original Class implementation.


Constructor Summary
TestedClass(java.lang.Class aClass)
          constructor.
 
Method Summary
 void dumpKeys()
          dumps constructor and methods keys.
 java.lang.reflect.Constructor getConstructor(java.lang.Object[] anArgArray)
          finds a constructor based on an array of object arguments
 java.lang.reflect.Constructor getConstructor(java.lang.String aConstructorName)
          finds a constructor based on a key
 java.lang.reflect.Field getField(java.lang.String aFieldName)
          gets a field based on it's name
 java.lang.reflect.Method getMethod(java.lang.String aMethodKey)
          finds a method based on a key
 java.lang.reflect.Method getMethod(java.lang.String aMethodName, java.lang.Object[] anArgArray)
          gets a method based on it's name and a argument object array
 java.lang.String getPkgName()
          returns the package name of the wrapped class.
 java.lang.Class getTestedClass()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestedClass

public TestedClass(java.lang.Class aClass)
constructor.
Parameters:
aClass - a class to be tested
Method Detail

getTestedClass

public java.lang.Class getTestedClass()
Returns:
the tested class.

getPkgName

public java.lang.String getPkgName()
returns the package name of the wrapped class.
Returns:
package name or null if the class is contained in the toplevel package.

getMethod

public java.lang.reflect.Method getMethod(java.lang.String aMethodKey)
finds a method based on a key
Parameters:
aMethodKey - a string key, compare invokeWithKey documentation
Returns:
a Method instance or null

getMethod

public java.lang.reflect.Method getMethod(java.lang.String aMethodName,
                                          java.lang.Object[] anArgArray)
                                   throws TestAccessException
gets a method based on it's name and a argument object array
Parameters:
aMethodName - method name
anArgArray - an array of argument objects
Returns:
a Method or null
Throws:
TestAccessException - if method cannot be returned

getConstructor

public java.lang.reflect.Constructor getConstructor(java.lang.Object[] anArgArray)
                                             throws TestAccessException
finds a constructor based on an array of object arguments
Parameters:
anArgArray - an array of object arguments
Returns:
a Constructor instance or null

getConstructor

public java.lang.reflect.Constructor getConstructor(java.lang.String aConstructorName)
finds a constructor based on a key
Parameters:
aConstructorKey - a string key, compare invokeWithKey documentation
Returns:
a Constructor instance or null

getField

public java.lang.reflect.Field getField(java.lang.String aFieldName)
                                 throws TestAccessException
gets a field based on it's name
Parameters:
aFieldName - a field name
Returns:
a Field or null
Throws:
TestAccessException - if field cannot be returned

dumpKeys

public void dumpKeys()
dumps constructor and methods keys.