Runtime Interface
External API assemblies can interact with the XJEase runtime if they declare a
static class in the assembly. Each of the documented members of the class are optional; an assembly can define purely the items that it needs and it allows for additional members to be added to the specification in the future. XJTAG will just use or set the members that it finds.
The class must be public
and static
and be named XJEaseRuntimeInterface
. It can be declared inside any namespace within the assembly. The class has the following members, any of which can be omitted if they are not required:
// C# example namespace Api { /// <summary> /// XJEase external API runtime interface. /// </summary> public static class XJEaseRuntimeInterface { /// <summary> /// Called when all XJEase tests have finished by whatever method (all tests passed, test failure, forcibly stopped). /// Called after the Stop method if tests are forcibly stopped. /// </summary> public static void Finished() { } /// <summary> /// Called when execution is being forcibly stopped. /// </summary> public static void Stop() { } /// <summary> /// Gets the version of XJTAG that's running. /// </summary> public static System.Version Version { get; set; } } }
// C++/CLI example using namespace System; namespace Api { /// <summary> /// XJEase external API runtime interface. /// </summary> public ref class XJEaseRuntimeInterface abstract sealed { private: static property System::Version^ VersionProperty; public: /// <summary> /// Called when all XJEase tests have finished by whatever method (all tests passed, test failure, forcibly stopped). /// Called after the Stop method if tests are forcibly stopped. /// </summary> static void Finished() { } /// <summary> /// Called when execution is being forcibly stopped. /// </summary> static void Stop() { } /// <summary> /// Gets the version of XJTAG that's running. /// </summary> static property System::Version^ Version { System::Version^ get() { return VersionProperty; } void set(System::Version^ version) { VersionProperty = version; } } }; }
- Finished
- A method that is called by the XJEase runtime once all tests have completed no matter how they finished. If tests were forcibly stopped, the
Stop
method is called and then theFinished
method. This method is useful for clearing up and freeing any resources that are allocated during tests. - Stop
- A method that is called by the XJEase runtime when XJEase execution is being stopped, e.g. the user has pressed the Stop button. This method is useful for cancelling any dialog box that the API has open or cleanly aborting any long running operation.
- Version
- This property is assigned with the current version of XJTAG that is running. This may be useful to some APIs that need to differentiate between different versions of XJTAG, if for example they require a minimum version to run correctly.
XJTAG v4.1.100