Home > Class Reference > ENSLIB namespace > %UnitTest.SQLRegression
Private  Storage   


class %UnitTest.SQLRegression extends %UnitTest.TestCase

Extends TestCase. Extend from this class to create a regression test


Parameters Properties Methods Queries Indices ForeignKeys Triggers
8 10


AutoPassword Debug SkipTest

%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 IsFileOrderSame
IsFileSame LogMessage OnAfterAllTests
OnAfterEachTest OnAfterOneTest OnAfterSqlFile
OnBeforeAllTests OnBeforeEachTest OnBeforeOneTest
OnBeforeSqlFile TestDynamic TestEmbedded
TestJDBC TestODBC getline
parseSQLFile processDiffFile verifyResults



• parameter DISPLAYELAPSEDTIME = " executed and fetched in ";
DISPLAYELAPSEDTIME enables you to internationalize the display of elapsed time, when TIMESCALE is a positive number.
• parameter DISPLAYSECONDS = "seconds";
DISPLAYSECONDS enables you to internationalize the spelling of "seconds" in the output of elapsed time when TIMESCALE is a positive number.
• parameter DISPLAYTESTNAME = "Test ";
DISPLAYTESTNAME enables you to internationalize the display of the test name, which may be specified after the #### delimiter in the test file, when TIMESCALE is a positive number.
• parameter REFFILE = "reference.log";
Specifies a result file for comparison use
• parameter SHOWPLAN = 0;
Set SHOWPLAN=1 to dump the access plans used by each test in the test script. Use this feature when you need to verify plan stability from one release to the next, or when you want to investigate the impact of creating, dropping, or altering an index. Boolean value specifies if comparing sql plan should be executed. Reference plan must exist in REFFILE. Dynamic Sql Plan created in Dynamic SQL test only.
• parameter SQLFILE;
Comma-delimited sql filenames overrides the sql file lookup by specifying which and in which order sql script files are to be tested
• parameter TESTFILE;
Specifies the xml file running the test so it's not reloaded
• parameter TIMESCALE = 0;
The TIMESCALE parameter enables you to control whether elapsed time information is displayed for each SQL statement, and the number of significant digits used to display the time. This can be used to determine whether significant differences in elapsed time are consumed by any individual query. By default, TIMESCALE="", which will prevent elapsed time information from being displayed at the end of each SQL statement in the test. Setting DISPLAYSECONDS to 1 will display the result in seconds. Setting DISPLAYSECONDS to 10 will display elapsed time in multiples of 10 seconds. Setting TIMESCALE to 0.1 will display elapsed time to the nearest tenth second. By grouping together a set of tests that each take about the same amount of time you can automate the process of determining if any query takes "significantly" more or less time than it did previously.


• method OnAfterEachTest() as %Status
Method to clean up after each Test method is executed.
• method OnAfterSqlFile(sqlfile As %String) as %Status
Method available to do any work after a Sql File has finished execution.
• method OnBeforeEachTest() as %Status
Method to clean up before each Test method is executed.
• method OnBeforeSqlFile(sqlfile As %String) as %Status
Method available to do any work before a Sql File begins execution.
• method TestDynamic()
Test each line of SQL from SQLFILE using dynamic SQL. If no REFFILE exists, it will be created from the dynamic results and that file will serve as the correct test results. It is up to the test creator to confirm that the expected test results are correct.
• method TestEmbedded()
Test each line of SQL from SQLFILE using embedded SQL.
• method TestJDBC()
Test each line of SQL from SQLFILE using a JDBC SQL Gateway connection.
• method TestODBC()
Test each line of SQL from SQLFILE using an ODBC SQL Gateway connection. Requires the existence of the User namespace DSN provided with InterSystems IRIS.
• method processDiffFile(ByRef rslt As %Stream)
Method to display incorrect results in a more readable format.
• method verifyResults(ByRef src As %FileCharacterStream, testName As %String = "") as %Status
Compare dynamic results src against existing reference file