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

E22565-02

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

java.lang.Object
  extended by oracle.apps.fnd.appltest.diagfwk.engine.facade.TestRunFacade
All Implemented Interfaces:
DiagConstants

public class TestRunFacade
extends java.lang.Object
implements DiagConstants

This class represents an internal facade bean for diagnostic test run 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 query the status of diagnostics test runs 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/TestRunFacade.java /main/18 2010/02/04 15:32:31 lxiao 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
 
Field Summary
 
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
 
Constructor Summary
TestRunFacade()
           
 
Method Summary
 void addRunToIncident(java.lang.String pRunId, java.lang.String pIncidentId, java.lang.String pServerName, java.lang.String pAdrHome)
          Adds the run report and all the execution reports for the given run to the particular incident specified by the given incident ID and on the given server.
 boolean canAccessADRInfo()
          Returns true if the ADR information such as list of incidents and list of problems can be accessed through domain server mbeans by checking if appropriate credentials are set in CSF.
 void cancelRun(java.lang.String pRunId)
          Cancels a run with the given run ID
 boolean checkDone(java.lang.String pRunId)
          checks whether a run is completed returns true if the test run is completed, otherwise false
 void deleteRun(java.lang.String pRunId)
          Deletes a single test run with the given Run ID from the Diagnostics Repository.
 void deleteRuns(java.util.List<TestRunTreeNode> pRuns)
          Deletes a list of runs from the Diagnostics Repository.
 void deleteRuns(java.util.List<TestRunTreeNode> pRuns, boolean pIgnoreInProgress)
          Deletes a list of runs from the Diagnostics Repository.
 void deleteRuns(java.lang.String[] pStatusCodes, java.lang.String pRunByUser, java.util.Date pFromDate, java.util.Date pToDate, java.lang.String pRunName)
          Deletes the Runs that match the given criteria.
 java.lang.String extractReportToFile(java.lang.String pId, TestRunTreeNode.NodeType pType, java.lang.String pFormat, java.lang.String pDestDir, java.lang.Boolean pGetChildren, java.lang.Boolean pTranslate, TestRun.ExecReportLinkProvider pProvider)
          Extracts report for the given run or execution to a file and returns the full path to the file.
 DiagCmdExtractReport.ReportWrapper extractRunReportToFile(java.lang.String pRunGuid, java.lang.String pDestDir)
          Extracts all report files for the given run GUID to the given destination directory.
 DiagCmdExtractReport.ReportWrapper extractRunReportToFile(java.lang.String pRunGuid, java.lang.String pDestDir, java.lang.Boolean pMakeSubDir)
          Extracts all report files for the given run GUID to the given destination directory.
 int getQueryRunsMaxLimit()
          Returns the maximum limit on the number of rows returned by the query runs API.
 TestRun getTestRunById(java.lang.String runId)
          Retrieve the test run given the run id.
 TestRun getTestRunByName(java.lang.String runName)
          Retrieve the test run given the run name.
 java.util.List<ADRHome> listAllADRHomes()
          This API lists all the ADR homes that exist within the current domain
 java.util.List<Incident> listAllIncidents(Problem pProblem)
          Lists all the incidents for the given problem within this applications system
 java.util.List<Problem> listAllProblems(ADRHome adrHome)
          Lists all problems within this applications system
 java.util.List<TestRunTreeNode> queryRuns(java.lang.Long pTimeInterval)
          Returns a list of test runs (in the form of TestRunTreeNodes) that were started within given time interval (e.g.
 java.util.List<TestRunTreeNode> queryRuns(java.lang.String pStatusCode)
          Returns a list of test runs (in the form of TestRunTreeNodes) that are filter with the given status code.
 java.util.List<TestRunTreeNode> queryRuns(java.lang.String[] pStatusCodes, java.lang.Long pTimeInterval, java.lang.String pRunByUser)
          Queries test runs based on the given criteria.
 java.util.List<TestRunTreeNode> queryRuns(java.lang.String[] pStatusCodes, java.lang.Long pTimeInterval, java.lang.String pRunByUser, java.util.Date pFromDate, java.util.Date pToDate, java.lang.String pRunName, java.lang.String pTestDisplayName)
          Queries test runs based on the given criteria.
 java.util.List<TestRunTreeNode> queryRuns(java.lang.String[] pStatusCodes, java.lang.String pRunByUser, java.util.Date pFromDate, java.util.Date pToDate, java.lang.String pRunName, java.lang.String pTestDisplayName)
          Queries test runs based on the given criteria.
 java.util.List<TestRunTreeNode> queryRuns(java.lang.String pStatusCode, java.lang.Long pTimeInterval)
          Returns a list of test runs that are filtered with the given status code and time interval.
 TestRunList queryRunsList(java.lang.String[] pStatusCodes, java.lang.Long pTimeInterval, java.lang.String pRunByUser, java.util.Date pFromDate, java.util.Date pToDate, java.lang.String pRunName, java.lang.String pTestDisplayName)
          Queries test runs based on the given criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestRunFacade

public TestRunFacade()
Method Detail

extractReportToFile

public java.lang.String extractReportToFile(java.lang.String pId,
                                            TestRunTreeNode.NodeType pType,
                                            java.lang.String pFormat,
                                            java.lang.String pDestDir,
                                            java.lang.Boolean pGetChildren,
                                            java.lang.Boolean pTranslate,
                                            TestRun.ExecReportLinkProvider pProvider)
Extracts report for the given run or execution to a file and returns the full path to the file.

Parameters:
pId - Run or Execution ID.
pType - Either RUN or EXEC
pFormat - Either HTML or XML. If null, defaults to HTML.
pDestDir - Destination directory where the report should be extracted to. If null, report extracted under default directory.
pGetChildren - Flag to indicate whether or not child reports should also be extracted. If null, will default to false.
pTranslate - Flag to indicate whether or not the report should be translated. If null, will default to true.
pProvider - Execution reports link provider. Applicable only for run reports and can be null if no embedded links to execution reports are desired.
Returns:
full path to the report file.

extractRunReportToFile

public DiagCmdExtractReport.ReportWrapper extractRunReportToFile(java.lang.String pRunGuid,
                                                                 java.lang.String pDestDir)
Extracts all report files for the given run GUID to the given destination directory. The extracted reports are in HTML format and translated.

Parameters:
pRunGuid - GUID for the test run for which to extract the report
pDestDir - the destination directory to which to extract the report files
Returns:
a wrapper object that encapsulates the file paths to where the files were written.

extractRunReportToFile

public DiagCmdExtractReport.ReportWrapper extractRunReportToFile(java.lang.String pRunGuid,
                                                                 java.lang.String pDestDir,
                                                                 java.lang.Boolean pMakeSubDir)
Extracts all report files for the given run GUID to the given destination directory. The extracted reports are in HTML format and translated.

Parameters:
pRunGuid - GUID for the test run for which to extract the report
pDestDir - the destination directory to which to extract the report files
pMakeSubDir - if true, creates a sub-directory under the destination directory where the report files are to be extracted.
Returns:
a wrapper object that encapsulates the file paths to where the files were written.

cancelRun

public void cancelRun(java.lang.String pRunId)
Cancels a run with the given run ID

Parameters:
pRunId - run ID for the test run to cancel

checkDone

public boolean checkDone(java.lang.String pRunId)
checks whether a run is completed returns true if the test run is completed, otherwise false

Parameters:
pRunId - run ID for the test run to be checked
Returns:
is the run is done

queryRuns

public java.util.List<TestRunTreeNode> queryRuns(java.lang.Long pTimeInterval)
Returns a list of test runs (in the form of TestRunTreeNodes) that were started within given time interval (e.g. last n seconds).

Parameters:
pTimeInterval - the time interval in seconds
Returns:
the list of test runs.

queryRuns

public java.util.List<TestRunTreeNode> queryRuns(java.lang.String pStatusCode)
Returns a list of test runs (in the form of TestRunTreeNodes) that are filter with the given status code.

Parameters:
pStatusCode - status code for a particular test
Returns:
list of test runs in the form of TestRunTreeNodes

queryRuns

public java.util.List<TestRunTreeNode> queryRuns(java.lang.String pStatusCode,
                                                 java.lang.Long pTimeInterval)
Returns a list of test runs that are filtered with the given status code and time interval. If status code is null, all status codes are included. Similarly if the time interval is null, test runs are included from any time.

Parameters:
pStatusCode - status code for the test run
pTimeInterval - time interval when the test was run
Returns:
list of test runs in the form of a list of TestRunTreeNode object instances.

queryRuns

public java.util.List<TestRunTreeNode> queryRuns(java.lang.String[] pStatusCodes,
                                                 java.lang.Long pTimeInterval,
                                                 java.lang.String pRunByUser)
                                          throws DiagfwkException
Queries test runs based on the given criteria. Null can be passed in for any of the given parameters to ignore that particular parameter. It is required for at least one criterion to be populated in order for the search to return results.

Parameters:
pStatusCodes - - status codes for the runs. Null value indicates any status.
pTimeInterval - time interval in seconds that specifies the interval for querying test runs. All runs that started with the last specified number of seconds are fetched
pRunByUser - user like predicate to limit the list runs by
Returns:
list of runs as a list of TestRunTreeNode objects
Throws:
DiagfwkException

queryRuns

public java.util.List<TestRunTreeNode> queryRuns(java.lang.String[] pStatusCodes,
                                                 java.lang.String pRunByUser,
                                                 java.util.Date pFromDate,
                                                 java.util.Date pToDate,
                                                 java.lang.String pRunName,
                                                 java.lang.String pTestDisplayName)
                                          throws DiagfwkException
Queries test runs based on the given criteria. Null can be passed in for any of the given parameters to ignore that particular parameter. It is required for at least one criterion to be populated in order for the search to return results.

Parameters:
pStatusCodes - - status codes for the runs. Null value indicates any status.
pRunByUser - user to limit the list runs by
pFromDate - - a "start" date value to search for runs that were submitted after this date.
pToDate - - a "end" date value to search for runs that were submitted before this date. When used in combination if with pFromDate, can be used to perform a search for runs within a given time-interval.
pRunName - - search for runs with a given run name (a "like" query will be performed based on the value of this parameter). Null value indicates any run name.
Returns:
list of runs as a list of TestRunTreeNode objects
Throws:
DiagfwkException

queryRuns

public java.util.List<TestRunTreeNode> queryRuns(java.lang.String[] pStatusCodes,
                                                 java.lang.Long pTimeInterval,
                                                 java.lang.String pRunByUser,
                                                 java.util.Date pFromDate,
                                                 java.util.Date pToDate,
                                                 java.lang.String pRunName,
                                                 java.lang.String pTestDisplayName)
                                          throws DiagfwkException
Queries test runs based on the given criteria. Null can be passed in for any of the given parameters to ignore that particular parameter. It is required for at least one criterion to be populated in order for the search to return results.

Parameters:
pStatusCodes - - status codes for the runs. Null value indicates any status.
pTimeInterval - time interval in seconds that specifies the interval for querying test runs. All runs that started with the last specified number of seconds are fetched
pRunByUser - user like predicate to limit the list runs by
pFromDate - - a "start" date value to search for runs that were submitted after this date.
pToDate - - a "end" date value to search for runs that were submitted before this date. When used in combination if with pFromDate, can be used to perform a search for runs within a given time-interval.
pRunName - - search for runs with a given run name (a "like" query will be performed based on the value of this parameter). Null value indicates any run name.
Returns:
list of runs as a list of TestRunTreeNode objects
Throws:
DiagfwkException

queryRunsList

public TestRunList queryRunsList(java.lang.String[] pStatusCodes,
                                 java.lang.Long pTimeInterval,
                                 java.lang.String pRunByUser,
                                 java.util.Date pFromDate,
                                 java.util.Date pToDate,
                                 java.lang.String pRunName,
                                 java.lang.String pTestDisplayName)
                          throws DiagfwkException
Queries test runs based on the given criteria. Null can be passed in for any of the given parameters to ignore that particular parameter. It is required for at least one criterion to be populated in order for the search to return results.

Parameters:
pStatusCodes - - status codes for the runs. Null value indicates any status.
pTimeInterval - time interval in seconds that specifies the interval for querying test runs. All runs that started with the last specified number of seconds are fetched
pRunByUser - user like predicate to limit the list runs by
pFromDate - - a "start" date value to search for runs that were submitted after this date.
pToDate - - a "end" date value to search for runs that were submitted before this date. When used in combination if with pFromDate, can be used to perform a search for runs within a given time-interval.
pRunName - - search for runs with a given run name (a "like" query will be performed based on the value of this parameter). Null value indicates any run name.
Returns:
list of runs as a list of TestRun objects
Throws:
DiagfwkException

deleteRun

public void deleteRun(java.lang.String pRunId)
               throws DiagfwkException
Deletes a single test run with the given Run ID from the Diagnostics Repository. All child executions are also deleted as a result of this operation. Only test runs that have completed can be deleted.

Parameters:
pRunId - - ID of the Test Run to be deleted.
Throws:
DiagfwkException - when any error occurs during the delete operation.

deleteRuns

public void deleteRuns(java.util.List<TestRunTreeNode> pRuns)
                throws DiagfwkException
Deletes a list of runs from the Diagnostics Repository. Only the TestRunTreeNode instance in the given list of NodeType "RUN" are removed. Further, any child executions for the runs are also removed.

Additionally, only test runs that have completed can be deleted. If any of the runs in the list are currently running, throws an DiagfwkException and none of the runs are deleted.

Parameters:
pRuns - - List of test runs to be deleted.
Throws:
DiagfwkException - when any error occurs during the delete operation.

deleteRuns

public void deleteRuns(java.util.List<TestRunTreeNode> pRuns,
                       boolean pIgnoreInProgress)
                throws DiagfwkException
Deletes a list of runs from the Diagnostics Repository. Only the TestRunTreeNode instance in the given list of NodeType "RUN" are removed. Further, any child executions for the runs are also removed. Additionally, only test runs that have completed can be deleted.

Parameters:
pRuns - - List of test runs to be deleted.
pIgnoreInProgress - - if true, ignores any runs that are currently running and only deletes the others. If false, throws an DiagfwkException if any of the runs in the list are running and none of the runs are deleted.
Throws:
DiagfwkException - when any error occurs during the delete operation.

deleteRuns

public void deleteRuns(java.lang.String[] pStatusCodes,
                       java.lang.String pRunByUser,
                       java.util.Date pFromDate,
                       java.util.Date pToDate,
                       java.lang.String pRunName)
                throws DiagfwkException
Deletes the Runs that match the given criteria. Null can be passed in for any of the given parameters to ignore that particular parameter. It is required for at least one criterion to be populated in order for the API to delete any Runs.

Any runs that are currently running but fall into the delete criteria are skipped.

Parameters:
pStatusCodes - - list of status codes for the runs to delete. Null value indicates any status.
pRunByUser - user like predicate to limit the runs by
pFromDate - - a "start" date value to delete runs that were submitted after this date.
pToDate - - a "end" date value to delete runs that were submitted before this date. When used in combination if with pFromDate, can be used to delete runs within a given time-interval.
pRunName - - delete runs with a given run name (a "like" query will be performed based on the value of this parameter). Null value indicates any run name.
Throws:
DiagfwkException

listAllADRHomes

public java.util.List<ADRHome> listAllADRHomes()
This API lists all the ADR homes that exist within the current domain

Returns:
list of all the ADR homes that exist within the current domain.

listAllProblems

public java.util.List<Problem> listAllProblems(ADRHome adrHome)
Lists all problems within this applications system

Returns:
the list of all problems within this applications system.

listAllIncidents

public java.util.List<Incident> listAllIncidents(Problem pProblem)
Lists all the incidents for the given problem within this applications system

Parameters:
pProblem - Problem for which to fetch incidents
Returns:
all the incidents for the given problem within this applications system

addRunToIncident

public void addRunToIncident(java.lang.String pRunId,
                             java.lang.String pIncidentId,
                             java.lang.String pServerName,
                             java.lang.String pAdrHome)
Adds the run report and all the execution reports for the given run to the particular incident specified by the given incident ID and on the given server.

Parameters:
pRunId - - ID for the Run
pIncidentId - - ID for the incident to which to add the run reports
pServerName - - Server where the incident is physically located.

canAccessADRInfo

public boolean canAccessADRInfo()
Returns true if the ADR information such as list of incidents and list of problems can be accessed through domain server mbeans by checking if appropriate credentials are set in CSF. Otherwise returns false.

Returns:
true if the ADR information such as list of incidents and list of problems can be accessed through domain server mbeans by checking if appropriate credentials are set in CSF. Otherwise returns false.

getTestRunById

public TestRun getTestRunById(java.lang.String runId)
Retrieve the test run given the run id.

Parameters:
runId - run id for the test run to be checked
Returns:
Test run object

getTestRunByName

public TestRun getTestRunByName(java.lang.String runName)
Retrieve the test run given the run name.

Parameters:
runName - run name for the test run to be checked
Returns:
Test run object

getQueryRunsMaxLimit

public int getQueryRunsMaxLimit()
Returns the maximum limit on the number of rows returned by the query runs API. The maximum limit is configurable by setting a system property "diagfwk.queryruns.limit" and has a default value of 200.

Returns:
maximum limit on the number of rows returned by the query runs API.

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

E22565-02

Copyright © 2011 Oracle. All Rights Reserved.