Namespace: OpenEdge.ABLUnit.Runner
Type: Class ABLRunner
Parent Classes:
Progress.Lang.Object

Inherits: Progress.Lang.Object
Implements: OpenEdge.Logging.ISupportLogging


Copyright (c) 2013-2024 by Progress Software Corporation. All rights reserved.
File:ABLRunner
Purpose:Runner of the ABLUnit framework, which runs the testclasses, test procedures, testsuite classes,
testsuite procedures and ABL files inside a folder.
Author(s):hgarapat
Created:Wed Jun 27 18:18:40 IST 2012
Notes:Modified the annotations. The newly modified annotations are common for both class and procedure files.
Current annotations are BeforeAll, BeforeEach, Test, AfterEach, AfterAll, and Ignore.
Legacy annotations Before, Setup, TearDown, and After are supported but logged as deprecated.



Method Summary
  Options Name Purpose
  OpenEdge.Core.Collections.Array BuildAnnotationInfo (JsonObject) /*------------------------------------------------------------------------------ Create an Array of AnnotationInfo objects from the JSON data @param JsonObject The annotation JSON data @return Array An array of annotation data. Will always be a valid object ------------------------------------------------------------------------------*/
  CHARACTER BuildAttributeValue (character, JsonObject) /*------------------------------------------------------------------------------ Builds the attribute value, as ABLUnit expects it "value,value2" etc The annotation data format is: "anno-name" : {"x": "y"} // x=y split up {"x": ["p", "q"]} // x=y split up null // no parens in source [] // combo of {} and null @param character The attribute name. If blank or null, the null string is returned @param JsonObject The annotation data. If invalid, the null string is returned @return character The attribute value, joined together ------------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Reflection.TypeInfo BuildTypeInfo (character, character) /*------------------------------------------------------------------------------ Generates the procedure information in xref xml file @param character The test case being examined for addition to ABLUnit @param character The expected type of test case (class or proc[edure]) @return TypeInfo Unit test type info about the program ------------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Reflection.TypeInfo BuildTypeInfo (character, character, character) /*------------------------------------------------------------------------------ Generates the procedure information in xref xml file @param character The test case being examined for addition to ABLUnit @param character The expected type of test case (class or proc[edure]) @param character The name of the found/generated XREF file @return TypeInfo Unit test type info about the program ------------------------------------------------------------------------------*/
  FindXrefFiles () /*------------------------------------------------------------------------------ This method will locate any local XREF files if configured to do so. ------------------------------------------------------------------------------*/
  CHARACTER GetFullPathname (character) /*------------------------------------------------------------------------------ This method will return the full path of a given file. @param character A single, simple file name @return character The full path to the file on disk ------------------------------------------------------------------------------*/
  CHARACTER getRelativePathOfClasses (character) /*------------------------------------------------------------------------------ Returns the relative path of the classes if the input is of qualified type. @param character @return character ------------------------------------------------------------------------------*/
  CHARACTER GetXRefFile (character, character) /*------------------------------------------------------------------------------ This method should return a valid XREF path which physically exists on disk. As XREF files can be created using different patterns for file extensions (based on how the file was compiled), we need to create a couple of standard candiate filenames using the expected file extension. The order for locating a valid XREF file will use the following steps: 1. Use the given test case (type: class or procedure) replacing the file extension: 1a. Create a candidate filename using a common pattern for the PCTCompile task. 1b. Create a candidate filename using a common pattern for PDSOE/Explicit naming. 2. Search for a matching XREF filename in a list of potential, available files. 3. Return ? if no matching XREF file was located. @param character The test case being examined for addition to ABLUnit @param character The expected type of test case (class or proc[edure]) @return character The located XREF file (or ? if not found) ------------------------------------------------------------------------------*/
  HandleTestSuiteClasses (TestEntity, character) /*------------------------------------------------------------------------------ Handler for test suite classes @param TestEntity @return character ------------------------------------------------------------------------------*/
  HandleTestSuiteProcedures (TestEntity, character) /*------------------------------------------------------------------------------ Runs a TestEntity and aggregates results @param TestEntity The entity being run (class/method/suite/root) @param character ------------------------------------------------------------------------------*/
  LONGCHAR loadSerializedTree (TestEntity) /*------------------------------------------------------------------------------ Load serialized tree @param TestEntity The entity being run (class/method/suite/root) @return longchar ------------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Reflection.TypeInfo ParseXMLDocument (character) /*------------------------------------------------------------------------------ Parses the XREF XML file for Test Methods and Procedures @param character The XREF data as an XML file @return TypeInfo Unit test type info about the program ------------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Model.TestEntity populateTestModel (character, integer) /*------------------------------------------------------------------------------ Runs the corresponding method based on the type of the testcase. @param character @param integer @return TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  populateTestModel (character, integer, TestEntity) /*------------------------------------------------------------------------------ Populates the model based on the test input. looks at all the relevant test methods, internal procedures in the test input. @param character @param integer @param TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  populateTestModelForInternalProcs (handle, character, ProcedureAnnotationInfo, TestInfo, logical, TestEntity) /*------------------------------------------------------------------------------ Populate test model for internal procedures @param handle @param character @param ProcedureAnnotationInfo @param TestInfo @param logical @param TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  populateTestModelForProcedureType (character, character, TestEntity) /*------------------------------------------------------------------------------ Given a test procedure and test internal procedure, this method will store and run the test procedures and calls a method which writes the results in the xml file. @param character @param character @param TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  populateTestModelForTestCase (character, character, TestEntity) /*------------------------------------------------------------------------------ Compiles and call the corresponding method or internal procedure to run the testcase @param character @param character @return TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  populateTestModelForTestClass (character, character, TestEntity) /*------------------------------------------------------------------------------ Given a testclass and test method, this method will store and run the test methods and calls a method which writes the results in the xml file @param character The test class name @param character The test class method name @return TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  populateTestModelForTestFolder (character, TestEntity) /*------------------------------------------------------------------------------ Populates the test model for the ABL Unit files inside the testfolder @param character @param TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  populateTestModelForTestMethod (Object, character, ClassAnnotationInfo, TestInfo, logical, TestEntity)
  populateTestModelForTestSuite (TestInfo, TestEntity) /*------------------------------------------------------------------------------ Iterates through all the test cases in the TestSuite annotations @param TestInfo @param TestEntity The entity being run (class/method/suite/root) ------------------------------------------------------------------------------*/
  ProcessTestResult (TestEntity, TestTypeResult) /*------------------------------------------------------------------------------ Processes a test entity's TestResult based on status @param TestEntity The entity being run (class/method/suite/root) @param TestTypeResult The summary to which this result aggregates ------------------------------------------------------------------------------*/
  RecurseDir (character, character) /*------------------------------------------------------------------------------ This method will recurse into a directory and build a TT structure. @param character @param character ------------------------------------------------------------------------------*/
  RunTests () /*------------------------------------------------------------------------------ This method runs the tests that are passed as JsonObject. ------------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Results.TestTypeResult runtests (TestEntity, character) /*------------------------------------------------------------------------------ Runs a TestEntity and aggregates results @param TestEntity The entity being run (class/method/suite/root) @param character The ABLUnit output file (not results.xml) @return TestTypeResult The aggregate result for this test entity ------------------------------------------------------------------------------*/
  INTEGER ScoreMatches (Array, Array) /*------------------------------------------------------------------------------ Produce a score for 2 files based on the # of matching directories. @param Array A list of test paths @oaram Array A list of matched files @return integer[] A list of scores ------------------------------------------------------------------------------*/
  updateFile (character, longchar, logical) /*------------------------------------------------------------------------------ Writes to the update file the given content. If override is true, the file is overwritten. @param character @param longchar @param logical ------------------------------------------------------------------------------*/
  UpdateIgnoreDetails (TestTestResult, TestEntity, character, TestTypeResult) /*------------------------------------------------------------------------------ Modify properties for ignored test @param TestTestResult @param TestEntity The entity being run (class/method/suite/root) @param character @param TestTypeResult ------------------------------------------------------------------------------*/
  updateStackTrace (Error, character, character) /*------------------------------------------------------------------------------ Updates stack trace with the given error in the given file @param PLO @param character @param character ------------------------------------------------------------------------------*/
  updateStackTrace (Stop, character, character) /*------------------------------------------------------------------------------ Writes a stack trace for a stop condition @param Progress.Lang.Stop THe stop condition @param character The file into which to write @param character The ID of the test entity ------------------------------------------------------------------------------*/
  updateStackTraceProperty ()

Constructor Summary
  Options Name Purpose
  ABLRunner () /* Default constructor */
  ABLRunner (TestConfig, character) /*------------------------------------------------------------------------------ Constructor, which accepts formatted JSON object of configuration file. @param TestConfig Configuration for this test run @param character The name of the 'update' file, used by PDSOE for incremental reporting of this test run ------------------------------------------------------------------------------*/

Property Summary
  Options Name Purpose
  OpenEdge.Logging.ILogWriter Logger


Method Detail
Top

OpenEdge.Core.Collections.Array BuildAnnotationInfo (JsonObject)

Create an Array of AnnotationInfo objects from the JSON data
Parameters:
pData Progress.Json.ObjectModel.JsonObject
 
Returns OpenEdge.Core.Collections.Array
  Array An array of annotation data. Will always be a valid object
Top

CHARACTER BuildAttributeValue (character, JsonObject)

Builds the attribute value, as ABLUnit expects it "value,value2" etc
The annotation data format is:
"anno-name" :
{"x": "y"} // x=y split up
{"x": ["p", "q"]} // x=y split up
null // no parens in source
[] // combo of {} and null
Parameters:
pAttrName CHARACTER
 
pAttrData Progress.Json.ObjectModel.JsonObject
 
Returns CHARACTER
  character The attribute value, joined together
Top

OpenEdge.ABLUnit.Reflection.TypeInfo BuildTypeInfo (character, character)

Generates the procedure information in xref xml file
Parameters:
testCase CHARACTER
 
testType CHARACTER
 
Returns OpenEdge.ABLUnit.Reflection.TypeInfo
  TypeInfo Unit test type info about the program
Top

OpenEdge.ABLUnit.Reflection.TypeInfo BuildTypeInfo (character, character, character)

Generates the procedure information in xref xml file
Parameters:
testCase CHARACTER
 
testType CHARACTER
 
xrefFile CHARACTER
 
Returns OpenEdge.ABLUnit.Reflection.TypeInfo
  TypeInfo Unit test type info about the program
Top

FindXrefFiles ()

This method will locate any local XREF files if configured to do so.
Top

CHARACTER GetFullPathname (character)

This method will return the full path of a given file.
Parameters:
pcFile CHARACTER
 
Returns CHARACTER
  character The full path to the file on disk
Top

CHARACTER getRelativePathOfClasses (character)

Returns the relative path of the classes if the input is of qualified type.
Parameters:
testcase CHARACTER
 
Returns CHARACTER
  character
Top

CHARACTER GetXRefFile (character, character)

This method should return a valid XREF path which physically exists on disk. As
XREF files can be created using different patterns for file extensions (based
on how the file was compiled), we need to create a couple of standard candiate
filenames using the expected file extension. The order for locating a valid XREF
file will use the following steps:
1. Use the given test case (type: class or procedure) replacing the file extension:
1a. Create a candidate filename using a common pattern for the PCTCompile task.
1b. Create a candidate filename using a common pattern for PDSOE/Explicit naming.
2. Search for a matching XREF filename in a list of potential, available files.
3. Return ? if no matching XREF file was located.
Parameters:
pcTestCase CHARACTER
 
pcTestType CHARACTER
 
Returns CHARACTER
  character The located XREF file (or ? if not found)
Top

HandleTestSuiteClasses (TestEntity, character)

Handler for test suite classes
Parameters:
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
classes CHARACTER
 
Top

HandleTestSuiteProcedures (TestEntity, character)

Runs a TestEntity and aggregates results
Parameters:
testEntity OpenEdge.ABLUnit.Model.TestEntity
  The entity being run (class/method/suite/root)
procedures CHARACTER
 
Top

LONGCHAR loadSerializedTree (TestEntity)

Load serialized tree
Parameters:
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
Returns LONGCHAR
  longchar
Top

OpenEdge.ABLUnit.Reflection.TypeInfo ParseXMLDocument (character)

Parses the XREF XML file for Test Methods and Procedures
Parameters:
xmlDocument CHARACTER
 
Returns OpenEdge.ABLUnit.Reflection.TypeInfo
  TypeInfo Unit test type info about the program
Top

OpenEdge.ABLUnit.Model.TestEntity populateTestModel (character, integer)

Runs the corresponding method based on the type of the testcase.
Parameters:
testCase CHARACTER
 
testCount INTEGER
 
Returns OpenEdge.ABLUnit.Model.TestEntity
  TestEntity The entity being run (class/method/suite/root)
Top

populateTestModel (character, integer, TestEntity)

Populates the model based on the test input. looks at all the relevant
test methods, internal procedures in the test input.
Parameters:
testCase CHARACTER
 
testCount INTEGER
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
  The entity being run (class/method/suite/root)
Top

populateTestModelForInternalProcs (handle, character, ProcedureAnnotationInfo, TestInfo, logical, TestEntity)

Populate test model for internal procedures
Parameters:
procHandle HANDLE
 
testProcedureName CHARACTER
 
procAnnotInfo OpenEdge.ABLUnit.Reflection.ProcedureAnnotationInfo
 
testProcInfo OpenEdge.ABLUnit.Reflection.TestInfo
 
runAllProcs LOGICAL
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
  The entity being run (class/method/suite/root)
Top

populateTestModelForProcedureType (character, character, TestEntity)

Given a test procedure and test internal procedure, this method will store and
run the test procedures and calls a method which writes the results in the xml file.
Parameters:
testProcedureName CHARACTER
 
testInternalProcedure CHARACTER
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
  The entity being run (class/method/suite/root)
Top

populateTestModelForTestCase (character, character, TestEntity)

Compiles and call the corresponding method or internal procedure to run the testcase
Parameters:
testCase CHARACTER
 
test CHARACTER
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
Top

populateTestModelForTestClass (character, character, TestEntity)

Given a testclass and test method, this method will store and run the
test methods and calls a method which writes the results in the xml file
Parameters:
testClassName CHARACTER
 
testMethod CHARACTER
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
Top

populateTestModelForTestFolder (character, TestEntity)

Populates the test model for the ABL Unit files inside the testfolder
Parameters:
testFolder CHARACTER
 
testEnity OpenEdge.ABLUnit.Model.TestEntity
 
Top

populateTestModelForTestMethod (Object, character, ClassAnnotationInfo, TestInfo, logical, TestEntity)

Parameters:
testClassType Progress.Lang.Object
 
testClassName CHARACTER
 
classAnnotInfo OpenEdge.ABLUnit.Reflection.ClassAnnotationInfo
 
pTestMethodInfo OpenEdge.ABLUnit.Reflection.TestInfo
 
runAllMethods LOGICAL
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
Top

populateTestModelForTestSuite (TestInfo, TestEntity)

Iterates through all the test cases in the TestSuite annotations
Parameters:
testSuiteList OpenEdge.ABLUnit.Reflection.TestInfo
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
  The entity being run (class/method/suite/root)
Top

ProcessTestResult (TestEntity, TestTypeResult)

Processes a test entity's TestResult based on status
Parameters:
pEntity OpenEdge.ABLUnit.Model.TestEntity
 
pSummary OpenEdge.ABLUnit.Results.TestTypeResult
 
Top

RecurseDir (character, character)

This method will recurse into a directory and build a TT structure.
Parameters:
pcFrom CHARACTER
 
pcExtMask CHARACTER
 
Top

RunTests ()

This method runs the tests that are passed as JsonObject.
Top

OpenEdge.ABLUnit.Results.TestTypeResult runtests (TestEntity, character)

Runs a TestEntity and aggregates results
Parameters:
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
pUpdateFile CHARACTER
 
Returns OpenEdge.ABLUnit.Results.TestTypeResult
  TestTypeResult The aggregate result for this test entity
Top

INTEGER ScoreMatches (Array, Array)

Produce a score for 2 files based on the # of matching directories.
@oaram Array A list of matched files
Parameters:
poTestPath OpenEdge.Core.Collections.Array
 
poMatchedFiles OpenEdge.Core.Collections.Array
 
Returns INTEGER
  integer[] A list of scores
Top

updateFile (character, longchar, logical)

Writes to the update file the given content.
If override is true, the file is overwritten.
Parameters:
pUpdateFile CHARACTER
 
content LONGCHAR
 
lOverride LOGICAL
 
Top

UpdateIgnoreDetails (TestTestResult, TestEntity, character, TestTypeResult)

Modify properties for ignored test
Parameters:
testResult OpenEdge.ABLUnit.Results.TestTestResult
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
  The entity being run (class/method/suite/root)
testName CHARACTER
 
summaryResult OpenEdge.ABLUnit.Results.TestTypeResult
 
Top

updateStackTrace (Error, character, character)

Updates stack trace with the given error in the given file
Parameters:
errorResult Progress.Lang.Error
 
pUpdateFile CHARACTER
 
id CHARACTER
 
Top

updateStackTrace (Stop, character, character)

Writes a stack trace for a stop condition
Parameters:
pStop Progress.Lang.Stop
 
pUpdateFile CHARACTER
 
pId CHARACTER
 
Top

updateStackTraceProperty ()



Constructor Detail
Top

ABLRunner ()

/* Default constructor
Top

ABLRunner (TestConfig, character)

Constructor, which accepts formatted JSON object of configuration file.
Parameters:
inputConfig OpenEdge.ABLUnit.Runner.TestConfig
 
pUpdateFile CHARACTER
 


Property Detail
Top

OpenEdge.Logging.ILogWriter Logger

Returns OpenEdge.Logging.ILogWriter