<source><name>Hemi.app.module.test</name><project><name>Hemi JavaScript Framework</name><url-title>Hemi JavaScript Framework Project</url-title><url>/Hemi/</url></project><package><path>Hemi.app.module.test</path><library>Hemi</library><description>Test Modules are Modules decorated for unit testing.  For example, the <a href="../Tests/test.app.comp.js">Application Component Tests</a> includes several unit tests for vetting the Application Component class.</description><static-class><name>service</name><version>3.1.9</version><description>Static implementation of the hemi.app.module.serviceImpl class.</description></static-class><class><name>serviceImpl</name><version>3.1.9</version><description>The module service provides a convenience for modularizing and managing standard JavaScript as reusable components and tests.</description><method><name>UnloadTest</name><param name="sTest" type="String">Name of the Test Module</param><return-value type="boolean" name="bRemoved">Bit indicating whether the test was removed.</return-value><description>Unloads the specified test module.</description></method>
Clean up the tasks associated with the test
This means drilling through the implementation ids

<method><name>NewTest</name><param name="sName" type="String">Name of the Test Module</param><param name="oContainer" type="XHTMLComponent" optional="1">XHTML Component acting as a container for the module.</param><param name="fTestHandler" type="function" optional="1">Function handler to be invoked when test status has changed.</param><param name="fSuiteHandler" type="function" optional="1">Function handler to be invoked when all tests have been completed.</param><param name="sPath" type="String" optional="1">Parent path to the test module.</param><param name="sContent" type="String" optional="1">Content of the test module.</param><return-value type="TestModule" name="oTestModule">A new TestModule object.</return-value><description>Creates a new TestModule object.</description></method>
m.clearTests();
Start Test
Stop Test
Add Test Message
Test Status
<object><name>TestModule</name><description>A TestModule encapsulates the imported JavaScript and an API for operating within the framework, and includes a testing harness.</description><method virtual="1"><name>Initialize</name><description>Invoked when the module is loaded.</description></method><method><name>getReport</name><return-value type="String" name="sReport">A basic status report of all test results</return-value><description>Returns a formatted text report of all test results.</description></method><method virtual="1"><name>getTestTask</name><return-value type="Task" name="oTask">A task object with named dependencies for each test in the suite.</return-value><description>Returns the task object used to correlate the test state across the suite.</description></method><method virtual="1"><name>Test*</name><param name="testResult" type="TestResult">The object representing the result of this test invocation.</param><return-value type="boolean" name="bTested" default="true">Bit indicating the test completed.  If <i>false</i> is explicitly returned, the test is treated as an asynchronous test and will not complete until the corresponding <i>End*</i> method is invoked.</return-value><description>When a module is created as a test, any public function whose name begins with Test (e.g.: funtion TestThisScript(){}) is parsed as a managed unit test case.</description></method><method virtual="1"><name>EndTest*</name><param name="bResult" type="boolean">Bit indicating the result of the test.</param><description>EndTest* completes the execution of the test.  When a test explicitly returns <i>false</i>, the test result remains open until this  method is explicitly invoked.  This allows test suites to include asynchronous tests.</description></method><method virtual="1"><name>HandleContinueTest*</name><param name="testResult" type="TestResult">The object representing the result of this test invocation.</param><description>HandleContinueTest* is called  when ContinueTest* is invoked.</description></method><method><name>ContinueTest*</name><description>Used for cyclical testing and from callbacks while handling dependencies  Used for asynchronous tests with asynchronous dependencies.</description></method><method><name>ResetSuite</name><description>Resets the tasklist that correlates the tests.  This will cause existing dependencies on these tests to be resolved, and the test suite will be assigned a new task id.</description></method><method><name>Assert</name><param name="bCondition" type="boolean">Condition being asserted as true.</param><param name="sMessage" type="String">Message to raise if the condition is false.</param><description>Asserts a condition as being true.  If false, an exception is raised with the specified message.  Within a test case, the exception is caught and recorded against an internal test object for use in propogating the results.</description></method><method internal="1"><name>_AM</name><param name="oTest" type="TestResult">A TestResult object.</param><param name="sMessage" type="String">Message to record for the specified TestResult.</param><description>Logs the specified message as an error and adds the message to the specified TestResult messages array.</description></method><method><name>getTests</name><return-value type="array" name="aTestResults">An array of test results.</return-value><description>Every test invocation generates a new TestResultObject and passes that object to the test.  The test can set the status or message property on the result, and the result is stored in the test results array.</description></method><method><name>RunTests</name><description>Executes all discovered test cases.  Test results are logged to the 621.#.#.# message space (refer to hemi.util.logger and hemi.message for more information).  Method is only available when module is loaded as a TestModule.</description></method><method><name>RunTest</name><param name="sTestName" type="String">Name of the test to run.</param><description>Executes the specified test.</description></method><method><name>logError</name><param name="sMessage" type="String">Message to send to the logger.</param><description>Sends a message in the #100.5 message block.</description></method><method><name>logWarning</name><param name="sMessage" type="String">Message to send to the logger.</param><description>Sends a message in the ###.4 message block.</description></method><method><name>logDebug</name><param name="sMessage" type="String">Message to send to the logger.</param><description>Sends a message in the ###.1 message block.</description></method><method><name>logFatal</name><param name="sMessage" type="String">Message to send to the logger.</param><description>Sends a message in the ###.7 message block.</description></method><method><name>logAdvisory</name><param name="sMessage" type="String">Message to send to the logger.</param><description>Sends a message in the ###.2 message block.</description></method><method><name>log</name><param name="sMessage" type="String">Message to send to the logger.</param><description>Sends a message in the ###.3 message block.</description></method><property type="Array&lt;String&gt;" get="1" private="1" name="TestMembers" internal="1">Array of test names.   Property is only available when module is loaded as a TestModule.</property><property type="Node" get="1" name="Container">A pointer to the XHTML Node for which the module was loaded.</property><property type="XHTMLComponent" get="1" name="Component">A pointer to the XHTMLComponent created for any Container, if a Container was used.</property></object><object><name>TestResult</name><description>A TestResult represents the collected and specified metrics of a specific test invocation.</description><property type="String" get="1" name="name">The name of the test.</property><property type="Date" get="1" name="start_time">The time when the test began.</property><property type="Date" get="1" name="stop_time">The time when the test completed.</property><property type="int" get="1" set="1" name="status" default="0">The status of the result.  0 = created; 1 = prior to start, 2 = after run, 3 = before end, 4 = ended.</property><property type="boolean" get="1" set="1" name="error" default="0">Bit indicating a failure or exception occured.</property><property type="Array&lt;String&gt;" get="1" name="messages">A string array of messages.  </property><property type="variant" get="1" set="1" name="data">General data property for storing data during the execution of the test.</property></object></class></package><index><description>Test Modules are Modules decorated for unit testing.  For example, the </description><url>Hemi_api.html</url><url-title>API Index</url-title></index></source>
