Printer FriendlyEmail Article Link

TTworkbench: How to create a TTCN-3 type in Test Adapter(TA)?

Environment/Versions
TTworkbench 32/64 Bit Windows/Linux
Answer
Use the method getTypeForName from the abstract class AbstractValuePlugin.

Javadoc:

  /**
   * Returns a type representing a TTCN-3 type. Predefined TTCN-3 types can be retrieved from the TE
   * by using the TTCN-3 keywords for the predefined types. In this case typeName denotes to the
   * basic TTCN-3 type like "charstring", "bitstring" etc.
   * Returns the distinct value null if the requested type cannot be returned. Note that the anytype
   * and address cannot be obtained with module set to null. Although they are predefined types
   * they might be distinct between modules. For example, address can either be the unmodified
   * predefined type, or a user-defined type in a module. Other predefined types cannot be redefined.
   *
   * @param typeName The TTCN-3 name of the type as defined in the TTCN-3 module. The following
   *                 are reserved type names and will return a predefined type:
   *                 "integer"
   *                 "float"
   *                 "bitstring"
   *                 "hexstring"
   *                 "octetstring"
   *                 "charstring"
   *                 "universal charstring"
   *                 "boolean"
   *                 "verdicttype"
   *                 otherwise typeName has to be the fully qualified type name, i.e. module.typeName
   *                 
   * @return A type representing the requested TTCN-3 type.
   */

Example:
getTypeForName(typeName);

Product : TTplugins,Misc,TTCN-3 Language