In any JTAF XCore project, all test commands specific to the project need to be included (registered) inside of 'testlibrary'. Only after registering can you use the commands within your test scripts.

Command library specifications

1. Command spec files should end with .commands.xml
2. There can be many command spec files within the 'testlibrary' folder
3. You can have child folders within 'testlibrary'; command.xml files can be contained in the child folders



<library>
<command name="sampleCommand" class="org.myco.sampleproject.command.SampleCmd">
      <usage>
      This is a sample command
      </usage>
      <requiredParameters>
       	<string name="param1">Required param1</string>
        <string name="param2">Required param2</string>
      </requiredParameters>

      <optionalParameters>
        <integer name="optionalParam1">Optional param1</integer>
        <boolean name="optionalParam2">Optional param2</boolean>
      </optionalParameters>

      <produces>
        <object name="produceParam1">Produce param1 to be pushed into context</object>
      </produces>
</command>
<command name="sampleCommand2" class="org.myco.sampleproject.command.Sample2Cmd">
      <usage>
         This is a sample command2
      </usage>
      <requiredParameters>
      	 <map name="param1">Required param1</map>
         <list name="param2">Required param2</list>
      </requiredParameters>
</command>

    ...
</library>

Any amount of command elements can be placed within the library element

Command element

1.Must have name and class attribute defined
2.Usage defines the command usage in English text

Parameters:
requiredParameters: Set of parameters that must be provided in test script
optionalParameters: Set of parameters that can be provided in test script but are not required
produces: Set of parameters that will be saved in Context object by the command execution

You can provide none, some, or all of the above parameter types.

Each parameters can take following types: string integer boolean list: contains params within (e.g. hellogoodbye) map: contains params within as key/value (e.g. value1/value2) param: undefined object type (not string, integer, or boolean)

You cannot register 2 or more commands with same command name throughout 'testlibrary'