com.bitmechanic.maxq.generator
Interface IScriptGenerator

All Superinterfaces:
ProxyServer.Observer
All Known Implementing Classes:
AbstractCodeGenerator, CompactGenerator, IsacCodeGenerator, JavaCodeGenerator, JythonCodeGenerator, SampleGenerator, TemplateCodeGenerator

public interface IScriptGenerator
extends ProxyServer.Observer

All classes that generate MaxQ scripts must implement this interface. Then they may be listed in generator.classnames in maxq.properties.

Notes: - In practice derived classes are descendents of @AsbtractCodeGenerator. - All generators must put their classname somewhere in the script. This is used to recognise which generator to use when a script is reloaded and recording is resumed.

Author:
Robert Dawson robert@rojotek.com, Wayne Hearn wayne_hearn@dell.com
See Also:
GeneratorFactory

Field Summary
static java.lang.String EOL
           
 
Method Summary
 void close()
          Called when a generator is no longer needed.
 void doLoad()
          Called after a new script has been loaded from file.
 void doNew()
          Called when a new script needs to be begun.
 void doSave(java.lang.String path, java.lang.String fileName)
          Notifies the generator that the script is about to be saved.
 void doStartRecording()
          Called before any processRequest() calls.
 void doStopRecording()
          Called after the last processResponse() call, but may be followed by another doStartRecording() to start the process over again.
 java.lang.String[] getValidFileExtensions()
          Returns an array of valid file extensions for the type of code generator in use.
 java.lang.String parseTestName()
          Parses the name of the test out of the script.
 
Methods inherited from interface com.bitmechanic.maxq.ProxyServer.Observer
processRequest, processResponse
 

Field Detail

EOL

static final java.lang.String EOL
Method Detail

getValidFileExtensions

java.lang.String[] getValidFileExtensions()
Returns an array of valid file extensions for the type of code generator in use.

Returns:
array of valid file extentions

parseTestName

java.lang.String parseTestName()
Parses the name of the test out of the script.

Returns:
test name if test has been loaded or saved. Empty otherwise.

doStartRecording

void doStartRecording()
Called before any processRequest() calls.


doStopRecording

void doStopRecording()
Called after the last processResponse() call, but may be followed by another doStartRecording() to start the process over again.


doNew

void doNew()
Called when a new script needs to be begun. This will not be called when an existing script is loaded from file.

The script should output its full class name during this call to ensure that its generator can be recognised if it is saved and reloaded.


doSave

void doSave(java.lang.String path,
            java.lang.String fileName)
Notifies the generator that the script is about to be saved. This gives it the opportunity to patch the script to include the new filename.


doLoad

void doLoad()
Called after a new script has been loaded from file.


close

void close()
Called when a generator is no longer needed.