org.jtestcase.core.mapping
Class HashMapper

java.lang.Object
  extended by org.jtestcase.core.mapping.HashMapper

public class HashMapper
extends java.lang.Object


Constructor Summary
HashMapper(JTestCaseDigester digester, ComplexTypeConverter typeConverter)
           
 
Method Summary
 MultiKeyHashtable getTestCaseAssertParams(java.lang.String className, java.lang.String method, java.lang.String testcase)
          Get all assert params for a given method and its test case value into Hashtable.
 java.util.HashMap getTestCaseParams(java.lang.String className, java.lang.String method, java.lang.String testcase)
           Get all params for a given TestCaseInstance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashMapper

public HashMapper(JTestCaseDigester digester,
                  ComplexTypeConverter typeConverter)
Method Detail

getTestCaseParams

public java.util.HashMap getTestCaseParams(java.lang.String className,
                                           java.lang.String method,
                                           java.lang.String testcase)
                                    throws JTestCaseException,
                                           java.lang.InstantiationException,
                                           java.lang.IllegalAccessException

Get all params for a given TestCaseInstance. Hashed key is param's name, value is value of param. This method is normally used with getNameOfTestCases().

HashMap's key is param's name defined in /tests/class/method/params/param@name,

HashMap's value is param's Object value with type as indicated in /test/class/method/params/param@type.

Returns:
HashMap.
Throws:
JTestCaseException - if an internal error occurs
java.lang.IllegalAccessException
java.lang.InstantiationException

getTestCaseAssertParams

public MultiKeyHashtable getTestCaseAssertParams(java.lang.String className,
                                                 java.lang.String method,
                                                 java.lang.String testcase)
                                          throws JTestCaseException,
                                                 java.lang.InstantiationException,
                                                 java.lang.IllegalAccessException
Get all assert params for a given method and its test case value into Hashtable. Hashed key is assert param's name, value is String value of assert param. This method is normally used with getNameOfTestCases().

Parameters:
method - - name of tested method. Defined in data file in /tests/class/method@test-case.
testcase - - name of test case. Defined in data file in /tests/class/method@test-case. Should be unique for the given "methodName".
Returns:
Hashtable. Key is assert param's name defined in /tests/class/method/asserts/assertparm@name, value is assert param's Object value with type as indecated in /test/class/method/asserts/assert@type. If not "type" specified in data file, then "String" is default type.
Throws:
JTestCaseException - if an internal error occurs
java.lang.IllegalAccessException
java.lang.InstantiationException
java.io.FileNotFoundException