| java.lang.Object net.sourceforge.groboutils.junit.v1.parser.JUnitOrigCreator
JUnitOrigCreator | public class JUnitOrigCreator implements ITestCreator(Code) | | Emulates the construction mechanism for all JUnit versions.
author: Matt Albrecht groboclown@users.sourceforge.net version: $Date: 2003/02/10 22:52:21 $ since: November 3, 2002 |
Method Summary | |
public boolean | canCreate(Class theClass) Checks if the creator can be used on the given class. | public Test | createTest(Class theClass, Method method) Creates a new test, based on the given class and method of the class.
This calls createTest( Class, Object[] ) to create the new
class, which itself calls getConstructorArgTypes( Class ) to
determine which constructor to get. | protected Test | createTest(Class theClass, Object[] constructorArgs) Creates a new test class instance.
Parameters: theClass - the class to parse for testing. Parameters: constructorArgs - arguments for the constructor retrieved throughgetConstructor(). | protected Object[] | createTestArguments(Class theClass, Method method) | protected Constructor | getConstructor(Class theClass) Discovers the constructor for the test class which will be used in
the instantiation of a new instance of the class. | protected Class[] | getConstructorArgTypes(Class theClass) Allows for pluggable constructor types. |
canCreate | public boolean canCreate(Class theClass)(Code) | | Checks if the creator can be used on the given class.
Parameters: theClass - the class to check if parsing is acceptable. |
createTest | public Test createTest(Class theClass, Method method) throws InstantiationException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassCastException(Code) | | Creates a new test, based on the given class and method of the class.
This calls createTest( Class, Object[] ) to create the new
class, which itself calls getConstructorArgTypes( Class ) to
determine which constructor to get. Also,
createTestArguments( Class, Method ) is called to generate the
constructor's arguments.
Parameters: theClass - the class to parse for testing. Parameters: m - the method that will be tested with the new class instance. exception: InstantiationException - if there was a problem creating theclass. exception: NoSuchMethodException - if the method does not exist in theclass. See Also: JUnitOrigCreator.createTest(Class,Object[]) |
createTestArguments | protected Object[] createTestArguments(Class theClass, Method method)(Code) | | Parameters: theClass - the class to parse for testing. Parameters: m - the method that will be tested with the new class instance. |
getConstructorArgTypes | protected Class[] getConstructorArgTypes(Class theClass)(Code) | | Allows for pluggable constructor types. The default action is to
return java.lang.String.
Parameters: theClass - the class to parse for testing. the set of classes which define the constructor to extract. |
|
|