Home > Class Reference > HSLIB namespace > HS.Test.Manager

HS.Test.Manager

class HS.Test.Manager extends %UnitTest.Manager

HealthShare aware %UnitTest framework that is class driven instead of file driven.

Differences from the %UnitTest.Manager:

A test suite (a collection of all HS.Test.TestCase descendants of a package) can be run from the command line:
  Do ##class(HS.Test.Manager).RunTest("HS.Test.IHE.PIXv3")
  
To run only the direct descendants (siblings) of a package:
  Do ##class(HS.Test.Manager).RunTest("HS.Test.IHE.PIXv3","/norecursive")
  
Or, with debugging, which will break on the first error:
  Do ##class(HS.Test.Manager).RunTest("HS.Test.IHE.PIXv3","/debug")
  
A test case (a single HS.Test.TestCase class) can be run in two different ways:
  Do ##class(HS.Test.Manager).RunTest("HS.Test.IHE.PIXv3:Consumer")
  Do ##class(HS.Test.IHE.PIXv3.Consumer).Run()
  
A test method can be run in two differnt ways as well:
  Do ##class(HS.Test.Manager).RunTest("HS.Test.IHE.PIXv3:Consumer:TestRevisePatient")
  Do ##class(HS.Test.IHE.PIXv3.Consumer).Run("TestRevisePatient")
  
To run a single method without the overhead/output of the framework, call the corresponding classmethod directly:
  Do ##class(HS.Test.IHE.PIXv3.Consumer).RevisePatient("Patient1")
  
Methods can belong to "core", "errors" or "external" groups and selectively run as a group:
  Method TestWidget() { 
   If '..Manager.UserFields.GetAt("core") Quit
   //do the normal test here
  }
  Method TestInvalidWidget() {
   If '..Manager.UserFields.GetAt("errors") Quit
   //do the error condition test here
  }
  Method TestExternalWidget() {
   If '..Manager.UserFields.GetAt("external") Quit
   //do the external condition test here
  }
  
  Do ##class(HS.Test.Manager).RunTest("HS.Test.IHE",,"/errors=0")
  

Method Inventory

Methods

classmethod DebugLoadTestSuite(testsuite As %String = "", qspec As %String = "") as %Status [ Language = objectscript ]
Override: Not supported - files are not loaded
classmethod DebugRunTestCase(testsuite As %Library.String = "", testcase As %Library.String = "", qspec As %Library.String = "", testmethod As %Library.String = "", ByRef userparam As %Library.String) as %Status [ Language = objectscript ]
Override: Not needed - use Run() from a HS.Test.TestCase subclass instead
method LogError(message) [ Language = objectscript ]
Log a message as an error
method PrintURL() [ Language = objectscript ]
Override: Use HS.Test aware report page
classmethod Resolve(ByRef pInput, ByRef pOutput) as %Status [ Language = objectscript ]
Given an input array of items, return a sorted list based on dependencies tInput([,])="" tOutput(,)="" Returns an error if a circular dependency is found
classmethod Run(testspec As %String, qspec As %String, userparam) as %Status [ Language = objectscript ]
Alias for RunTest method
method RunOneTestCase(suite As %String, class As %String, test As %String = "") [ Language = objectscript ]
Override: Run methods in order of definition, not alphabetical
method RunOneTestSuite(dir As %String, suite As %String, testspec As %String, qstruct) [ Language = objectscript ]
Override: Skip loading/deleting classes from files. Now there is a 1:1 correspondance between suite and test-case for sequencing
classmethod RunTest(testspec As %String, qspec As %String, userparam) as %Status [ Language = objectscript ]
Override : Force manditory /noload and /nodelete flags

testspec : Now :: ()

userparam: Top node looks like qspec and will be parsed and added to UserFields

/package=: overrides the data package. Default is HS.Test.Data
/core=[0|1]: indicates if normal tests should be run. Default is 1
/errors=[0|1]: indicates if tests for error conditions should be run. Default is 1
/external=[0|1]: indicates if external (such as NIST) tests should be run. Default is 0 since 3rd party tools may be required
classmethod RunTestSuites(testspec As %String, qspec, userparam) as %Status [ Language = objectscript ]
Override: Loop over class heirarchy rather than directories.

Inherited Members

Inherited Properties

Inherited Methods