Oracle Fusion Middleware extensions for Logging and Diagnostic
11g Release 1 (11.1.1.6)

E22565-06

oracle.apps.fnd.appltest.diagfwk.engine.facade
Class TestDefFacade

java.lang.Object
  extended by oracle.apps.fnd.appltest.diagfwk.engine.facade.TestDefFacade
Direct Known Subclasses:
DiagnosticsTestFramework

public class TestDefFacade
extends java.lang.Object

This class represents an internal facade bean for diagnostic test definition related activites. It exposes various APIs that can be used by clients such as the ADF UI to generate data controls from and bind with the user interface.

This class is intended for internal use. To programmatically run diagnostics tests using Application Diagnostics Framework, call DiagnosticsTestFramework instead.

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/facade/TestDefFacade.java /main/20 2009/08/28 16:11:41 lwong Exp $
Author:
ppradhan

Constructor Summary
TestDefFacade()
           
 
Method Summary
 void addTagToTests(java.lang.String pTagName, java.lang.String pTagValue, java.util.List<java.lang.String> pTestNames)
          This API assigns the given tag name and tag value to the given list of tests.
static java.lang.String computeInputsStatus(TestParamList pInputParams, java.util.Map<java.lang.String,java.lang.Object> pInputValues)
          Computes the inputs status for the given list of input parameters based on the metadata about the parameters along any values provided for those parameters.
 java.util.Map<java.lang.String,java.lang.String> executeTestsForRun(java.lang.String pRunId, java.util.List<java.lang.String> pTestNames, java.util.Map<java.lang.String,NameValueList> pParameters, NameValueList pUserContext, java.util.Map<java.lang.String,java.lang.String> pRunParams)
          This API is mainly for the purpose of the diagnostics executor mbean to call.
 java.util.Map<java.lang.String,TestAvailabilityInfo> getTestAvailabilityInfo(java.util.List<java.lang.String> pTestNames)
          Get availability information of test passed.
 java.util.List<java.lang.String> getWebApplicationsAvailableForTest()
          Returns the list of Web Applications that are available on which Diagnostic Tests that execute Applications code can be run.
 boolean hasRequiredInputParams(java.lang.String pTestName)
          Checks to see if the given test has one or more required input parameters.
 java.util.List<TestTreeNode> prepareTreeNodes(java.lang.String[] pTestNames)
          Given a list of test names that the user may have selected to run, returns a corresponding list of TestTreeNode objects in preparation to run the tests.
 java.util.List<TestParam> queryInputOutputParams(java.lang.String pTestName)
           
 java.util.List<TestParam> queryInputParams(java.lang.String pTestName)
          Queries the list of input parameters for a test with the given name.
 java.util.List<TestInputSet> queryInputSets(java.lang.String pTestName)
          Fetches the list of input sets available in the test repository for the given test name
 java.util.List<TestPrereq> queryPrereqTests(java.lang.String pTestName)
          Queries the list of immediate prerequisites for a test with the given name.
 TestDef querySummary(java.lang.String pTestName)
          Queries the summary attributes for a diagnostic test given the test name such as display name, description, usage, sensitivity etc.
 java.util.List<TagValue> queryTagValues(java.lang.String pTestName)
          Queries the list of tag values for the given test name.
 java.util.List<TestDef> registerXMLTests(java.util.List<java.lang.String> pXMLFilePaths)
          This API registers the given list of XML test files into the Diagnostics Repository in the Applications Database.
 void removeTagFromTests(java.lang.String pTagName, java.lang.String pTagValue, java.util.List<java.lang.String> pTestNames)
          This API de-associates the given set of tests from the given tag name value pair.
protected  TestRun runTests(java.lang.String[] pTestNames, java.lang.String[] products, java.lang.String[] moduleIds, java.lang.String[] moduleKeys, java.lang.String[] tagNames, java.lang.String[] tagValues, java.lang.String pRunName, java.lang.Boolean pPrereqs, java.lang.Integer pNumThreads, java.lang.Integer pMonInterval, java.lang.String pExecMode, java.util.Map<java.lang.String,NameValueList> pInputs, java.lang.Boolean pWaitForCompletion, java.lang.Boolean pRunLocally, java.lang.Boolean recurse)
          Runs one or more tests with the given names and using the settings provided.
 TestRun runTests(java.lang.String[] pTestNames, java.lang.String pRunName, boolean pPrereqs, int pNumThreads, int pMonInterval, java.lang.String pExecMode, java.util.Map<java.lang.String,NameValueList> pInputs)
          Runs one or more tests with the given names and using the settings provided.
 TestRun runTests(java.lang.String pTagName, java.lang.String pTagValue, java.lang.String pRunName, boolean pPrereqs, int pNumThreads, int pMonInterval, java.lang.String pExecMode, boolean pWaitForCompletion)
          Runs the tests for the given tag name and tag value.
 TestRun runTests(java.lang.String pTagName, java.lang.String pTagValue, java.lang.String pRunName, boolean pPrereqs, int pNumThreads, int pMonInterval, java.lang.String pExecMode, boolean pWaitForCompletion, boolean pRunLocally)
          Runs the tests for the given tag name and tag value.
 boolean unRegisterTests(java.util.List<java.lang.String> pTestNames)
          This API unregisters (removes) a set of tests and their associated data
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestDefFacade

public TestDefFacade()
Method Detail

querySummary

public TestDef querySummary(java.lang.String pTestName)
Queries the summary attributes for a diagnostic test given the test name such as display name, description, usage, sensitivity etc.

Other details such as list of input parameters, tags, taxonomy modules are not fetched.

Parameters:
pTestName - name of the test to query summary for.
Returns:
an instance of TestDef for the given test name with only the summary attributes populated.

queryInputParams

public java.util.List<TestParam> queryInputParams(java.lang.String pTestName)
Queries the list of input parameters for a test with the given name.

Parameters:
pTestName - name of the diagnostic test for which to fetch the list of input parameters.
Returns:
the list of input parameters for the test.

queryInputOutputParams

public java.util.List<TestParam> queryInputOutputParams(java.lang.String pTestName)

queryPrereqTests

public java.util.List<TestPrereq> queryPrereqTests(java.lang.String pTestName)
Queries the list of immediate prerequisites for a test with the given name.

Note: this API fetches only the list of immediate prerequisite and not the full hierarchical list of prerequisites. Also this API only returns prerequisites that are of test type (i.e. not tags)

Parameters:
pTestName -
Returns:
of test prerequisites for the given test name

queryTagValues

public java.util.List<TagValue> queryTagValues(java.lang.String pTestName)
Queries the list of tag values for the given test name.

Parameters:
pTestName - name of the test for which to query the list of tag values
Returns:
of tag values for the given test name

runTests

public TestRun runTests(java.lang.String[] pTestNames,
                        java.lang.String pRunName,
                        boolean pPrereqs,
                        int pNumThreads,
                        int pMonInterval,
                        java.lang.String pExecMode,
                        java.util.Map<java.lang.String,NameValueList> pInputs)
Runs one or more tests with the given names and using the settings provided. The test run is spawned asynchronously in a separate thread and only a run GUID is returned for monitoring purposes.

Parameters:
pTestNames - names of the tests to run
pRunName - name of the run. If null, a default run name is generated.
pPrereqs - flag to indicate whether or not the prerequisite tests for the given tests should also be run. If true, prerequsites are also run. If false, the prerequisites are skipped.
pNumThreads - the number of parallel threads to spawn in order to process the test execution. Default value is used if < 0.
pMonInterval - the monitoring interval (in seconds) for uploading the status and report information for currently executing tests. Default value is used if < 0.
pExecMode - constant indicating the type of the client that is invoking the run. For UI, use DiagConstants.EXEC_MODE_UI If null, uses the default of EXEC_MODE_UI
pInputs - a table of input name value pairs keyed by test name. If a particular test does not require inputs then it is not necessary to specify an entry in this table for that test. If there are no inputs available, you can pass in null
Returns:
the TestRun object that contains the Run GUID and Run name. Note that the test run instance may not have the latest status, and execution details populated since the run could still be in progress.

executeTestsForRun

public java.util.Map<java.lang.String,java.lang.String> executeTestsForRun(java.lang.String pRunId,
                                                                           java.util.List<java.lang.String> pTestNames,
                                                                           java.util.Map<java.lang.String,NameValueList> pParameters,
                                                                           NameValueList pUserContext,
                                                                           java.util.Map<java.lang.String,java.lang.String> pRunParams)
This API is mainly for the purpose of the diagnostics executor mbean to call. The tests are executed asynchronously and only the execution IDs are returned by the API for tracking purpose. Also the tests are added execution to an already in-progress test run.

Parameters:
pRunId - run ID for the test run for which the tests are to be executed.
pTestNames - names of the tests to be executed.
pParameters - parameters for the tests keyed by test name
pUserContext - any user context to be used when initializing a user session when the tests are to be executed.
pRunParams - run parameters to be used in worker mode
Returns:
a map of test names to the corresponding execution id.

runTests

public TestRun runTests(java.lang.String pTagName,
                        java.lang.String pTagValue,
                        java.lang.String pRunName,
                        boolean pPrereqs,
                        int pNumThreads,
                        int pMonInterval,
                        java.lang.String pExecMode,
                        boolean pWaitForCompletion)
Runs the tests for the given tag name and tag value. If pWaitForCompletion is true, then the test run is spawned asynchronously in a separate thread and only a run GUID is returned for monitoring purposes.

Parameters:
pTagName - name of the tag e.g. ERRCODE
pTagValue - tag value for which to run the test.e.g. FND-1234
pRunName - name of the run. If null, a default run name is generated.
pPrereqs - flag to indicate whether or not the prerequisite tests for the given tests should also be run. If true, prerequsites are also run. If false, the prerequisites are skipped.
pNumThreads - the number of parallel threads to spawn in order to process the test execution. Default value is used if < 0.
pMonInterval - the monitoring interval (in seconds) for uploading the status and report information for currently executing tests. Default value is used if < 0.
pExecMode - constant indicating the type of the client that is invoking the run. For UI, use DiagConstants.EXEC_MODE_UI If null, uses the default of EXEC_MODE_UI
pWaitForCompletion - A flag to indicate whether the engine should return to caller immediately with a run GUID or wait until the completion of the run.
Returns:
the TestRun object that contains the Run GUID and Run name. Note that the test run instance may not have the latest status, and execution details populated since the run could still be in progress.

runTests

public TestRun runTests(java.lang.String pTagName,
                        java.lang.String pTagValue,
                        java.lang.String pRunName,
                        boolean pPrereqs,
                        int pNumThreads,
                        int pMonInterval,
                        java.lang.String pExecMode,
                        boolean pWaitForCompletion,
                        boolean pRunLocally)
Runs the tests for the given tag name and tag value. If pWaitForCompletion is true, then the test run is spawned asynchronously in a separate thread and only a run GUID is returned for monitoring purposes.

Use this method by passing true for the pRunLocally parameter to instruct the engine to not handle Diagnostic Tests that require application code in a special manner.

Typically this method will be called by the ODF Diagnostic Dump when Diagnostic Tests need to be run at the time of incident creation.

Since the dump will already be in the context of the Application, no special logic is required to run Diagnostic Tests that require Application code.

Parameters:
pTagName - name of the tag e.g. ERRCODE
pTagValue - tag value for which to run the test.e.g. FND-1234
pRunName - name of the run. If null, a default run name is generated.
pPrereqs - flag to indicate whether or not the prerequisite tests for the given tests should also be run. If true, prerequsites are also run. If false, the prerequisites are skipped.
pNumThreads - the number of parallel threads to spawn in order to process the test execution. Default value is used if < 0.
pMonInterval - the monitoring interval (in seconds) for uploading the status and report information for currently executing tests. Default value is used if < 0.
pExecMode - constant indicating the type of the client that is invoking the run. For UI, use DiagConstants.EXEC_MODE_UI If null, uses the default of EXEC_MODE_UI
pWaitForCompletion - A flag to indicate whether the engine should return to caller immediately with a run GUID or wait until the completion of the run.
pRunLocally - A flag to indicate whether tests should be run locally without a worker
Returns:
the TestRun object that contains the Run GUID and Run name. Note that the test run instance may not have the latest status, and execution details populated since the run could still be in progress.

runTests

protected TestRun runTests(java.lang.String[] pTestNames,
                           java.lang.String[] products,
                           java.lang.String[] moduleIds,
                           java.lang.String[] moduleKeys,
                           java.lang.String[] tagNames,
                           java.lang.String[] tagValues,
                           java.lang.String pRunName,
                           java.lang.Boolean pPrereqs,
                           java.lang.Integer pNumThreads,
                           java.lang.Integer pMonInterval,
                           java.lang.String pExecMode,
                           java.util.Map<java.lang.String,NameValueList> pInputs,
                           java.lang.Boolean pWaitForCompletion,
                           java.lang.Boolean pRunLocally,
                           java.lang.Boolean recurse)
Runs one or more tests with the given names and using the settings provided. The test run is spawned asynchronously in a separate thread and only a run GUID is returned for monitoring purposes.

Parameters:
pTestNames - names of the tests to run
products - names of the product whose tests to run
moduleIds - ids of the module whose tests to run
moduleKeys - keys of the module whose tests to run
tagNames - tag names for which to run tests
tagValues - tag values for which to run tests
pRunName - name of the run. If null, a default run name is generated.
pPrereqs - flag to indicate whether or not the prerequisite tests for the given tests should also be run. If true, prerequsites are also run. If false, the prerequisites are skipped. If null, defaults to false.
pNumThreads - the number of parallel threads to spawn in order to process the test execution. Default value is used if < 0.
pMonInterval - the monitoring interval (in seconds) for uploading the status and report information for currently executing tests. Default value is used if < 0.
pExecMode - constant indicating the type of the client that is invoking the run. For UI, use DiagConstants.EXEC_MODE_UI If null, uses the default of EXEC_MODE_UI
pInputs - a table of input name value pairs keyed by test name. If a particular test does not require inputs then it is not necessary to specify an entry in this table for that test. If there are no inputs available, you can pass in null
pWaitForCompletion - A flag to indicate whether the engine should return to caller immediately with a run GUID or wait until the completion of the run. If null, defaults to false.
pRunLocally - A flag to indicate whether tests should be run locally without a worker. If null, defaults to false.
recurse - A flag to incidate whether to run all tests associated with the specified taxonomy modules and/or diagnostic tags. If false, runs only the tests immediately associated with the specified taxonomy modules and/or diagnostic tags. If null, defaults to true.
Returns:
the TestRun object that contains the Run GUID and Run name. Note that the test run instance may not have the latest status, and execution details populated since the run could still be in progress.

prepareTreeNodes

public java.util.List<TestTreeNode> prepareTreeNodes(java.lang.String[] pTestNames)
Given a list of test names that the user may have selected to run, returns a corresponding list of TestTreeNode objects in preparation to run the tests.

Parameters:
pTestNames - names of the tests that need to converted to tree nodes.
Returns:
a list of tree nodes corresponding to the given list of test names.

hasRequiredInputParams

public boolean hasRequiredInputParams(java.lang.String pTestName)
Checks to see if the given test has one or more required input parameters.

Parameters:
pTestName - name of the diagnostic test for which to fetch perform the check.
Returns:
true if the test has required input parameters. false otherwise.

queryInputSets

public java.util.List<TestInputSet> queryInputSets(java.lang.String pTestName)
Fetches the list of input sets available in the test repository for the given test name

Parameters:
pTestName -
Returns:
test input sets

computeInputsStatus

public static java.lang.String computeInputsStatus(TestParamList pInputParams,
                                                   java.util.Map<java.lang.String,java.lang.Object> pInputValues)
Computes the inputs status for the given list of input parameters based on the metadata about the parameters along any values provided for those parameters.

Parameters:
pInputParams - List of TestParam instances that generally represents the metadata for input parameters for a test.
pInputValues - any values available for each of the input parameters (keyed by the parameter name). If no parameter values are available, this can be null.
Returns:
One of the following status codes based on whether or not a value exists for required parameters in the given list:

registerXMLTests

public java.util.List<TestDef> registerXMLTests(java.util.List<java.lang.String> pXMLFilePaths)
                                         throws DiagfwkException
This API registers the given list of XML test files into the Diagnostics Repository in the Applications Database. After the registration is complete a list of TestDef object instances are returned. These objects contain the metadata about the tests and could be used when displaying a success message to the end-user in the UI.

Parameters:
pXMLFilePaths - - List of filepaths for the XML test files.
Returns:
a list of TestDef object instances correspodning to the registered tests are returned.
Throws:
DiagfwkException - when there is any unexpected errors during the registration process.

addTagToTests

public void addTagToTests(java.lang.String pTagName,
                          java.lang.String pTagValue,
                          java.util.List<java.lang.String> pTestNames)
                   throws DiagfwkException
This API assigns the given tag name and tag value to the given list of tests. The given tag and tag value entities should already exist in the diagnostics repository for the assignment to be successful.

Parameters:
pTagName - - name of the tag e.g. "ERRCODE"
pTagValue - - value of the tag e.g. "ORA-1234"
pTestNames - - a list of fully qualified test names that should be assigned this tag name value.
Throws:
DiagfwkException - when any error occurs during the assignment.

removeTagFromTests

public void removeTagFromTests(java.lang.String pTagName,
                               java.lang.String pTagValue,
                               java.util.List<java.lang.String> pTestNames)
                        throws DiagfwkException
This API de-associates the given set of tests from the given tag name value pair.

Parameters:
pTagName - Name of the tag
pTagValue - Value of the tag
pTestNames - list of fully qualified test names that should be de-associated for the given tag name value pair.
Throws:
DiagfwkException

getTestAvailabilityInfo

public java.util.Map<java.lang.String,TestAvailabilityInfo> getTestAvailabilityInfo(java.util.List<java.lang.String> pTestNames)
Get availability information of test passed.

Parameters:
pTestNames - tests to get availability
Returns:
a value object encompassing the availability information

unRegisterTests

public boolean unRegisterTests(java.util.List<java.lang.String> pTestNames)
This API unregisters (removes) a set of tests and their associated data

Parameters:
pTestNames - list of fully qualified test names
Throws:
DiagfwkException

getWebApplicationsAvailableForTest

public java.util.List<java.lang.String> getWebApplicationsAvailableForTest()
Returns the list of Web Applications that are available on which Diagnostic Tests that execute Applications code can be run. This would typically be the list of web applications that are running on the current server.

Returns:
list of web application names that are running on the server
Throws:
DiagfwkException - if error occurs

Oracle Fusion Middleware extensions for Logging and Diagnostic
11g Release 1 (11.1.1.6)

E22565-06

Copyright © 2012 Oracle. All Rights Reserved.