Code generation templates

 

+

Search Tips   |   Advanced Search

 

The code generation subsystem uses declaration templates and creation templates.

The declaration templates contain code for declarations of the methods and classes creating the test element. The creation template contains code that calls these methods to instantiate the test element objects. The type of the template is reflected in the template name and is defined by the extensions...

It is possible to have name conflicts between code generation templates with the same names that come from different protocol extensions. Use template names containing a protocol name (for example: HTTPScript.template) to avoid this problem.

The following example shows a creation template for a DCSubstituter object:

ISubRule sub_<PARAM name="subRuleIdx> = newSubRule(<PARAM name="targetAttr">", 
                                                   <PARAM name="offset">,
                                                   <PARAM name="length",
                                                   <PARAM name="isEncoded",
                                                   <PARAM name="dataSourceVarName">,
<PARAM name="parentInstancename">, addSubInstruction (sub_<PARAM name="subRuleIdx">);      


Related

  • Code generation
  • Generate test code
  • Create the script class
  • Extension points for code generation
  • New protocol extensions
  • Public APIs of codegen.core