Feature - Command Generators

Description

GINT or user provided command generators

ease testcase definition and maintenance by defining testcase parameters used to generate commands

. This makes the testcase more readable, easier to document with comments, and more understandable than a long command string. GINT provides a number of built in generators and a facility to aid adding and managing user defined command generators.



Using

Command generator can be set on an individual testcase (cmdGenerator parameter) or globally by setting the default command generator using gint.setCmdGenerator. A command generator is uniquely identified by name and (optional) parameter settings in the form of a parameter map. Each command generator can define custom testcase parameters specific to the domain of the command being used.

Functions

  • Use setCmdGenerator to set the default command generator used for all testcases without cmd, inline, or cmdGenerator defined

  • Use addCmdGenerator to add or replace a command generator in the list of known generators

  • Use getCmdGenerator to get a command generator by name and parameter setting

Examples - used in a test script

  1. gint.setCmdGenerator('groovy') // set default cmd generator to groovy, no parameters

  2. gint.setCmdGenerator('java', [class: 'myClass', classpath: 'myClasspath']) // set default cmd generator to my java class

  3. As part of a testcase definition: gint.add(name: 'example1', jar: 'my.jar', gint.getCmdGenerator('java', [classpath: 'myClassPath']))

GINT provided command generators

© 2005 -2024 gint.org