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

Inherits: Progress.Lang.Object


Copyright (c) 2013-2021 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 Before, Setup, Test, TearDown, After.



Method Summary
  Options Name Purpose
  OpenEdge.ABLUnit.Reflection.TypeInfo BuildTypeInfo (character) /*------------------------------------------------------------------------------ Generates the procedure information in xref xml file @param character The ABL program (.P or .CLS) file name @return TypeInfo Unit test type info about the program ------------------------------------------------------------------------------*/
  CHARACTER GetClassFile (Class) /*---------------------------------------------------------------------------- Returns the relative path to the .cls file for the given class. ----------------------------------------------------------------------------*/
  CHARACTER GetObjectIdAttribute (handle) /*---------------------------------------------------------------------------- Returns the value of the 'Object-identifier' attribute in the given XML element. ----------------------------------------------------------------------------*/
  CHARACTER GetRefTypeAttribute (handle) /*---------------------------------------------------------------------------- Returns the value of the 'Reference-type' attribute in the given XML element. ----------------------------------------------------------------------------*/
  CHARACTER getRelativePathOfClasses (character) /** returns the relative path of the classes if the input is of qualified type. **/
  HandleTestSuiteClasses (TestEntity, character)
  HandleTestSuiteProcedures (TestEntity, character)
  LONGCHAR loadSerializedTree (TestEntity) /*------------------------------------------------------------------------------ load serialized tree ------------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Reflection.TypeInfo ParseSourceElement (handle) /*---------------------------------------------------------------------------- Parses a <source> element in the xml-xref, looking for methods and annotations. Methods preceded by annotations are added to the given MethodInfo list. ----------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Reflection.TypeInfo ParseXMLDocument (character) /*------------------------------------------------------------------------------ Parses the XREF XML file for Test Methods and Procedures ------------------------------------------------------------------------------*/
  OpenEdge.ABLUnit.Model.TestEntity populateTestModel (character, integer) /*------------------------------------------------------------------------------ Runs the corresponding method based on the type of the testcase. ------------------------------------------------------------------------------*/
  populateTestModel (character, integer, TestEntity) /*------------------------------------------------------------------------------ populates the model based on the test input. looks at all the relavant test methods,internal procedures in the test input. ------------------------------------------------------------------------------*/
  populateTestModelForInternalProcs (handle, character, ProcedureAnnotationInfo, TestInfo, logical, TestEntity)
  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 Notes: ------------------------------------------------------------------------------*/
  populateTestModelForTestCase (character, character, TestEntity) /*------------------------------------------------------------------------------ Compiles and call the corresponding method or internal procedure to run the testcase ------------------------------------------------------------------------------*/
  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 ------------------------------------------------------------------------------*/
  populateTestModelForTestFolder (character, TestEntity) /*------------------------------------------------------------------------------ populates the test model for the ABL Unit files inside the testfolder ------------------------------------------------------------------------------*/
  populateTestModelForTestMethod (Object, character, ClassAnnotationInfo, TestInfo, logical, TestEntity)
  populateTestModelForTestSuite (TestInfo, TestEntity) /* populates through all the testcases in the TestSuite annotation */
  ProcessTestResult (TestEntity, TestTypeResult) /* Processes a test entity's TestResult based on status @param TestEntity The entity to process @param TestTypeResult The summary to which this result aggregates */
  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 */
  updateFile (character, longchar, logical) /*------------------------------------------------------------------------------ writes to the update file the given content. If override is true, the file is overwritten. ------------------------------------------------------------------------------*/
  UpdateIgnoreDetails (TestTestResult, TestEntity, character, TestTypeResult)
  updateStackTrace (Error, character, character) /*------------------------------------------------------------------------------ updates stack trace with the given error in the given file ------------------------------------------------------------------------------*/
  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) This is newly added constructor, which accepts formatted JSON object of configuration file.

Method Detail
Top

OpenEdge.ABLUnit.Reflection.TypeInfo BuildTypeInfo (character)

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

CHARACTER GetClassFile (Class)

Returns the relative path to the .cls file for the given class.
Parameters:
typeClass Progress.Lang.Class
 
Returns CHARACTER
 
Top

CHARACTER GetObjectIdAttribute (handle)

Returns the value of the 'Object-identifier' attribute in the given XML
element.
Parameters:
xmlElement HANDLE
 
Returns CHARACTER
 
Top

CHARACTER GetRefTypeAttribute (handle)

Returns the value of the 'Reference-type' attribute in the given XML element.
Parameters:
xmlElement HANDLE
 
Returns CHARACTER
 
Top

CHARACTER getRelativePathOfClasses (character)

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

HandleTestSuiteClasses (TestEntity, character)

Parameters:
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
classes CHARACTER
 
Top

HandleTestSuiteProcedures (TestEntity, character)

Parameters:
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
procedures CHARACTER
 
Top

LONGCHAR loadSerializedTree (TestEntity)

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

OpenEdge.ABLUnit.Reflection.TypeInfo ParseSourceElement (handle)

Parses a <source> element in the xml-xref, looking for methods and
annotations. Methods preceded by annotations are added to the given
MethodInfo list.
Parameters:
xmlSourceElement HANDLE
 
Returns OpenEdge.ABLUnit.Reflection.TypeInfo
 
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
 
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
 
Top

populateTestModel (character, integer, TestEntity)

populates the model based on the test input. looks at all the relavant test methods,internal procedures in the test input.
Parameters:
testCase CHARACTER
 
testCount INTEGER
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
Top

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

Parameters:
procHandle HANDLE
 
testProcedureName CHARACTER
 
procAnnotInfo OpenEdge.ABLUnit.Reflection.ProcedureAnnotationInfo
 
testProcInfo OpenEdge.ABLUnit.Reflection.TestInfo
 
runAllProcs LOGICAL
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
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
Notes:
Parameters:
testProcedureName CHARACTER
 
testInternalProcedure CHARACTER
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
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
 
testMethodInfo OpenEdge.ABLUnit.Reflection.TestInfo
 
runAllMethods LOGICAL
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
Top

populateTestModelForTestSuite (TestInfo, TestEntity)

/*
populates through all the testcases in the TestSuite annotation
Parameters:
testSuiteList OpenEdge.ABLUnit.Reflection.TestInfo
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
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

RunTests ()

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

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

/* Runs a TestEntity and aggregates results
Parameters:
testEntity OpenEdge.ABLUnit.Model.TestEntity
  The entity being run (class/method/suite/root)
updateFile CHARACTER
 
Returns OpenEdge.ABLUnit.Results.TestTypeResult
  TestTypeResult The aggregate result for this test entity
Top

updateFile (character, longchar, logical)

writes to the update file the given content. If override is true, the file is overwritten.
Parameters:
updateFile CHARACTER
 
content LONGCHAR
 
override LOGICAL
 
Top

UpdateIgnoreDetails (TestTestResult, TestEntity, character, TestTypeResult)

Purpose:
Notes:
Parameters:
testResult OpenEdge.ABLUnit.Results.TestTestResult
 
testEntity OpenEdge.ABLUnit.Model.TestEntity
 
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
 
updateFile 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)

Purpose: This is newly added constructor, which accepts formatted JSON object of configuration file.
Notes:
Parameters:
inputConfig OpenEdge.ABLUnit.Runner.TestConfig
 
updateFile CHARACTER