FunctionFinished Event
Occurs when a TestFunction finishes executing. This event is fired from an arbitrary thread.
Type: Runner
Namespace: XJTAG.Integration.XJRunner
Syntax
public event EventHandler<FunctionFinishedEventArgs> FunctionFinished
Remarks
This event is fired from the thread on which the test code is running. You therefore need to be careful about synchronising access to your data structures and, if your code accesses any user interface controls, you will need to use BeginInvoke to ensure that you access methods and properties from the appropriate thread.
Example
In this case we subscribe to the FunctionFinished event of a Runner object and give an example of how the FunctionFinishedEventArgs object is used to extract information from the event.
class Testing { Runner runner; TestCollection testList; unit lastFunctionResult; string lastFunctionName; string lastFunctionTestGroupName; void InitialiseRunner() { /* * ... * Code to obtain Runner object from project and get test list. * ... */ // Subscribe to FunctionFinished event. runner.FunctionFinished += runner_FunctionFinished; // Run tests. runner.RunTests(testList); } void runner_FunctionFinished(object sender, FunctionFinishedEventArgs e) { // We use the FunctionFinishedEventArgs to retrieve information on the function that has // finished being run. // Get the uint returned from XJEase. lastFunctionResult = e.Result; // Get the name of the TestFunction that has finished and the TestGroup it belongs to. lastFunctionTestGroupName = e.Function.TestGroup.Name; lastFunctionName = e.TestFunction.Name; } }
See Also
XJTAG v4.2.5
