org.jtestcase.core.digester
Class JTestCaseDigester

java.lang.Object
  extended by org.jtestcase.core.digester.JTestCaseDigester

public class JTestCaseDigester
extends java.lang.Object

Helper for handling the JTestCaseWizard XML. Reads data from the JTestCaseWizard XML into internal data structures.

Author:
Fausto Lelli $Id: JTestCaseDigester.java,v 1.6 2005/11/16 14:36:59 faustothegrey Exp $

Constructor Summary
JTestCaseDigester(java.lang.String fileName, JTestCase jtestcase)
          Standard constructor.
 
Method Summary
 java.util.List getAssertGroupInstances(java.lang.String className, java.lang.String methodName, java.lang.String testCase)
          Returns a list of assert group instances for a given method name and test case.
 java.util.List getAssertParamGroupInstances(java.lang.String className, java.lang.String methodName, java.lang.String testCase)
          Returns a list of assert group instances for a given method name and test case.
 java.util.List getAssertsInstances(java.lang.String className, java.lang.String methodName, java.lang.String testCase)
          Returns a list of all assert instances for the given method and test case
 java.util.List getAssertsParamInstances(java.lang.String className, java.lang.String methodName, java.lang.String testCase)
          Returns a list of all assertparam instances for the given method and test case
 org.jdom.Document getDocument(java.lang.String fileName)
           
 java.util.List getParamGroupInstances(java.lang.String className, java.lang.String methodName, java.lang.String testCase)
          Returns a list of param group instances for a given method name and test case.
 java.util.List getParamsInstances(java.lang.String className, java.lang.String methodName, java.lang.String testCase)
          Returns a list of all param instances for the given method and test case
 java.util.List getTestCaseControlParamGroups()
          Returns all control paramgroup .
 java.util.List getTestCaseControlParams()
          Returns all control params .
 java.util.List getTestCaseGlobalParamGroups(java.lang.String className)
          Returns all global paramgroup's for given class.
 java.util.List getTestCaseGlobalParams(java.lang.String className)
          Returns all global params for given class.
 java.util.Vector getTestCases(java.lang.String className, JTestCase jtestcase)
          Returns all test cases in one XML file.
 java.util.Vector getTestCasesPerMethod(java.lang.String methodName)
          Returns all test cases for one method element from the XML.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JTestCaseDigester

public JTestCaseDigester(java.lang.String fileName,
                         JTestCase jtestcase)
                  throws java.io.FileNotFoundException,
                         XQueryException
Standard constructor.

Parameters:
fileName - name of the JTestCaseWizard XML file
Throws:
XQueryException
java.io.FileNotFoundException
Method Detail

getTestCasesPerMethod

public java.util.Vector getTestCasesPerMethod(java.lang.String methodName)
                                       throws DigesterException
Returns all test cases for one method element from the XML.

Parameters:
className - the name of the class element
methodName - the name of the method element the test cases haven to be read
Returns:
list of all JTestCaseIdentifiers for this method element
Throws:
DigesterException - in case of parsing errors

getTestCases

public java.util.Vector getTestCases(java.lang.String className,
                                     JTestCase jtestcase)
                              throws DigesterException
Returns all test cases in one XML file. A test case is identifies by the name of the test method and the name of the test case.

Parameters:
className - the name of the class element
Returns:
list of all JTestCaseWizard identifiers in this file
Throws:
DigesterException - in case of parsing errors

getAssertsInstances

public java.util.List getAssertsInstances(java.lang.String className,
                                          java.lang.String methodName,
                                          java.lang.String testCase)
                                   throws DigesterException
Returns a list of all assert instances for the given method and test case

Parameters:
className - the name of the class element
methodName - name of the method element
testCase - name of the test case
Returns:
a list of assert instances
Throws:
DigesterException - in case of arsing errors

getAssertsParamInstances

public java.util.List getAssertsParamInstances(java.lang.String className,
                                               java.lang.String methodName,
                                               java.lang.String testCase)
                                        throws DigesterException
Returns a list of all assertparam instances for the given method and test case

Parameters:
className - the name of the class element
methodName - name of the method element
testCase - name of the test case
Returns:
a list of assert instances
Throws:
DigesterException - in case of arsing errors

getAssertGroupInstances

public java.util.List getAssertGroupInstances(java.lang.String className,
                                              java.lang.String methodName,
                                              java.lang.String testCase)
                                       throws DigesterException,
                                              java.io.FileNotFoundException
Returns a list of assert group instances for a given method name and test case.

Parameters:
className - the name of the class element
methodName - a method name
testCase - a test case
Returns:
a list of assert group instances
Throws:
DigesterException - in case of any errors
java.io.FileNotFoundException

getAssertParamGroupInstances

public java.util.List getAssertParamGroupInstances(java.lang.String className,
                                                   java.lang.String methodName,
                                                   java.lang.String testCase)
                                            throws DigesterException,
                                                   java.io.FileNotFoundException
Returns a list of assert group instances for a given method name and test case.

Parameters:
className - the name of the class element
methodName - a method name
testCase - a test case
Returns:
a list of assert group instances
Throws:
DigesterException - in case of any errors
java.io.FileNotFoundException

getParamsInstances

public java.util.List getParamsInstances(java.lang.String className,
                                         java.lang.String methodName,
                                         java.lang.String testCase)
                                  throws DigesterException
Returns a list of all param instances for the given method and test case

Parameters:
className - the name of the class element
methodName - name of the method element
testCase - name of the test case
Returns:
a list of param instances
Throws:
DigesterException - in case of parsing errors

getParamGroupInstances

public java.util.List getParamGroupInstances(java.lang.String className,
                                             java.lang.String methodName,
                                             java.lang.String testCase)
                                      throws DigesterException,
                                             java.io.FileNotFoundException
Returns a list of param group instances for a given method name and test case.

Parameters:
className - the name of the class element
methodName - a method name
testCase - a test case
Returns:
a list of param group instances
Throws:
DigesterException - in case of any errors
java.io.FileNotFoundException

getTestCaseControlParams

public java.util.List getTestCaseControlParams()
                                        throws DigesterException
Returns all control params .

Returns:
list of ParamInstance
Throws:
DigesterException - in case of parsing errors

getTestCaseControlParamGroups

public java.util.List getTestCaseControlParamGroups()
                                             throws DigesterException,
                                                    java.io.FileNotFoundException
Returns all control paramgroup .

Returns:
list of ParamInstance
Throws:
DigesterException - in case of parsing errors
java.io.FileNotFoundException

getTestCaseGlobalParams

public java.util.List getTestCaseGlobalParams(java.lang.String className)
                                       throws DigesterException,
                                              java.io.FileNotFoundException
Returns all global params for given class.

Parameters:
className - the name of the enclosing tag class
Returns:
list of ParamInstance
Throws:
DigesterException - in case of parsing errors
java.io.FileNotFoundException

getTestCaseGlobalParamGroups

public java.util.List getTestCaseGlobalParamGroups(java.lang.String className)
                                            throws DigesterException,
                                                   java.io.FileNotFoundException
Returns all global paramgroup's for given class.

Parameters:
className - the name of the enclosing tag class
Returns:
list of ParamInstance
Throws:
DigesterException - in case of parsing errors
java.io.FileNotFoundException

getDocument

public org.jdom.Document getDocument(java.lang.String fileName)
                              throws java.io.FileNotFoundException,
                                     XQueryException
Throws:
java.io.FileNotFoundException
XQueryException