| java.lang.Object com.spikesource.spiketestgen.SpikeTestGen
SpikeTestGen | final public class SpikeTestGen (Code) | | SpikeTestGen is a doclet, which, with the help of class and
method signatures given by Classdoc , * generates unit test
cases requiring just the class files of the package under test.
It decouples the test code and test data using the open source
tool called JTestCase. Unit Test cases are then fed to JUnit
and results are taken.
version: 0.1.4-alpha author: Manish Marathe * |
Method Summary | |
public static void | endTestClass(String className) End the testclass file. | public static String | getMethodReturnType(MethodDoc method) Returns the return type of original method. | public static String[] | getParameters(StringBuffer allParams, MethodDoc method) Get the method Parameter list. | public static String | getToken(StringTokenizer tokens, int tokenReqNum) Retrieves a particular token from the array of tokens,
given the token number to be retrieved. | public static int | optionLength(String option) Retrieve the option length for a particular
option. | public static void | printNotice(String msg) This function prints the important information
passed in form of String to the Standard Output. | public static boolean | start(RootDoc root) Main method of the doclet. | public static void | testMethod(StringBuffer allParams, MethodDoc method, String[] methodArray, int[] methodNumArray, int currentMethod, String className, String dataFile) Get the method Parameter list. | public static boolean | validOptions(String[][] options, DocErrorReporter reporter) Verify if the options given are valid. |
OPTION_OUTPUT_DIR | final protected static String OPTION_OUTPUT_DIR(Code) | | Specifies the output directory.
|
endTestClass | public static void endTestClass(String className)(Code) | | End the testclass file.
Parameters: className - Name of the original class. |
getMethodReturnType | public static String getMethodReturnType(MethodDoc method)(Code) | | Returns the return type of original method.
Parameters: method - Name of the original class.return type of the method. |
getParameters | public static String[] getParameters(StringBuffer allParams, MethodDoc method)(Code) | | Get the method Parameter list.
Parameters: allParams - All parameters of the method. Parameters: method - Array of all methods.method Parameters |
getToken | public static String getToken(StringTokenizer tokens, int tokenReqNum)(Code) | | Retrieves a particular token from the array of tokens,
given the token number to be retrieved.
Parameters: tokens - An array of tokens, which is anObject of StringTokenizer. Parameters: tokenReqNum - Token Number, specifying the indexof the token in requestReturns the requested token. |
optionLength | public static int optionLength(String option)(Code) | | Retrieve the option length for a particular
option.
Parameters: option - Get the option length.Option length. |
printNotice | public static void printNotice(String msg)(Code) | | This function prints the important information
passed in form of String to the Standard Output.
Parameters: msg - String to be printed as a Notice. |
start | public static boolean start(RootDoc root)(Code) | | Main method of the doclet. Parses the information
given by Classdoc in the form of class and method signatures.
Parameters: root - Contains parsed information from Classdoc/Javadoc.Returns true if the operations in the method are valid. |
testMethod | public static void testMethod(StringBuffer allParams, MethodDoc method, String[] methodArray, int[] methodNumArray, int currentMethod, String className, String dataFile) throws IOException(Code) | | Get the method Parameter list.
Parameters: allParams - All parameters of the method. Parameters: method - Array of all methods. Parameters: methodArray - Method name for overridden methods. Parameters: methodNumArray - Number of overridden methods. Parameters: currentMethod - Integer value of current method. Parameters: className - Name of the original class. Parameters: dataFile - Name of the XML data file. throws: IOException - Throws IOException. |
validOptions | public static boolean validOptions(String[][] options, DocErrorReporter reporter)(Code) | | Verify if the options given are valid.
Parameters: options - Doclet options Parameters: reporter - Error reporterReturns true if the -d option is valid. |
|
|