HS.HC.Test.TestCase
class HS.HC.Test.TestCase extends %UnitTest.TestCase, HS.Test.Util
HealthShare aware unit testing class. See also HS.Test.ManagerDifferences from %UnitTest.TestCase
- Test* methods are executed in order of definition, not alphabetically
- A single session is maintained for each test case
- Can be called directly from the command line using the Run() method
- Test* methods, that are invoked by the framework. Typically, these methods do a task and check the results.
- A series of public class methods for performing a task. These are intended to be called from other test case classes or the command line
- Private methods for supporting logic
Method Inventory
- ChangeToHub()
- CleanupProductionChanges()
- CreateTestClass()
- FindAuditRecords()
- FindHighAuditID()
- GetLastEnsembleSessionID()
- GetOrCreatePatient()
- GetProductionItemName()
- GetXDataAsStream()
- GetXDataAsStreamWithSubstitutions()
- LogError()
- LogResults()
- MessagesForItem()
- ResponseContainsText()
- Run()
- XDataAsObject()
- XMLGlobalPatientOID()
Parameters
parameter RunAfter;
Specifies other TestCase classes to run before this one
Methods
classmethod ChangeToHub()
classmethod CleanupProductionChanges(pTestName)
Remove HS.Generated.{pTestName} items that have been added to a production
classmethod CreateTestClass(pTest, pClass, Output pNewClassName, pIsWebService=0)
pTest - "Test" or "LoadTest"
pClass - "HS.IHE.XDSb.Registry.Services"
pNewClass - value of new class name such as HS.Generated.Test.IHE.XDSb.Registry.Services
pClass - "HS.IHE.XDSb.Registry.Services"
pNewClass - value of new class name such as HS.Generated.Test.IHE.XDSb.Registry.Services
method FindAuditRecords(pStartingID, pIsSource, pActionCode, pEventCodesContains, Output pCount, pAuditSourceID="") as %SQL.StatementResult
Find all audit records from a starting point
pStartingID - value of FindHighAuditID from before the start of the tests
pIsSource - boolean is the source or recipient of the message
pActionCode - 'C' 'D' 'R' etc
pEventsCodesContains - what to look for in the EventsCodes, ie ITI-52
Output of the count of records found
return value of a result set containing the rows found
method FindHighAuditID() as %Integer
Return the highest Audit ID
classmethod GetLastEnsembleSessionID() as %String
method GetOrCreatePatient(pPatientKey As %String = "", Output pPatientSearchResponse, pStandardHub=0) as %Status
Ensure the given patient exists in the MPI and is cached in the session
classmethod GetProductionItemName(pClass, Output pItemName, Output pProdRef As Ens.Config.Production) as %Status
locate production item by Class
method GetXDataAsStream(pXData, ByRef pStream) as %Status
classmethod GetXDataAsStreamWithSubstitutions(pXData, ByRef pStream) as %Status
Make substitions on {$method{}} and {$expression{}} calls - limited to string size
method LogError(message)
Enter an error message in the log
method LogResults(pStatus As %Status = $$$OK, pResults As HS.Types.IHE.Errors = $$$NULLOREF, pExceptions As HS.Types.IHE.Errors = $$$NULLOREF) as %Status
Log results, returning an error status if either the input status or results are an error
Errors present in the results and exception list will will not return an error (but will be logged as expected)
classmethod MessagesForItem(pConfigName="", pStart="", Output pCount, pMessageBodyClassName="") as %Integer
Given a configuration name, return the Highest ID given a starting point
pConfigName name of configuration item ie HS.IHE.DSUB.NotificationConsumer.Services
pStart an optional starting point
pCount an output value of the count
method ResponseContainsText(pID, pText)
Given the message header id, get the response message (XMLMessage) and check the ContentStream for the text
classmethod Run(methodname, qspec, userparam) as %Status
Run all test methods for this class
classmethod XDataAsObject(pXData, pClassName, ByRef pObject, pTagName="") as %Status
using an XData correlate to an object after performing substitutions
method XMLGlobalPatientOID()
Inherited Members
Inherited Properties
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OnNew()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()
- AssertEqualsViaMacro()
- AssertFailureViaMacro()
- AssertFilesSQLUnorderedSameViaMacro()
- AssertFilesSameViaMacro()
- AssertNotEqualsViaMacro()
- AssertNotTrueViaMacro()
- AssertSkippedViaMacro()
- AssertStatusEqualsViaMacro()
- AssertStatusNotOKViaMacro()
- AssertStatusOKViaMacro()
- AssertSuccessViaMacro()
- AssertTrueViaMacro()
- Checkout()
- GetClone()
- GetObject()
- GetPropertyList()
- GetScript()
- LoadObject()
- LogMessage()
- LookupGatewayService()
- MergeErrors()
- OnAfterAllTests()
- OnAfterOneTest()
- OnBeforeAllTests()
- OnBeforeOneTest()
- OverrideObject()
- ResolveObject()
- ResolveObjectProperties()
- StreamEquals()
- Transformer()
- UnitTest()
- xmlCanonical()
- xmlDump()
- xmlDumpStream()
- xmlExportCanonical()
- xmlExportWriter()