SysTestRunner Class [AX 2012]
The SysTestRunner class simplifies test execution.
| Method | Description | |
|---|---|---|
| applyGlobalParameters | For internal use. |
| applyParameters | Assigns values to parameters. |
| cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) |
| equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) |
| getNumberOfTests | Returns the number of tests in the test runner suite. |
| getResult | Returns a valid instance of the SysTestResult class. |
| getSummary | Returns the result summary. |
| getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) |
| handle | Retrieves the handle of the class of the object. (Inherited from Object.) |
| new | Creates a new test runner instance. |
| notify | Releases the hold on an object that has called the wait method on this object. (Inherited from Object.) |
| notifyAll | Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.) |
| objectOnServer | Determines whether the object is on a server. (Inherited from Object.) |
| owner | Returns the instance that owns the object. (Inherited from Object.) |
| run | Runs the current test. |
| setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) |
| toString | Returns a string that represents the current object. (Inherited from Object.) |
| usageCount | Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.) |
| wait | Pauses a process. (Inherited from Object.) |
| xml | Returns an XML string that represents the current object. (Inherited from Object.) |
| ::createSuiteForClass | Creates a test suite for the test class. |
| ::createTestRunner | Returns a test runner instance for the specified test name or test project name. |
The following example demonstrates the simplification of a test execution by using the SysTestRunner class.
static void main(args _args)
{
// Create a SysTestRunner instance for the test class.
SysTestRunner runner = new SysTestRunner(classStr(NameOfTest));
// Specify that the XML output will be written to the
// default log folder.
SysTestListenerXML listener = new SysTestListenerXML(
xInfo::directory(DirectoryType::Log));
// Add the listener and run the test case.
runner.getResult().addListener(listener);
runner.run();
}
Community Additions
ADD
Show: