Each thread executes one test or resource at a time.
Methods
|
|
|
|
IsIdle
|
IsIdle ( self )
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.
|
|
RunTest
|
RunTest (
self,
descriptor,
context,
)
Run the test given by descriptor .
-
descriptor
- The
TestDescriptor for the test.
-
context
- The
Context in which to run the test.
Derived classes may override this method.
|
|
Start
|
Start (
self,
response_queue,
engine=None,
)
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 .
|
|
Stop
|
Stop ( self )
Stop the target.
- postconditions
- The target may no longer be used.
|
|
_BeginResourceSetUp
|
_BeginResourceSetUp ( self, resource_name )
Begin setting up the indicated resource.
-
resource_name
- A string naming a resource.
- returns
- If the resource has already been set up, returns a
tuple
(outcome, map) . The outcome indicates the outcome
that resulted when the resource was set up; the map is a map
from strings to strings indicating properties added by this
resource. Otherwise, returns None , but marks the resource
as in the process of being set up; it is the caller's
responsibility to finish setting it up by calling
_FinishResourceSetUp .
|
|
_FinishResourceSetUp
|
_FinishResourceSetUp (
self,
resource,
result,
properties,
)
|
|
_GetTemporaryDirectory
|
_GetTemporaryDirectory ( self )
|
|
_NoteIdleThread
|
_NoteIdleThread ( self )
Note that the current thread.
This method is called by the thread when it has completed a
task.
|
|
_RecordResult
|
_RecordResult ( self, result )
Record the result .
-
result
- A
Result of a test or resource execution.
|
|
_RunTest
|
_RunTest (
self,
descriptor,
context,
)
Run the test given by descriptor .
-
descriptor
- The
TestDescriptor for the test.
-
context
- The
Context in which to run the test.
This method will be called from the thread that has been
assigned the test.
|
|
_Trace
|
_Trace ( self, message )
Write a trace message .
-
message
- A string to be output as a trace message.
|
|
__init__
|
__init__ (
self,
database,
properties,
)
Construct a ThreadTarget .
-
database
- The
Database containing the tests that will be
run.
-
properties
- A dictionary mapping strings (property names)
to strings (property values).
|