Oracle Fusion Middleware extensions for Logging and Diagnostics
11g Release 1 (11.1.2)

E22565-02

oracle.apps.fnd.appltest.diagfwk.engine.impl
Class TestDefImpl

java.lang.Object
  extended by oracle.apps.fnd.appltest.diagfwk.engine.impl.DiagBObjImpl<T>
      extended by oracle.apps.fnd.appltest.diagfwk.engine.impl.DiagJAXBXMLDoc<TestDef>
          extended by oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl
All Implemented Interfaces:
DiagConstants, DiagBObj<TestDef>, DiagTreeNode, TestTreeNode, DiagImplConstants, TestDef

public class TestDefImpl
extends DiagJAXBXMLDoc<TestDef>
implements TestDef, TestTreeNode, DiagImplConstants

Since:
release specific (what release of product did this appear in)
Version:
$Header: atgpf/appltest/applications/Diagnostics/Engine/src/oracle/apps/fnd/appltest/diagfwk/engine/impl/TestDefImpl.java /main/37 2010/11/29 15:21:53 lwong Exp $
Author:
ppradhan

Nested Class Summary
 
Nested classes/interfaces inherited from interface oracle.apps.fnd.appltest.diagfwk.common.DiagConstants
DiagConstants.ExecutionMode, DiagConstants.Format, DiagConstants.LinkType, DiagConstants.Status
 
Nested classes/interfaces inherited from interface oracle.apps.fnd.appltest.diagfwk.engine.facade.TestTreeNode
TestTreeNode.NodeType
 
Field Summary
 
Fields inherited from class oracle.apps.fnd.appltest.diagfwk.engine.impl.DiagJAXBXMLDoc
errMsgOnLoadXML, errMsgOnValXML
 
Fields inherited from interface oracle.apps.fnd.appltest.diagfwk.common.DiagConstants
APPS_MSG_ID_TAG_NAME, CFG_ADR_PROVIDER_CLASS, CFG_CACHE_PROVIDER_CLASS, CFG_CRED_PROVIDER_CLASS, CFG_DAO_FACTORY_CLASS, CFG_DB_CONN_INFO_PROVIDER_CLASS, CFG_DB_CONN_PROVIDER_CLASS, CFG_NLS_PROVIDER_CLASS, CFG_PLSQL_PROVIDER_CLASS, CFG_PROFILE_PROVIDER_CLASS, CFG_SECURITY_PROVIDER_CLASS, CFG_SESSION_INFO_PROVIDER_CLASS, CFG_URL_PROVIDER_FACTORY_CLASS, CFG_WLS_MBEANSRV_CONNINFO_PROVIDER_CLASS, DATA_SECURITY_PERMISSION_ALLOWED, DATA_SECURITY_PERMISSION_NOT_ALLOWED, DELIM_URL, EXEC_MODE_CLI, EXEC_MODE_ESS, EXEC_MODE_INCIDENT, EXEC_MODE_JAVA, EXEC_MODE_UI, EXECUTABLE_TYPE_JAVA, EXECUTABLE_TYPE_PLSQL, EXECUTABLE_TYPE_TESTREF, FORMAT_HTML, FORMAT_XML, GUID_ORACLE_MINUS1, GUID_ORACLE_ZERO, INPUTS_STATUS_ALL_OPT_INPUTS, INPUTS_STATUS_NO_INPUTS, INPUTS_STATUS_REQ_INPUTS_NO_DEFAULTS, INPUTS_STATUS_REQ_INPUTS_W_DEFAULTS, IO_FLAG_I, IO_FLAG_O, JMX_API_BASE_OBJECT_NAME, LINK_EXTERNAL, LINK_INTERNAL, LINK_METALINK, N, NLS_BUNDLE_JAVA_RES, NLS_BUNDLE_MSG_SVC, NLS_BUNDLE_RES_REF, NLS_BUNDLE_XLIFF, NO, NULL, ODF_MBEAN_DOMAIN_NAME, PARAM_MON_INTERVAL, PLSQL_DEBUG_ENABLED_SYSTEM_PROP, PREREQ_TYPE_TAG_VALUE, PREREQ_TYPE_TEST, SECONDS_IN_ONE_DAY, SECONDS_IN_ONE_HOUR, STATUS_CANCELED, STATUS_EXECERROR, STATUS_FAILURE, STATUS_RUNNING, STATUS_SUCCESS, STATUS_WARNING, SYS_PROP_MAX_MONITOR_INTERNVAL, SYS_PROP_MAX_NUM_THREADS, SYSPROP_APPCONNFILE, SYSPROP_DIAG_CONFIG_FILE, TAG_TYPE_DIAG, TAG_TYPE_TAXONOMY, TEST_TYPE_DECL, TEST_TYPE_JAVA, USER_NAME, WEB_APP_NAME_TAG_NAME, Y, YES
 
Fields inherited from interface oracle.apps.fnd.appltest.diagfwk.engine.impl.DiagImplConstants
KEY_I_PARAM_DEF_REF, KEY_O_PARAM_DEF_REF, KEY_REF_TEST_DEF_TABLE, KEY_STEP_INPUT_PARAM_SECRET, SECRET_MASK, STEP_REP_EXEC_NAME_ENGINE, TOKEN_DELIM, TOKEN_OUTPUTS, TOKEN_STEP, TOKEN_TEST_INPUTS, TOKEN_TEST_OUTPUTS
 
Constructor Summary
TestDefImpl()
           
 
Method Summary
protected  void addParams(java.util.List pDefList, TestParamList toList)
          Adds parameters from the given List of ParameterDefType objects to the TestParamList
protected  void addPrereqs()
          Adds prereqs listed in the JAXB metadata to the prereq list in this object
protected  void addTagValues()
          Adds tag values listed in the JAXB metadata
 TestTreeNode asTestTreeNode()
          Returns this test definition object as a TestTreeNode instance
protected  void checkDependencyCycles()
          Checks for cyclic dependency that this test's relations could cause based on the specified ancestors.
protected  void checkDependencyCycles(java.util.List<oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode> pAncestorTests, java.util.List<oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode> pAncestorTagValues, java.util.Hashtable<java.lang.String,TestDef> pFetched, java.util.Hashtable<java.lang.String,oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode> pCheckedNodes)
          Checks for cyclic dependency that this test's relations could cause based on the specified ancestors.
protected  void checkNestedTestRefStepDefs(TestDefList pAncestors, java.util.Hashtable<java.lang.String,TestDef> pValidated, java.util.Hashtable<java.lang.String,TestDef> pFetched)
          Validates the nested test references if any
protected  void checkRequiredParamsHaveValues()
          Checks that there are values specified for any required parameters.
protected  void checkRunPermission()
          Checks to validate that the current user has the permission to run this test.
protected  void checkStepDefsLoadable()
          Validates that all the step definitions in this tests are loadable.
protected  void cleanupTestExecMonitor()
          Cleans up the test execution monitor
protected  void completeOutputParameters()
          Handles: 1) defaulting un-set output parameters that have defaults 2) checking that required outputs are set
 void copy(TestDef pObj)
          Copies the contents of the given object into this object
 void copyAndPopulate(TestDef pObj)
          Copies the contents of the given object into this object After copying the TestDef attribtues, the JAXB Tree is populated based on the test metadata.
 void copyT(java.lang.Object pObj)
          Copies the contents of the given object into this object
 boolean delete()
          deletes the test and it's associated data from the db deletes parms, inputsets unlinks the tag values, and prereqs from this test
protected  void execute()
          Prepares context for execution and kicks off execution of the steps in this test.
protected  void executeTest()
          Starts execution of the various steps defined in this test metadata.
 void fetch()
          Fetches the test definition from the repository for this test.
 java.util.List<TestParam> fetchActiveInputParams()
          Fetches the list of active input parameters for this test.
 java.util.List<TestParam> fetchActiveOutputParams()
          Fetches the list of active output parameters for this test.
 TestInputSetList fetchDefaultInputSetList()
          Fetches the list of default input sets for this test
 java.util.List<TestParam> fetchInputParams()
          Fetches the test input parameters metadata from this test.
 TestInputSetList fetchInputSetList()
          Fetches the list of input sets for this test.
 java.util.List<TestParam> fetchOutputParams()
          Fetches the test output parameters metadata from this test.
 void fetchSummary()
          Fetches the test definition summary information only from the repository for this test.
 java.util.List<java.lang.String> getAllPrereqTestIds()
          Returns the list of all the prerequisite Test IDs for this test.
 java.util.List<TestTreeNode> getChildren()
          Returns the immediate children for this test tree node.
 java.lang.String getDateFormat()
          Get the date format string that be used to encode date parameters
 java.lang.String getDescription()
          Returns the description
 java.lang.String getDisplayName()
          Returns the display name
protected  oracle.apps.fnd.appllcm.sdk.common.ResourceRef getErrorMsgOnLoadXmlErr()
          Returns an instance of the resource with the error message when there is an failure to load XML using JAXB
protected  oracle.apps.fnd.appllcm.sdk.common.ResourceRef getErrorMsgOnXmlValErr(int pLine, int pCol, java.lang.String pMsg)
          Returns an instance of the resource with the error message when there is validation error in the source XML
 java.lang.Boolean getExecuteAllowed()
           
 java.lang.String getExtnName()
          Returns the extension name of this test from the test metadata
 java.lang.String getImplName()
          Gets the implementation name for the node.
 TestParamList getInputParamList()
          Returns the list of input parameters for this test.
 TestInputSetList getInputSetList()
          Gets the input set list for this test
 java.lang.String getInputsStatus()
          Gets the inputs status code for this test.
protected  java.lang.Object getJAXBMetadataObj()
          Gets the top level JAXB object for the metadata
protected  java.lang.String getJAXBPkg()
          Gets the JAXB object package for this metadata
 java.lang.String getModuleId()
          Returns the module ID for the taxonomy module that owns the seed data for this test.
 java.lang.String getNodeDisplayName()
          Gets the display name for the node.
 java.lang.String getNodeName()
          Gets the name of the node.
 boolean getNodeSelected()
           
 TestTreeNode.NodeType getNodeType()
          Returns the type of the node i.e.
 int getObjectVersionNumber()
          Returns the current object version number
 TestParamList getOutputParamList()
          Returns the list of output parameters for this test.
 TestPrereqList getPrereqs()
          Returns the list of prerequisite tests or tag values associated with this test.
 int getPrereqTestCount()
          Gets the prerequisite test count for this test.
 java.util.List<java.lang.String> getPrereqTestIdsForIncludes()
          Returns only the list of prerequisite Test IDs for any tests that are included in this test (via nested test reference steps).
 java.lang.String getRequiresApplicationCode()
          Returns the flag indicating whether the diagnostic test will need to access code from within the fusion application.
 java.lang.String getSensitivity()
          Gets the sensitivity for the test.
protected static java.lang.String getStepDefName(TestStepType pStep)
          Returns the event handler definition name for a given event handler.
 TagValueList getTagValueList()
          Returns the list of tags values associated with this test.
 java.lang.String getTestId()
          Gets the Test ID
 java.lang.String getTestMetadata()
          Returns the test metadata XML.
 java.lang.String getTestName()
          Gets the Test Name
 java.lang.String getTestType()
          Gets the test type e.g.
protected static java.lang.String getTestTypeCode(java.lang.String pFilePath)
          Returns a test type code based on the given file's file type
 java.lang.String getUsage()
          Returns the usage
 java.lang.String getVersion()
          Returns the version of this test from the test metadata
 java.lang.Boolean getViewReportAllowed()
           
protected  java.lang.String getXmlSrcFile()
          Returns the source file for test definition metadata
 boolean hasChildren()
          Returns a flag to indicate if this node has any children
 boolean hasRequiredInputParams()
          This API checks to see if the test has any required input parameters declared in its metadata.
protected  void initializeTestExecution()
          Performs initialization of the test execution for this test.
protected  oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode makeDepNode()
          Makes a DepNode instance for this test.
protected  void performPostLoad()
          Callback hook for performing any post-load operations after loading of a XML document.
 void populate(java.lang.String pXMLMetadata)
          Populates this object based on the given Test Definition XML metadata String.
 void populateFromClass(java.lang.String pJavaClassName)
          Populates this object based on the given Test class file.
 void populateFromFile(java.lang.String pFilePath)
          Populates this object based on the given Test file.
 void populateTestAvailabilityInfo(TestAvailabilityInfo pInfo)
          Checks the steps of this test, populates test availability information and recursively gathers availability information of nested tests.
protected  void postExecute(java.lang.Throwable t)
          Performs any post execution activities such as updating status code in the step report, test exec, cleaning up the monitor thread and updating the test stats as well as updating the test run
protected  void preExecute(DiagContextExtn pContext)
          Performs all pre-execution operations
 java.util.List<TestPrereq> queryActivePrereqTests(java.lang.String pTestName)
          Queries the list of active prerequisites for the given test
 java.util.List<TagValue> queryActiveTagValues(java.lang.String pTestName)
          Queries the list of active tag values for the given test
 void removeTagValueIdReference(java.lang.String pTagValueId, boolean pAssocOnly)
          Removes the reference to the given tag value ID from this test's definition metadata.
protected  void resolvePrereqs()
          Resolves the prereq list by setting test IDs for prerequisites that only have test names
protected  void resolveTagValues()
          Resolves the tag values for this tests for which tagValueId is not yet known.
 TestExec run(DiagContextExtn pContext)
          Runs the diagnostic test for this test definition based on the information available in the context.
 void save()
          Saves the in-memory test definition in this object into the test repository.
 void saveErrorTestExec(TestRun run, NameValueList inputs, oracle.apps.fnd.appllcm.sdk.common.ResourceRef pErrMsg, java.lang.Throwable t)
          Saves a new TestExecution after logging the given exception in it.
 void setChildren(java.util.List<TestTreeNode> pChildren)
          Sets the list of child nodes for this node.
 void setDescription(java.lang.String pDescription)
          Sets the description.
 void setDisplayName(java.lang.String pDisplayName)
          Sets the test display name.
 void setExecuteAllowed(java.lang.Boolean pExecuteAllowed)
           
 void setExtnName(java.lang.String pExtnName)
          Sets the ExtnName
 void setImplName(java.lang.String pImplName)
          Sets the implementation name for this test tree node
 void setInputParamList(TestParamList p)
          Sets the input parameter list for this test definition.
 void setInputSetList(TestInputSetList inputSetList)
          Sets the input set list for this test.
 void setInputsStatus(java.lang.String inputsStatus)
          Sets the inputs status code for this test
protected  void setJAXBMetadataObj(java.lang.Object pMd)
          Sets the top level JAXB object for the metadata
protected  void setJAXBMetadataStr(java.lang.String pXMLStr)
          Sets the marshalled XML document for the metadata in String format
 void setModuleId(java.lang.String moduleId)
          Sets the module ID
 void setNodeDisplayName(java.lang.String pNodeDisplayName)
          Sets the display name for the node.
 void setNodeName(java.lang.String pName)
          Sets the name for this tree node
 void setNodeSelected(boolean nodeSelected)
          Sets whether a node as being selected in the test tree
 void setObjectVersionNumber(int pObjectVersionNumber)
          Sets the Object version number.
 void setOutputParamList(TestParamList p)
          Sets the output parameter list for this test definition.
 void setPrereqs(TestPrereqList l)
          Sets the test prerequisite list for this test definition.
 void setPrereqTestCount(int prereqTestCount)
          Sets the prerequisite test count for this test
 void setRequiresApplicationCode(java.lang.String pRequiresApplicationCode)
          Sets the requiresApplicationCode flag ("Y" or "N")
 void setSensitivity(java.lang.String pSensitivity)
          Sets the sensitvity.
 void setTagValueList(TagValueList l)
          Sets the tag value list for this test definition
 void setTestId(java.lang.String pTestId)
          Sets the test ID.
 void setTestMetadata(java.lang.String pTestMetadata)
          Sets the test metadata XML.
 void setTestName(java.lang.String pTestName)
          Sets the test name.
 void setTestType(java.lang.String pTestType)
          Sets the test type.
 void setUsage(java.lang.String pUsage)
          Sets the usage.
 void setViewReportAllowed(java.lang.Boolean pViewReportAllowed)
           
protected  void setXmlSrcFile(java.lang.String newxmlSrcFile)
          Sets the source file for test definition metadata
protected  void updateExecStatus(java.lang.Throwable t)
          Updates execution status in the test report, test execution, test run
 void validateInputValues(NameValueList pParamList)
          Validates the given list of input values for this test against the test's input parameter metadata for data type consistency.
 void validatePreRun()
          Performs validations required prior to execution of tests.
protected  void validatePreRun(TestDefList pAncestors, java.util.Hashtable<java.lang.String,TestDef> pValidated, java.util.Hashtable<java.lang.String,TestDef> pFetched, boolean checkDepCycles)
          Performs validation prior to running
 void validatePreSave()
          Performs validation on the this test definition
 
Methods inherited from class oracle.apps.fnd.appltest.diagfwk.engine.impl.DiagJAXBXMLDoc
getErrMsgOnLoadXML, getErrMsgOnValXML, load, reactToValidationEvents, saveJAXB, saveToFile, setErrMsgOnLoadXML, setErrMsgOnValXML
 
Methods inherited from class oracle.apps.fnd.appltest.diagfwk.engine.impl.DiagBObjImpl
copyCommon, getCreatedBy, getCreationDate, getLastUpdateDate, getLastUpdatedBy, getLastUpdateLogin, isCreatedByOracle, setCreatedBy, setCreationDate, setLastUpdateDate, setLastUpdatedBy, setLastUpdateLogin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.apps.fnd.appltest.diagfwk.engine.DiagBObj
getCreatedBy, getCreationDate, getLastUpdateDate, getLastUpdatedBy, getLastUpdateLogin, isCreatedByOracle, setCreatedBy, setCreationDate, setLastUpdateDate, setLastUpdatedBy, setLastUpdateLogin
 

Constructor Detail

TestDefImpl

public TestDefImpl()
Method Detail

getTestId

public java.lang.String getTestId()
Description copied from interface: TestDef
Gets the Test ID

Specified by:
getTestId in interface TestDef
Returns:
the Test ID

getTestName

public java.lang.String getTestName()
Description copied from interface: TestDef
Gets the Test Name

Specified by:
getTestName in interface TestDef
Returns:
the logical name of the test

getTestType

public java.lang.String getTestType()
Description copied from interface: TestDef
Gets the test type e.g. 'J' for single-step Java test, 'P' for single-step PLSQL test, 'C' or compound test etc.

Specified by:
getTestType in interface TestDef
Returns:
the type of the test

getSensitivity

public java.lang.String getSensitivity()
Description copied from interface: TestDef
Gets the sensitivity for the test. Sensitivity values can be 'H' for high, 'M' for medium and 'L' for low.

Specified by:
getSensitivity in interface TestDef
Returns:
the sensitivity of the test.

getTestMetadata

public java.lang.String getTestMetadata()
Description copied from interface: TestDef
Returns the test metadata XML.

Specified by:
getTestMetadata in interface TestDef
Returns:
the test metadata XML

getObjectVersionNumber

public int getObjectVersionNumber()
Description copied from interface: TestDef
Returns the current object version number

Specified by:
getObjectVersionNumber in interface TestDef
Returns:
the current object version number

getDisplayName

public java.lang.String getDisplayName()
Description copied from interface: TestDef
Returns the display name

Specified by:
getDisplayName in interface TestDef
Returns:
the display name

getDescription

public java.lang.String getDescription()
Description copied from interface: TestDef
Returns the description

Specified by:
getDescription in interface TestDef
Returns:
the description

getUsage

public java.lang.String getUsage()
Description copied from interface: TestDef
Returns the usage

Specified by:
getUsage in interface TestDef
Returns:
the usage

getRequiresApplicationCode

public java.lang.String getRequiresApplicationCode()
Description copied from interface: TestDef
Returns the flag indicating whether the diagnostic test will need to access code from within the fusion application.

Specified by:
getRequiresApplicationCode in interface TestDef
Returns:
the String value ("Y" or "N") indicating whether the diagnostic test will need to access code from within the fusion application.

setTestId

public void setTestId(java.lang.String pTestId)
Description copied from interface: TestDef
Sets the test ID.

Specified by:
setTestId in interface TestDef
Parameters:
pTestId - the test ID

setTestName

public void setTestName(java.lang.String pTestName)
Description copied from interface: TestDef
Sets the test name.

Specified by:
setTestName in interface TestDef
Parameters:
pTestName - the test name

setTestType

public void setTestType(java.lang.String pTestType)
Description copied from interface: TestDef
Sets the test type.

Specified by:
setTestType in interface TestDef
Parameters:
pTestType - the test type

setSensitivity

public void setSensitivity(java.lang.String pSensitivity)
Description copied from interface: TestDef
Sets the sensitvity.

Specified by:
setSensitivity in interface TestDef
Parameters:
pSensitivity - the sensitivity

setTestMetadata

public void setTestMetadata(java.lang.String pTestMetadata)
Description copied from interface: TestDef
Sets the test metadata XML.

Specified by:
setTestMetadata in interface TestDef
Parameters:
pTestMetadata - the test metadata XML

setObjectVersionNumber

public void setObjectVersionNumber(int pObjectVersionNumber)
Description copied from interface: TestDef
Sets the Object version number.

Specified by:
setObjectVersionNumber in interface TestDef
Parameters:
pObjectVersionNumber - the object version number

setDisplayName

public void setDisplayName(java.lang.String pDisplayName)
Description copied from interface: TestDef
Sets the test display name.

Specified by:
setDisplayName in interface TestDef
Parameters:
pDisplayName - the display name

setDescription

public void setDescription(java.lang.String pDescription)
Description copied from interface: TestDef
Sets the description.

Specified by:
setDescription in interface TestDef
Parameters:
pDescription - the description

setUsage

public void setUsage(java.lang.String pUsage)
Description copied from interface: TestDef
Sets the usage.

Specified by:
setUsage in interface TestDef
Parameters:
pUsage - the usage

setRequiresApplicationCode

public void setRequiresApplicationCode(java.lang.String pRequiresApplicationCode)
Description copied from interface: TestDef
Sets the requiresApplicationCode flag ("Y" or "N")

Specified by:
setRequiresApplicationCode in interface TestDef
Parameters:
pRequiresApplicationCode - the flag

getInputParamList

public TestParamList getInputParamList()
Description copied from interface: TestDef
Returns the list of input parameters for this test.

Specified by:
getInputParamList in interface TestDef
Returns:
the list of input parameters for this test

getOutputParamList

public TestParamList getOutputParamList()
Description copied from interface: TestDef
Returns the list of output parameters for this test.

Specified by:
getOutputParamList in interface TestDef
Returns:
the list of output parameters for this test

getTagValueList

public TagValueList getTagValueList()
Description copied from interface: TestDef
Returns the list of tags values associated with this test.

Specified by:
getTagValueList in interface TestDef
Returns:
the list of tags values associated with this test

getPrereqs

public TestPrereqList getPrereqs()
Description copied from interface: TestDef
Returns the list of prerequisite tests or tag values associated with this test.

Specified by:
getPrereqs in interface TestDef
Returns:
the list of TestPrereq objects

getExecuteAllowed

public java.lang.Boolean getExecuteAllowed()
Specified by:
getExecuteAllowed in interface TestTreeNode
Specified by:
getExecuteAllowed in interface TestDef
Returns:
whether execution of the test is allowed

setExecuteAllowed

public void setExecuteAllowed(java.lang.Boolean pExecuteAllowed)
Specified by:
setExecuteAllowed in interface TestDef
Parameters:
pExecuteAllowed - new value of whether execution is allowed

getViewReportAllowed

public java.lang.Boolean getViewReportAllowed()
Specified by:
getViewReportAllowed in interface TestTreeNode
Specified by:
getViewReportAllowed in interface TestDef
Returns:
whether viewing the report for a test's execution is allowed

setViewReportAllowed

public void setViewReportAllowed(java.lang.Boolean pViewReportAllowed)
Specified by:
setViewReportAllowed in interface TestDef
Parameters:
pViewReportAllowed - new value of whether a test's execution report can be viewed

save

public void save()
Description copied from interface: TestDef
Saves the in-memory test definition in this object into the test repository. If a test with the same name as this test already exists in the repository, that test is updated with the attributes of this test. Otherwise a new test is inserted into the repository.

Specified by:
save in interface TestDef

validatePreSave

public void validatePreSave()
                     throws DiagfwkException
Performs validation on the this test definition

Specified by:
validatePreSave in interface TestDef
Throws:
DiagfwkException - when any validation failure occurs.

populate

public void populate(java.lang.String pXMLMetadata)
Description copied from interface: TestDef
Populates this object based on the given Test Definition XML metadata String.

Specified by:
populate in interface TestDef
Parameters:
pXMLMetadata - Test Definition XML metadata

populateFromClass

public void populateFromClass(java.lang.String pJavaClassName)
Description copied from interface: TestDef
Populates this object based on the given Test class file. The Test class file must an annotated Java class file.

Specified by:
populateFromClass in interface TestDef
Parameters:
pJavaClassName - name of the Java test class.

populateFromFile

public void populateFromFile(java.lang.String pFilePath)
Description copied from interface: TestDef
Populates this object based on the given Test file. The test file must be a XML test definition file.

Specified by:
populateFromFile in interface TestDef
Parameters:
pFilePath - file path for the test file containing the test metadata definition.

getDateFormat

public java.lang.String getDateFormat()
Description copied from interface: TestDef
Get the date format string that be used to encode date parameters

Specified by:
getDateFormat in interface TestDef
Returns:
date format string

fetchInputParams

public java.util.List<TestParam> fetchInputParams()
Description copied from interface: TestDef
Fetches the test input parameters metadata from this test. Either the test ID or the test name should be set on this object prior to calling this method.

Specified by:
fetchInputParams in interface TestDef
Returns:
list of input parameters for this test.

fetchOutputParams

public java.util.List<TestParam> fetchOutputParams()
Description copied from interface: TestDef
Fetches the test output parameters metadata from this test. Either the test ID or the test name should be set on this object prior to calling this method.

Specified by:
fetchOutputParams in interface TestDef
Returns:
list of output parameters for this test.

hasRequiredInputParams

public boolean hasRequiredInputParams()
Description copied from interface: TestDef
This API checks to see if the test has any required input parameters declared in its metadata. This API will also perform a fetch in order to get the test summary if required.

Specified by:
hasRequiredInputParams in interface TestDef
Returns:
true if the test contains required input parameters. false otherwise.

fetchActiveInputParams

public java.util.List<TestParam> fetchActiveInputParams()
Description copied from interface: TestDef
Fetches the list of active input parameters for this test. Either the test ID or the test name should be set on this object prior to calling this method.

Specified by:
fetchActiveInputParams in interface TestDef
Returns:
list of active input parameters for this test

fetchActiveOutputParams

public java.util.List<TestParam> fetchActiveOutputParams()
Description copied from interface: TestDef
Fetches the list of active output parameters for this test. Either the test ID or the test name should be set on this object prior to calling this method.

Specified by:
fetchActiveOutputParams in interface TestDef
Returns:
list of active output parameters for this test

fetchSummary

public void fetchSummary()
Description copied from interface: TestDef
Fetches the test definition summary information only from the repository for this test. Either the test ID or the test name should be set on this object prior to calling this method.

Specified by:
fetchSummary in interface TestDef

fetch

public void fetch()
Description copied from interface: TestDef
Fetches the test definition from the repository for this test. Either the test ID or the test name should be set on this object prior to calling this method.

Specified by:
fetch in interface TestDef

copy

public void copy(TestDef pObj)
Description copied from interface: TestDef
Copies the contents of the given object into this object

Specified by:
copy in interface TestDef
Specified by:
copy in class DiagBObjImpl<TestDef>
Parameters:
pObj - the object to copy into this object.

copyAndPopulate

public void copyAndPopulate(TestDef pObj)
Description copied from interface: TestDef
Copies the contents of the given object into this object After copying the TestDef attribtues, the JAXB Tree is populated based on the test metadata.

Specified by:
copyAndPopulate in interface TestDef
Parameters:
pObj - object to copy into this object.

run

public TestExec run(DiagContextExtn pContext)
Description copied from interface: TestDef
Runs the diagnostic test for this test definition based on the information available in the context. If input values are not available in the context, the default values for required parameters are used.

Status updates are made to the fnd_diag_execution in the test repository periodically using a monitor thread. Additionally, for any test reference steps in this test, new child test executions are spawned.

Specified by:
run in interface TestDef
Parameters:
pContext - context for the test execution
Returns:
the current test's execution defails in the form of a TestExec object.

postExecute

protected void postExecute(java.lang.Throwable t)
Performs any post execution activities such as updating status code in the step report, test exec, cleaning up the monitor thread and updating the test stats as well as updating the test run


cleanupTestExecMonitor

protected void cleanupTestExecMonitor()
Cleans up the test execution monitor


updateExecStatus

protected void updateExecStatus(java.lang.Throwable t)
Updates execution status in the test report, test execution, test run

Parameters:
t -

preExecute

protected void preExecute(DiagContextExtn pContext)
Performs all pre-execution operations

Parameters:
pContext - context for exeuction

execute

protected void execute()
Prepares context for execution and kicks off execution of the steps in this test.


executeTest

protected void executeTest()
Starts execution of the various steps defined in this test metadata. Delegates to each step's executor class for execution of that step.


initializeTestExecution

protected void initializeTestExecution()
Performs initialization of the test execution for this test. This involves:


completeOutputParameters

protected void completeOutputParameters()
Handles: 1) defaulting un-set output parameters that have defaults 2) checking that required outputs are set


saveErrorTestExec

public void saveErrorTestExec(TestRun run,
                              NameValueList inputs,
                              oracle.apps.fnd.appllcm.sdk.common.ResourceRef pErrMsg,
                              java.lang.Throwable t)
Description copied from interface: TestDef
Saves a new TestExecution after logging the given exception in it. This API is meant to be called during worker mode execution when the run report is not accessible.

Caution: This api will overwrite any existing Test Execution in the DB.

Specified by:
saveErrorTestExec in interface TestDef
Parameters:
run - the test run to associate the execution with
inputs - the inputs provided for the test. The execution ID is picked up from this parameter as an internal input.
pErrMsg - the message for the test execution error
t - the exception that occured during execution of this test

delete

public boolean delete()
deletes the test and it's associated data from the db deletes parms, inputsets unlinks the tag values, and prereqs from this test

Specified by:
delete in interface TestDef

validatePreRun

public void validatePreRun()
Performs validations required prior to execution of tests. Validations include making sure Java step definitions are loadable and also performing validations for nested test reference steps

Specified by:
validatePreRun in interface TestDef

validatePreRun

protected void validatePreRun(TestDefList pAncestors,
                              java.util.Hashtable<java.lang.String,TestDef> pValidated,
                              java.util.Hashtable<java.lang.String,TestDef> pFetched,
                              boolean checkDepCycles)
Performs validation prior to running

Parameters:
pValidated -
pFetched -
checkDepCycles -

checkRequiredParamsHaveValues

protected void checkRequiredParamsHaveValues()
Checks that there are values specified for any required parameters.


checkRunPermission

protected void checkRunPermission()
Checks to validate that the current user has the permission to run this test.


checkStepDefsLoadable

protected void checkStepDefsLoadable()
Validates that all the step definitions in this tests are loadable. Namely validates that the Java classes references in java step defs are loadable.


populateTestAvailabilityInfo

public void populateTestAvailabilityInfo(TestAvailabilityInfo pInfo)
Description copied from interface: TestDef
Checks the steps of this test, populates test availability information and recursively gathers availability information of nested tests. Note: Validation of PLSQL procs would have to be done all-at-once by caller (TDF) for all required procs for sake of performance. Validation of PLSQL procs require access to DB.

Specified by:
populateTestAvailabilityInfo in interface TestDef
Parameters:
pInfo - pass-by-reference value object for gathering test availability information

checkNestedTestRefStepDefs

protected void checkNestedTestRefStepDefs(TestDefList pAncestors,
                                          java.util.Hashtable<java.lang.String,TestDef> pValidated,
                                          java.util.Hashtable<java.lang.String,TestDef> pFetched)
Validates the nested test references if any


setJAXBMetadataObj

protected void setJAXBMetadataObj(java.lang.Object pMd)
Sets the top level JAXB object for the metadata

Specified by:
setJAXBMetadataObj in class DiagJAXBXMLDoc<TestDef>
Parameters:
pMd - the top level JAXB object for the metadata

getJAXBMetadataObj

protected java.lang.Object getJAXBMetadataObj()
Description copied from class: DiagJAXBXMLDoc
Gets the top level JAXB object for the metadata

Specified by:
getJAXBMetadataObj in class DiagJAXBXMLDoc<TestDef>
Returns:
the top level JAXB object for the metadata

setJAXBMetadataStr

protected void setJAXBMetadataStr(java.lang.String pXMLStr)
Description copied from class: DiagJAXBXMLDoc
Sets the marshalled XML document for the metadata in String format

Specified by:
setJAXBMetadataStr in class DiagJAXBXMLDoc<TestDef>
Parameters:
pXMLStr - marshalled XML document

getJAXBPkg

protected java.lang.String getJAXBPkg()
Gets the JAXB object package for this metadata

Specified by:
getJAXBPkg in class DiagJAXBXMLDoc<TestDef>
Returns:
the JAXB package name for this metadata

getErrorMsgOnLoadXmlErr

protected oracle.apps.fnd.appllcm.sdk.common.ResourceRef getErrorMsgOnLoadXmlErr()
Returns an instance of the resource with the error message when there is an failure to load XML using JAXB

Specified by:
getErrorMsgOnLoadXmlErr in class DiagJAXBXMLDoc<TestDef>
Returns:
an instance of the resource with the error message when there is an failure to load XML using JAXB

getErrorMsgOnXmlValErr

protected oracle.apps.fnd.appllcm.sdk.common.ResourceRef getErrorMsgOnXmlValErr(int pLine,
                                                                                int pCol,
                                                                                java.lang.String pMsg)
Returns an instance of the resource with the error message when there is validation error in the source XML

Specified by:
getErrorMsgOnXmlValErr in class DiagJAXBXMLDoc<TestDef>
Parameters:
pLine - line number where the error occurred
pCol - column number where the error occurred
pMsg - validation error message
Returns:
an instance of the resource with the error message when there is validation error in the source XML

performPostLoad

protected void performPostLoad()
Description copied from class: DiagJAXBXMLDoc
Callback hook for performing any post-load operations after loading of a XML document. Such operations may include, but are not limited to, performing further validations on the document.

Specified by:
performPostLoad in class DiagJAXBXMLDoc<TestDef>

resolveTagValues

protected void resolveTagValues()
                         throws DiagfwkException
Resolves the tag values for this tests for which tagValueId is not yet known.

Throws:
DiagfwkException - when one or more unresolvable tag values exist for this test.

addTagValues

protected void addTagValues()
Adds tag values listed in the JAXB metadata


resolvePrereqs

protected void resolvePrereqs()
Resolves the prereq list by setting test IDs for prerequisites that only have test names


addPrereqs

protected void addPrereqs()
Adds prereqs listed in the JAXB metadata to the prereq list in this object


addParams

protected void addParams(java.util.List pDefList,
                         TestParamList toList)
Adds parameters from the given List of ParameterDefType objects to the TestParamList


setXmlSrcFile

protected void setXmlSrcFile(java.lang.String newxmlSrcFile)
Sets the source file for test definition metadata

Parameters:
newxmlSrcFile - source file for test definition metadata.

getXmlSrcFile

protected java.lang.String getXmlSrcFile()
Returns the source file for test definition metadata

Returns:
the source file for test definition metadata

getVersion

public java.lang.String getVersion()
Returns the version of this test from the test metadata

Specified by:
getVersion in interface TestDef

validateInputValues

public void validateInputValues(NameValueList pParamList)
                         throws DiagfwkException
Description copied from interface: TestDef
Validates the given list of input values for this test against the test's input parameter metadata for data type consistency. The definition for this test should have been fetched by calling the fetch() API prior to calling this method

Specified by:
validateInputValues in interface TestDef
Parameters:
pParamList - list of input parameter values to validate for this test.
Throws:
DiagfwkException - when an invalid value is encountered for a particular input parameter.

getStepDefName

protected static java.lang.String getStepDefName(TestStepType pStep)
Returns the event handler definition name for a given event handler.


getTestTypeCode

protected static java.lang.String getTestTypeCode(java.lang.String pFilePath)
Returns a test type code based on the given file's file type


setInputParamList

public void setInputParamList(TestParamList p)
Description copied from interface: TestDef
Sets the input parameter list for this test definition.

Specified by:
setInputParamList in interface TestDef
Parameters:
p - input parameter list for this test definition

setOutputParamList

public void setOutputParamList(TestParamList p)
Description copied from interface: TestDef
Sets the output parameter list for this test definition.

Specified by:
setOutputParamList in interface TestDef
Parameters:
p - output parameter list for this test definition

setPrereqs

public void setPrereqs(TestPrereqList l)
Description copied from interface: TestDef
Sets the test prerequisite list for this test definition.

Specified by:
setPrereqs in interface TestDef
Parameters:
l - test prerequisite list for this test definition

setTagValueList

public void setTagValueList(TagValueList l)
Description copied from interface: TestDef
Sets the tag value list for this test definition

Specified by:
setTagValueList in interface TestDef
Parameters:
l - tag value list for this test definition

checkDependencyCycles

protected void checkDependencyCycles()
Checks for cyclic dependency that this test's relations could cause based on the specified ancestors. The relations checked for are:


checkDependencyCycles

protected void checkDependencyCycles(java.util.List<oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode> pAncestorTests,
                                     java.util.List<oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode> pAncestorTagValues,
                                     java.util.Hashtable<java.lang.String,TestDef> pFetched,
                                     java.util.Hashtable<java.lang.String,oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode> pCheckedNodes)
Checks for cyclic dependency that this test's relations could cause based on the specified ancestors. The relations checked for are:

Parameters:
pAncestorTests - - Sequential list of ancestors of this test.
pAncestorTagValues - - list of ancestor tag values
pFetched - - a cache of TestDef objects for which we've already fetched definitions from the repository.
pCheckedNodes - - a cache of DepNodes that we've already checked.

getAllPrereqTestIds

public java.util.List<java.lang.String> getAllPrereqTestIds()
Description copied from interface: TestDef
Returns the list of all the prerequisite Test IDs for this test. The list of prerequisite test IDs is a comprehensive list and includes prerequisites of any tests nested in this test as well.

Specified by:
getAllPrereqTestIds in interface TestDef
Returns:
the list of all the prerequisite tests.

getPrereqTestIdsForIncludes

public java.util.List<java.lang.String> getPrereqTestIdsForIncludes()
Description copied from interface: TestDef
Returns only the list of prerequisite Test IDs for any tests that are included in this test (via nested test reference steps). If this test does not contain any included tests, the method returns an empty list.

Specified by:
getPrereqTestIdsForIncludes in interface TestDef
Returns:
the list of prerequisite Test IDs for any tests that are included in this test (via nested test reference steps).

makeDepNode

protected oracle.apps.fnd.appltest.diagfwk.engine.impl.TestDefImpl.DepNode makeDepNode()
Makes a DepNode instance for this test. The relation type is left null.

Returns:
a DepNode instance

copyT

public void copyT(java.lang.Object pObj)
Description copied from interface: DiagBObj
Copies the contents of the given object into this object

Specified by:
copyT in interface DiagBObj<TestDef>
Parameters:
pObj - the contents of the given object into this object

setPrereqTestCount

public void setPrereqTestCount(int prereqTestCount)
Description copied from interface: TestDef
Sets the prerequisite test count for this test

Specified by:
setPrereqTestCount in interface TestDef
Parameters:
prereqTestCount - the prerequisite test count for this test.

getPrereqTestCount

public int getPrereqTestCount()
Description copied from interface: TestDef
Gets the prerequisite test count for this test. This is the count of the number of test prerequisites for this test. Only immediate prerequisite tests associated with the current test are considered.

0 - No Prerequisites directly associated with this test
n - Has one or more prerequisites defined (where n is a number greater than 0)

Specified by:
getPrereqTestCount in interface TestTreeNode
Specified by:
getPrereqTestCount in interface TestDef
Returns:
the immediate prerequisite test count for this test.
See Also:
TestDef.getPrereqTestCount()

setInputsStatus

public void setInputsStatus(java.lang.String inputsStatus)
Description copied from interface: TestDef
Sets the inputs status code for this test

Specified by:
setInputsStatus in interface TestDef
Parameters:
inputsStatus - the inputs status code for this test.

getInputsStatus

public java.lang.String getInputsStatus()
Description copied from interface: TestDef
Gets the inputs status code for this test.

The status code describes the state of whether or not the current test has required inputs. Possible values are:

Specified by:
getInputsStatus in interface TestTreeNode
Specified by:
getInputsStatus in interface TestDef
Returns:
the inputs status code for this test.
See Also:
TestDef.getInputsStatus()

getNodeName

public java.lang.String getNodeName()
Description copied from interface: TestTreeNode
Gets the name of the node. This is either the test name (for a top level test) or the step name for child nodes.

Specified by:
getNodeName in interface TestTreeNode
Returns:
the name of the node.

getImplName

public java.lang.String getImplName()
Description copied from interface: TestTreeNode
Gets the implementation name for the node. This is either the name of the test (if the step is a test reference) or a Java class name (if the step is a Java test step).

Specified by:
getImplName in interface TestTreeNode
Returns:
the name of the implementation of the node.

hasChildren

public boolean hasChildren()
Description copied from interface: DiagTreeNode
Returns a flag to indicate if this node has any children

Specified by:
hasChildren in interface DiagTreeNode
Returns:
true if the node has children. returns false otherwise.

getChildren

public java.util.List<TestTreeNode> getChildren()
Description copied from interface: TestTreeNode
Returns the immediate children for this test tree node. Use this API to traverse the tree for a particular test.

Note: this API will perform a query in order to fetch the children (if not already available).

Specified by:
getChildren in interface TestTreeNode
Returns:
the immediate children for this node.

setNodeName

public void setNodeName(java.lang.String pName)
Description copied from interface: TestTreeNode
Sets the name for this tree node

Specified by:
setNodeName in interface TestTreeNode
Parameters:
pName - the name for this tree node

setImplName

public void setImplName(java.lang.String pImplName)
Description copied from interface: TestTreeNode
Sets the implementation name for this test tree node

Specified by:
setImplName in interface TestTreeNode
Parameters:
pImplName - the implementation name for this test tree node.

setChildren

public void setChildren(java.util.List<TestTreeNode> pChildren)
Description copied from interface: TestTreeNode
Sets the list of child nodes for this node.

Specified by:
setChildren in interface TestTreeNode
Parameters:
pChildren - list of child nodes for this node.

queryActivePrereqTests

public java.util.List<TestPrereq> queryActivePrereqTests(java.lang.String pTestName)
Description copied from interface: TestDef
Queries the list of active prerequisites for the given test

Specified by:
queryActivePrereqTests in interface TestDef
Parameters:
pTestName - name of the test
Returns:
the list of active prerequisites for the test

queryActiveTagValues

public java.util.List<TagValue> queryActiveTagValues(java.lang.String pTestName)
Description copied from interface: TestDef
Queries the list of active tag values for the given test

Specified by:
queryActiveTagValues in interface TestDef
Parameters:
pTestName - name of the test
Returns:
list of active tag values

getNodeDisplayName

public java.lang.String getNodeDisplayName()
Description copied from interface: TestTreeNode
Gets the display name for the node. This is the test display name (for top level tests). For step nodes, this just returns the step name.

Specified by:
getNodeDisplayName in interface TestTreeNode
Returns:
the display name for the node

setNodeDisplayName

public void setNodeDisplayName(java.lang.String pNodeDisplayName)
Description copied from interface: TestTreeNode
Sets the display name for the node. This is the test display name (for top level tests). For step nodes, this just returns the step name.

Specified by:
setNodeDisplayName in interface TestTreeNode
Parameters:
pNodeDisplayName - the display name for the node

getNodeType

public TestTreeNode.NodeType getNodeType()
Description copied from interface: TestTreeNode
Returns the type of the node i.e. whether the node is either a test or a step

Specified by:
getNodeType in interface TestTreeNode
Returns:
type of the node i.e. whether the node is either a test or a step.

getNodeSelected

public boolean getNodeSelected()
Specified by:
getNodeSelected in interface TestTreeNode
Returns:
whether a node is selected in the test tree

setNodeSelected

public void setNodeSelected(boolean nodeSelected)
Description copied from interface: TestTreeNode
Sets whether a node as being selected in the test tree

Specified by:
setNodeSelected in interface TestTreeNode

setInputSetList

public void setInputSetList(TestInputSetList inputSetList)
Description copied from interface: TestDef
Sets the input set list for this test.

Specified by:
setInputSetList in interface TestDef
Parameters:
inputSetList - the input set list for this test

getInputSetList

public TestInputSetList getInputSetList()
Description copied from interface: TestDef
Gets the input set list for this test

Specified by:
getInputSetList in interface TestDef
Returns:
the list of input sets for this test.

fetchDefaultInputSetList

public TestInputSetList fetchDefaultInputSetList()
Description copied from interface: TestDef
Fetches the list of default input sets for this test

Specified by:
fetchDefaultInputSetList in interface TestDef
Returns:
the list of default input sets for this test

fetchInputSetList

public TestInputSetList fetchInputSetList()
Description copied from interface: TestDef
Fetches the list of input sets for this test.

Specified by:
fetchInputSetList in interface TestDef
Returns:
the list of input sets for this test

asTestTreeNode

public TestTreeNode asTestTreeNode()
Description copied from interface: TestDef
Returns this test definition object as a TestTreeNode instance

Specified by:
asTestTreeNode in interface TestDef
Returns:
this test definition object as a TestTreeNode instance

setModuleId

public void setModuleId(java.lang.String moduleId)
Description copied from interface: TestDef
Sets the module ID

Specified by:
setModuleId in interface TestDef
Parameters:
moduleId - the module ID

getModuleId

public java.lang.String getModuleId()
Description copied from interface: TestDef
Returns the module ID for the taxonomy module that owns the seed data for this test.

Specified by:
getModuleId in interface TestDef
Returns:
the modele ID for the taxonomy module that owns the seed data for this test.

removeTagValueIdReference

public void removeTagValueIdReference(java.lang.String pTagValueId,
                                      boolean pAssocOnly)
Description copied from interface: TestDef
Removes the reference to the given tag value ID from this test's definition metadata. References are removed from tag value list as well as prereq list (based on value of pAssocOnly flag - see below)

Removal is performed in the test definition in memory only (i.e. in this object only). The updated definition in memory is not saved to the test repository.

Specified by:
removeTagValueIdReference in interface TestDef
Parameters:
pTagValueId - - tag value ID to remove reference of from this test's metadata.
pAssocOnly - - if true removes only the associations in tag value list. Otherwise removes the entries from prereq list as well.

setExtnName

public void setExtnName(java.lang.String pExtnName)
Description copied from interface: TestDef
Sets the ExtnName

Specified by:
setExtnName in interface TestDef
Parameters:
pExtnName - the extension name

getExtnName

public java.lang.String getExtnName()
Description copied from interface: TestDef
Returns the extension name of this test from the test metadata

Specified by:
getExtnName in interface TestDef
Returns:
the extension name for this test.

Oracle Fusion Middleware extensions for Logging and Diagnostics
11g Release 1 (11.1.2)

E22565-02

Copyright © 2011 Oracle. All Rights Reserved.