OpenTAP 9.27
API Reference
Classes | Public Member Functions | Properties | List of all members
OpenTap.TestPlanRun Class Reference

Object that holds the state of a specific TestPlan run. Also internally manages resources and threads relating to the TestStepRun. Note: ResourceManager manages opening and closing a Resource. More...

Inheritance diagram for OpenTap.TestPlanRun:
OpenTap.TestRun

Classes

class  SpecialParameterNames
 Special Parameters refer to result parameters on a test plan run that describe relevant metadata about the run. They can be extracted with e.g. 'Run.Parameters.FirstOrDefault(p => p.Name == SpecialParameterNames.Property)' More...
 

Public Member Functions

void AddResultListener (IResultListener listener)
 Result listeners can be added just before the test plan actually starts. If the operation fails an exception will be thrown.
 
void RemoveResultListener (IResultListener listener)
 Removes a result listener from the active result listeners in this run. Note this can only be done at specific times during test plan execution, namely when result listeners has not been connected. If the operation fails an exception will be thrown.
 
void WaitForResults ()
 Waits for result propagation thread to be idle.
 
void WaitForResourcesOpened (CancellationToken cancel, params IResource[] resources)
 Waits for the given resources to become opened. More...
 
 TestPlanRun (TestPlan plan, IList< IResultListener > resultListeners, DateTime startTime, long startTimeStamp, bool isCompositeRun=false)
 Starts tasks to open resources. All referenced instruments and duts as well as supplied resultListeners to the plan. More...
 
 TestPlanRun (TestPlan plan, IList< IResultListener > resultListeners, DateTime startTime, long startTimeStamp, string testPlanXml, bool isCompositeRun=false)
 Starts tasks to open resources. All referenced instruments and duts as well as supplied resultListeners to the plan. More...
 
void PublishArtifact (Stream stream, string artifactName)
 Publishes an artifact for the test plan run. More...
 
Task PublishArtifactAsync (Stream stream, string artifactName)
 Publishes an artifact for the test plan run asynchronously. More...
 
void PublishArtifact (string file)
 Publishes an artifact for the test plan run.
 
Task PublishArtifactAsync (string file)
 Publishes an artifact for the test plan run asynchronously.
 
- Public Member Functions inherited from OpenTap.TestRun
 TestRun ()
 Creates a new TestRun
 

Properties

string TestPlanXml [get]
 XML for the running test plan.
 
string? Hash [get]
 The SHA1 hash of XML of the test plan.
 
string TestPlanName [get]
 Name of the running test plan.
 
bool FailedToStart [getset]
 Set by the TestPlan execution logic to indicate whether the TestPlan failed to start the TestPlan.
 
TapThread MainThread [get]
 The thread that started the test plan. Use this to abort the plan thread.
 
IEnumerable< string > Artifacts [get]
 Returns a list of all published artifacts. This list will get updated as the test plan progresses.
 
- Properties inherited from OpenTap.TestRun
Guid Id [getprotected set]
 ID of this test run; can be used to uniquely identify a TestStepRun or TestPlanRun.

 
Verdict Verdict [get]
 OpenTap.Verdict resulting from the run.
 
Exception Exception [get]
 Exception causing the Verdict to be 'Error'.
 
virtual TimeSpan Duration [getprotected set]
 Length of time it took to run.
 
DateTime StartTime [getset]
 Time when the test started as a DateTime object.

 
long StartTimeStamp [getprotected set]
 Time when the test started as ticks of the high resolution hardware counter. Use with Stopwatch.GetTimestamp and Stopwatch.Frequency to convert to a timestamp.

 
ResultParameters Parameters [getprotected set]
 A list of parameters associated with this run that can be used by ResultListener.
 

Detailed Description

Object that holds the state of a specific TestPlan run. Also internally manages resources and threads relating to the TestStepRun. Note: ResourceManager manages opening and closing a Resource.

Constructor & Destructor Documentation

◆ TestPlanRun() [1/2]

OpenTap.TestPlanRun.TestPlanRun ( TestPlan  plan,
IList< IResultListener resultListeners,
DateTime  startTime,
long  startTimeStamp,
bool  isCompositeRun = false 
)
inline

Starts tasks to open resources. All referenced instruments and duts as well as supplied resultListeners to the plan.

Parameters
planProperty Plan
resultListenersThe ResultListeners for this test plan run.
startTimeProperty StartTime.
startTimeStamp
isCompositeRun

◆ TestPlanRun() [2/2]

OpenTap.TestPlanRun.TestPlanRun ( TestPlan  plan,
IList< IResultListener resultListeners,
DateTime  startTime,
long  startTimeStamp,
string  testPlanXml,
bool  isCompositeRun = false 
)
inline

Starts tasks to open resources. All referenced instruments and duts as well as supplied resultListeners to the plan.

Parameters
planProperty Plan
resultListenersThe ResultListeners for this test plan run.
startTimeProperty StartTime.
startTimeStamp
isCompositeRun
testPlanXmlPredefined test plan XML. Allowed to be null.

Member Function Documentation

◆ PublishArtifact()

void OpenTap.TestPlanRun.PublishArtifact ( Stream  stream,
string  artifactName 
)

Publishes an artifact for the test plan run.

Parameters
streamThe artifact data as a stream. When publishing an artifact stream, the stream will be disposed by the callee and does not have to be disposed by the caller.
artifactNameThe name of the published artifact.

◆ PublishArtifactAsync()

Task OpenTap.TestPlanRun.PublishArtifactAsync ( Stream  stream,
string  artifactName 
)

Publishes an artifact for the test plan run asynchronously.

Parameters
streamThe artifact data as a stream. When publishing an artifact stream, the stream will be disposed by the callee and does not have to be disposed by the caller.
artifactNameThe name of the published artifact.

◆ WaitForResourcesOpened()

void OpenTap.TestPlanRun.WaitForResourcesOpened ( CancellationToken  cancel,
params IResource[]  resources 
)
inline

Waits for the given resources to become opened.

Parameters
cancel
resources

OpenTAP 9.27 API built Wed Nov 27 2024 13:14:46