| java.lang.Object com.spikesource.spiketestgen.TestDataGeneration
TestDataGeneration | public class TestDataGeneration (Code) | | Generates the XML data file for the test cases. The XML file
generated has the actual test cases to be executed. A rules file,
an another XML file, has boundary conditions for primitive data
types. This file is parsed and according to the rules for each
attribute as a data type, all possible combinations of the test
cases are generated.
version: 0.1.4-alpha author: Manish Marathe |
Method Summary | |
final public String | createXMLDataFile(String outputDIR) Creates the top, common block of the XML data file. | final public void | endClassInXMLDataFile(String outputDIR, String filename) End the class tag in the XML data file as test data for all methods
of this class are written to the data file. | final public void | endXMLDataFile(String outputDIR, String filename) End the tag in the XML data file, which closes the data file. | public static void | main(String[] args) Main method of the class. | final public void | thisPermutation1(BufferedWriter out, Object[][] paramConditions, String thisCombination, String name, String methodReturnType, int numOfParams) The method writes the test cases in the data file for the
orginal methods having more than one argument.
Parameters: out - BufferedWriter Object. Parameters: paramConditions - Boundary condition of arguments. Parameters: thisCombination - Current combination of the valuesof the arguments set in the rules.xmlfile. Parameters: name - Test method name. Parameters: methodReturnType - Return type of the method. Parameters: numOfParams - No. | final public void | thisPermutation2(BufferedWriter out, Object[][] paramConditions, String name, String methodReturnType, int numOfConditions, int numOfParams) The method writes the test cases in the data file for the
orginal methods having more than one argument.
Parameters: out - BufferedWriter Object. Parameters: paramConditions - Boundary condition of arguments. Parameters: name - Test method name. Parameters: methodReturnType - Return type of the method. Parameters: numOfConditions - Total number of boundary conditionsfor the data type of the argument. Parameters: numOfParams - No. | final public void | writeClassDetailsToXMLDataFile(String classname, String outputDIR, String filename) Writes Class details,viz., name of the class, any global
parameters, to the data file. | final public void | writeMethodDetailsToXMLDataFile(String methodName, String methodReturnType, String[] methodParams, int numOfParams, String outputDIR, String filename) This is the main method of this class. |
createXMLDataFile | final public String createXMLDataFile(String outputDIR)(Code) | | Creates the top, common block of the XML data file.
Parameters: outputDIR - The output directory where data file is created.Returns the name of the created file. |
endClassInXMLDataFile | final public void endClassInXMLDataFile(String outputDIR, String filename)(Code) | | End the class tag in the XML data file as test data for all methods
of this class are written to the data file.
Parameters: outputDIR - The output directory. Parameters: filename - Filename of the XML data file. |
endXMLDataFile | final public void endXMLDataFile(String outputDIR, String filename)(Code) | | End the tag in the XML data file, which closes the data file.
Parameters: outputDIR - The output directory. Parameters: filename - name of the XML data file. |
main | public static void main(String[] args)(Code) | | Main method of the class.
Parameters: args - Command line parameters. |
thisPermutation1 | final public void thisPermutation1(BufferedWriter out, Object[][] paramConditions, String thisCombination, String name, String methodReturnType, int numOfParams) throws IOException(Code) | | The method writes the test cases in the data file for the
orginal methods having more than one argument.
Parameters: out - BufferedWriter Object. Parameters: paramConditions - Boundary condition of arguments. Parameters: thisCombination - Current combination of the valuesof the arguments set in the rules.xmlfile. Parameters: name - Test method name. Parameters: methodReturnType - Return type of the method. Parameters: numOfParams - No. of arguments. throws: IOException - Throws IOException. |
thisPermutation2 | final public void thisPermutation2(BufferedWriter out, Object[][] paramConditions, String name, String methodReturnType, int numOfConditions, int numOfParams) throws IOException(Code) | | The method writes the test cases in the data file for the
orginal methods having more than one argument.
Parameters: out - BufferedWriter Object. Parameters: paramConditions - Boundary condition of arguments. Parameters: name - Test method name. Parameters: methodReturnType - Return type of the method. Parameters: numOfConditions - Total number of boundary conditionsfor the data type of the argument. Parameters: numOfParams - No. of arguments. throws: IOException - Throws IOException. |
writeClassDetailsToXMLDataFile | final public void writeClassDetailsToXMLDataFile(String classname, String outputDIR, String filename)(Code) | | Writes Class details,viz., name of the class, any global
parameters, to the data file.
Parameters: classname - name of the original class under test Parameters: outputDIR - name of the output directory Parameters: filename - name of the XML data file |
writeMethodDetailsToXMLDataFile | final public void writeMethodDetailsToXMLDataFile(String methodName, String methodReturnType, String[] methodParams, int numOfParams, String outputDIR, String filename) throws IOException(Code) | | This is the main method of this class. This method looks for the
type of parameters of the method under test and according to the
type retrieves the rules for those types from the rules file. All
possible combinations of the rules of all parameters forms the unit test
case data.
Parameters: methodName - Original name of the method under test. Parameters: methodReturnType - Return type of the method under test. Parameters: methodParams - All Parameters of the method under test. Parameters: numOfParams - Total number of parameters of the method in test. Parameters: outputDIR - The output directory. Parameters: filename - XML data file name. throws: IOException - Throws IOException. |
|
|