Home | Trees | Indices | Help |
---|
|
object --+ | extension.Extension --+ | Target
Base class for target implementations.
A 'Target' is an entity that can run tests. QMTest can spread the workload from multiple tests across multiple targets. In addition, a single target can run more than one test at once.
'Target' is an abstract class.
You can extend QMTest by providing your own target class implementation.
To create your own target class, you must create a Python class derived (directly or indirectly) from 'Target'. The documentation for each method of 'Target' indicates whether you must override it in your target class implementation. Some methods may be overridden, but do not need to be. You might want to override such a method to provide a more efficient implementation, but QMTest will work fine if you just use the default version.
|
|||
__ResourceSetUpException An exception indicating that a resource could not be set up. |
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
arguments = [qm.fields.TextField(name= "name", title= "Name", A list of the arguments to the extension class. |
|||
kind = "target" A string giving kind of extension is implemented by the class. |
|||
Inherited from |
|
|||
Inherited from |
|
Construct a 'Target'. 'database' -- The 'Database' containing the tests that will be run. 'arguments' -- As for 'Extension.__init__'. 'args' -- As for 'Extension.__init__'.
|
Return the name of the target. Derived classes must not override this method. |
Return the group of which the target is a member. Derived classes must not override this method. |
Return the 'Database' containing the tests this target will run. returns -- The 'Database' containing the tests this target will run. Derived classes must not override this method. |
Return true if the target is idle. returns -- True if the target is idle. If the target is idle, additional tasks may be assigned to it. Derived classes must override this method. |
Returns true if this 'Target' is in a particular group. 'group_pattern' -- A string giving a regular expression. returns -- Returns true if the 'group_pattern' denotes a regular expression that matches the group for this 'Target', false otherwise. |
Start the target. 'response_queue' -- The 'Queue' in which the results of test executions are placed. 'engine' -- The 'ExecutionEngine' that is starting the target, or 'None' if this target is being started without an 'ExecutionEngine'. Derived classes may override this method, but the overriding method must call this method at some point during its execution. |
Stop the target. Clean up all resources that have been set up on this target and take whatever other actions are required to stop the target. Derived classes may override this method. |
Run the test given by 'test_id'. 'descriptor' -- The 'TestDescriptor' for the test. 'context' -- The 'Context' in which to run the test. Derived classes may override this method. |
Record the 'result'. 'result' -- A 'Result' of a test or resource execution. Derived classes may override this method, but the overriding method must call this method at some point during its execution. |
Begin setting up the indicated resource. 'resource_name' -- A string naming a resource. returns -- If at attempt to set up the resource has already been made, returns a tuple '(resource, outcome, properties)'. The 'resource' is the 'Resource' object itself, but may be 'None' if the resource could not be set up. The 'outcome' indicates the outcome that resulted when the resource was set up. The 'properties' are a map from strings to strings indicating properties added by this resource. If the resource has not been set up, but _BeginResourceSetUp has already been called for the resource, then the contents of the tuple will all be 'None'. If this is the first time _BeginResourceSetUp has been called for this resource, then 'None' is returned, but the resource is marked as in the process of being set up. It is the caller's responsibility to finish setting it up by calling '_FinishResourceSetUp'. |
Finish setting up a resource. 'resource' -- The 'Resource' itself. 'result' -- The 'Result' associated with setting up the resource. 'properties' -- A dictionary of additional context properties that should be provided to tests that depend on this resource. returns -- A tuple of the same form as is returned by '_BeginResourceSetUp' when the resource has already been set up. |
Set up all the resources associated with 'descriptor'. 'descriptor' -- The 'TestDescriptor' or 'ResourceDescriptor' indicating the test or resource that is about to be run. 'context' -- The 'Context' in which the resources will be executed. returns -- A tuple of the same form as is returned by '_BeginResourceSetUp' when the resource has already been set up. |
Set up the resource given by 'resource_id'. 'resource_name' -- The name of the resource to be set up. 'context' -- The 'Context' in which to run the resource. returns -- A map from strings to strings indicating additional properties added by this resource. |
Clean up the 'resource'. 'resource' -- The 'Resource' that should be cleaned up. 'name' -- The name of the resource itself. |
Return the path to a temporary directory. returns -- The path to a temporary directory to pass along to tests and resources via the 'TMPDIR_CONTEXT_PROPERTY'. |
|
argumentsA list of the arguments to the extension class. Each element of this list should be an instance of 'Field'. The 'Field' instance describes the argument. Derived classes may redefine this class variable. However, derived classes should not explicitly include the arguments from base classes; QMTest will automatically combine all the arguments found throughout the class hierarchy.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Dec 23 12:30:42 2011 | http://epydoc.sourceforge.net |