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

E22565-02

oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.db
Class OADBTestRunDAO

java.lang.Object
  extended by oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.db.OADBBaseDAO
      extended by oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.db.OADBTestRunDAO
All Implemented Interfaces:
BaseDAO, TestRunDAO

public class OADBTestRunDAO
extends OADBBaseDAO
implements TestRunDAO

Provides Oracle Applications Database specific implementations for data access APIs related to Test runs.


Nested Class Summary
 
Nested classes/interfaces inherited from interface oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.BaseDAO
BaseDAO.DBSessionInfo
 
Field Summary
static int RUNS_ROWNUM_LIMIT_DEFAULT
          Fetch row number limit when querying for test runs
static java.lang.String SYSPROP_DIAGFWK_QUERYRUNS_LIMIT
          System property that allows the maximum number of rows returned by the queryRuns API to be configured
 
Fields inherited from class oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.db.OADBBaseDAO
langCode
 
Constructor Summary
OADBTestRunDAO()
           
 
Method Summary
 void deleteRun(java.lang.String pRunId)
          Deletes the run with the given run ID (including all the executions in the run).
 void deleteRuns(java.lang.String[] pRunIds)
          Deletes runs with the given set of run IDs.
 boolean existsExecution(java.lang.String pExecutionId)
          Checks to see if an Execution with the given Execution ID exists.
 boolean existsRun(java.lang.String pRunId)
          Checks to see if a Run with the given Run ID exists.
 TestExec fetch(java.lang.String pExecId)
          Queries Diagnostic Test Execution data in the repository to fetch TestExec object.
 TestRun fetch(java.lang.String pRunId, boolean pFetchExecs)
          Queries Diagnostic Run data in the repository to fetch TestRun object.
 TestRun fetch(java.lang.String pRunId, boolean pFetchExecs, boolean bLoadReport)
          Queries Diagnostic Run data in the repository to fetch TestRun object.
 TestRun fetchByRunName(java.lang.String pRunName, boolean pFetchExecs)
          Queries Diagnostic Run data in the repository to fetch TestRun object.
 TestRun fetchByRunName(java.lang.String pRunName, boolean pFetchExecs, boolean bLoadReport)
          Queries Diagnostic Run data in the repository to fetch TestRun object.
 TestExec fetchExecution(java.lang.String pExecId, boolean pIncludeChildren)
          Gets the test execution for the given execution ID.
 TestExec fetchExecution(java.lang.String pExecId, boolean pIncludeChildren, boolean bLoadReport)
          Gets the test execution for the given execution ID.
 TestExecList fetchExecutions(java.lang.String pRunId)
          Fetches the executions for the given test run.
 TestExecList fetchExecutions(java.lang.String pRunId, boolean bLoadReport)
          Fetches the executions for the given test run.
 TestExec fetchTestExec(java.lang.String pExecId, boolean bLoadReport)
          Queries Diagnostic Test Execution data in the repository to fetch TestExec object.
 int getQueryRunsMaxLimit()
          Returns the maximum limit on the number of rows returned by the query runs API.
 java.lang.String queryExecStatus(java.lang.String pExecId)
          Queries the status of the given execution ID
 TestExecList queryImmediateChildExecutions(java.lang.String pParentExecId)
          Queries the immediate test executions for the given execution ID.
 TestExecList queryImmediateExecutions(java.lang.String pRunId)
          Queries the immediate test executions for the given run ID.
 java.lang.String queryRunId(java.lang.String pRunName)
          Queries the Run ID for the given Run name.
 TestRunList 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.lang.String queryRunStatus(java.lang.String pRunId)
          Queries the status of the given run ID
 void save(TestExec exec)
          Saves the given TestExec object into the repository.
 void save(TestRun pTestRun)
          Saves the given TestRun object into the repository.
protected static int setWhoColumnsForInsert(DiagBObj pObj, java.sql.PreparedStatement pStmt, int pStartIndex)
           
 void updateRunStatus(TestRun pRun, java.lang.String pExpectedCurrentStatusCode, java.lang.String pNewStatusCode, java.lang.String pExecStatusCodeToUpdate)
          Updates the status of the given run to the specified status code.
 
Methods inherited from class oracle.apps.fnd.appltest.diagfwk.engine.provider.dao.db.OADBBaseDAO
close, close, close, createSysGuid, getCLOB, getConnection, getDBSessionInfo, getJdbcBatchSize, getLangCode, getSysDate, getSysDate, getSysGuid, populateWhoColumns, prepareWhoColumns, queryNlsParameters, querySysDate, querySysDate, returnConnection, rollBack, setFetchSize, setSavepoint, setWhoColumnsForUpdate
 
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.provider.dao.BaseDAO
createSysGuid, getDBSessionInfo, queryNlsParameters, querySysDate, querySysDate
 

Field Detail

RUNS_ROWNUM_LIMIT_DEFAULT

public static final int RUNS_ROWNUM_LIMIT_DEFAULT
Fetch row number limit when querying for test runs

See Also:
Constant Field Values

SYSPROP_DIAGFWK_QUERYRUNS_LIMIT

public static final java.lang.String SYSPROP_DIAGFWK_QUERYRUNS_LIMIT
System property that allows the maximum number of rows returned by the queryRuns API to be configured

See Also:
Constant Field Values
Constructor Detail

OADBTestRunDAO

public OADBTestRunDAO()
Method Detail

save

public void save(TestExec exec)
Description copied from interface: TestRunDAO
Saves the given TestExec object into the repository. If an execution ID is not set in the TestExec object, the API createes a new execution in the repository. If an execution ID is set, it will update the record for the existing execution in the repository.

Specified by:
save in interface TestRunDAO
Parameters:
exec - TestExec representing a particular test execution to be saved into the test repository.

save

public void save(TestRun pTestRun)
Description copied from interface: TestRunDAO
Saves the given TestRun object into the repository. If a Run ID is not set in the TestRun object, the API createes a new run in the repository. If an run ID is set, it will update the record for the existing run in the repository.

Specified by:
save in interface TestRunDAO
Parameters:
pTestRun - TestRun representing a particular test run to be saved into the test repository.

fetchExecutions

public TestExecList fetchExecutions(java.lang.String pRunId)
Description copied from interface: TestRunDAO
Fetches the executions for the given test run. This fetch checks for view report security permission.

Specified by:
fetchExecutions in interface TestRunDAO
Parameters:
pRunId - Run GUID for the test run
Returns:
TestExecList object containing list of all the executions for that run. All nested executions are also fetched.

fetchExecutions

public TestExecList fetchExecutions(java.lang.String pRunId,
                                    boolean bLoadReport)
Description copied from interface: TestRunDAO
Fetches the executions for the given test run.

Specified by:
fetchExecutions in interface TestRunDAO
Parameters:
pRunId - Run GUID for the test run
bLoadReport - flag that indicates whether the fetch should check for view report security permission and load the report if allowed
Returns:
TestExecList object containing list of all the executions for that run. All nested executions are also fetched.

fetchByRunName

public TestRun fetchByRunName(java.lang.String pRunName,
                              boolean pFetchExecs)
Description copied from interface: TestRunDAO
Queries Diagnostic Run data in the repository to fetch TestRun object. If pFetchExecs is true, fetch returns TestRun object with all child TestExec objects, if present; otherwise, it simply retruns summary level TestRun object information. This fetch will check for report security permission.

Specified by:
fetchByRunName in interface TestRunDAO
Parameters:
pRunName - name of the run for which to fetch details
pFetchExecs - flag that indicates whether included test executions should also be fetched.
Returns:
TestRun object

fetchByRunName

public TestRun fetchByRunName(java.lang.String pRunName,
                              boolean pFetchExecs,
                              boolean bLoadReport)
Description copied from interface: TestRunDAO
Queries Diagnostic Run data in the repository to fetch TestRun object. If pFetchExecs is true, fetch returns TestRun object with all child TestExec objects, if present; otherwise, it simply retruns summary level TestRun object information.

Specified by:
fetchByRunName in interface TestRunDAO
Parameters:
pRunName - name of the run for which to fetch details
pFetchExecs - flag that indicates whether included test executions should also be fetched.
bLoadReport - flag that indicates whether the fetch should check for view report security permission and load the report if allowed
Returns:
TestRun object

fetch

public TestRun fetch(java.lang.String pRunId,
                     boolean pFetchExecs)
Description copied from interface: TestRunDAO
Queries Diagnostic Run data in the repository to fetch TestRun object. If pFetchExecs is true, fetch returns TestRun object with all child TestExec objects, if present; otherwise, it simply retruns summary level TestRun object information. This fetch will check for report security permission.

Specified by:
fetch in interface TestRunDAO
Parameters:
pRunId - a GUID representing TestRun object
pFetchExecs - - set true for returning all child TestExecs for a giveb TestRun
Returns:
TestRun object

fetch

public TestRun fetch(java.lang.String pRunId,
                     boolean pFetchExecs,
                     boolean bLoadReport)
Description copied from interface: TestRunDAO
Queries Diagnostic Run data in the repository to fetch TestRun object. If pFetchExecs is true, fetch returns TestRun object with all child TestExec objects, if present; otherwise, it simply retruns summary level TestRun object information.

Specified by:
fetch in interface TestRunDAO
Parameters:
pRunId - a GUID representing TestRun object
pFetchExecs - - set true for returning all child TestExecs for a giveb TestRun
bLoadReport - flag that indicates whether the fetch should check for view report security permission and load the report if allowed
Returns:
TestRun object

queryRuns

public TestRunList 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)
Description copied from interface: TestRunDAO
Queries test runs based on the given criteria.

Specified by:
queryRuns in interface TestRunDAO
Parameters:
pStatusCodes - status codes for the test run. All runs with these status codes are fetched.
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 - all runs started after this date are fetched
pToDate - all runs started before this date are fetched
pRunName - all runs with run names like this run name are fetched
Returns:
list of test runs that meet the status and time interval criteria.

queryImmediateExecutions

public TestExecList queryImmediateExecutions(java.lang.String pRunId)
Description copied from interface: TestRunDAO
Queries the immediate test executions for the given run ID.

Specified by:
queryImmediateExecutions in interface TestRunDAO
Parameters:
pRunId - run ID for which to query the executions
Returns:
the list of immediate child test executions for the given run ID.

queryImmediateChildExecutions

public TestExecList queryImmediateChildExecutions(java.lang.String pParentExecId)
Description copied from interface: TestRunDAO
Queries the immediate test executions for the given execution ID.

Specified by:
queryImmediateChildExecutions in interface TestRunDAO
Parameters:
pParentExecId - parent execution ID for which to query the child executions
Returns:
the list of immediate child test executions for the given parent execution id.

queryRunId

public java.lang.String queryRunId(java.lang.String pRunName)
Description copied from interface: TestRunDAO
Queries the Run ID for the given Run name.

Specified by:
queryRunId in interface TestRunDAO
Parameters:
pRunName - name for the run.
Returns:
the Run ID for the given Run name if such a test run already exists. Otherwise returns null.

fetchExecution

public TestExec fetchExecution(java.lang.String pExecId,
                               boolean pIncludeChildren)
Description copied from interface: TestRunDAO
Gets the test execution for the given execution ID. Additionally, if pIncludeChildren flag is set to true, the child executions (if any) for the given execution ID are also included.

Specified by:
fetchExecution in interface TestRunDAO
Parameters:
pExecId - execution ID to fetch
pIncludeChildren - if true, the API will also fetch child executions (if any exist) for the given execution ID.
Returns:
a TestExec object populated with the details for the given execution ID.

fetchExecution

public TestExec fetchExecution(java.lang.String pExecId,
                               boolean pIncludeChildren,
                               boolean bLoadReport)
Description copied from interface: TestRunDAO
Gets the test execution for the given execution ID. Additionally, if pIncludeChildren flag is set to true, the child executions (if any) for the given execution ID are also included.

Specified by:
fetchExecution in interface TestRunDAO
Parameters:
pExecId - execution ID to fetch
pIncludeChildren - if true, the API will also fetch child executions (if any exist) for the given execution ID.
bLoadReport - if true, the API will check the report view permission and load the report if allowed
Returns:
a TestExec object populated with the details for the given execution ID.

fetch

public TestExec fetch(java.lang.String pExecId)
Description copied from interface: TestRunDAO
Queries Diagnostic Test Execution data in the repository to fetch TestExec object. This API calls fetchTestExec() and it does not fetch the child executions for the given execution ID.

Specified by:
fetch in interface TestRunDAO
Parameters:
pExecId - - A GUID, representing a TestExec object
Returns:
TestExec object

fetchTestExec

public TestExec fetchTestExec(java.lang.String pExecId,
                              boolean bLoadReport)
Description copied from interface: TestRunDAO
Queries Diagnostic Test Execution data in the repository to fetch TestExec object. This API does not fetch the child executions for the given execution ID.

Specified by:
fetchTestExec in interface TestRunDAO
Parameters:
pExecId - - A GUID, representing a TestExec object
bLoadReport - flag that indicates whether the fetch should check for view report security permission and load report if allowed
Returns:
TestExec object

setWhoColumnsForInsert

protected static int setWhoColumnsForInsert(DiagBObj pObj,
                                            java.sql.PreparedStatement pStmt,
                                            int pStartIndex)
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

queryRunStatus

public java.lang.String queryRunStatus(java.lang.String pRunId)
Description copied from interface: TestRunDAO
Queries the status of the given run ID

Specified by:
queryRunStatus in interface TestRunDAO
Parameters:
pRunId - run ID
Returns:
the current status code for the given run ID

queryExecStatus

public java.lang.String queryExecStatus(java.lang.String pExecId)
Description copied from interface: TestRunDAO
Queries the status of the given execution ID

Specified by:
queryExecStatus in interface TestRunDAO
Parameters:
pExecId - the execution ID
Returns:
the current status code for the given execution ID

updateRunStatus

public void updateRunStatus(TestRun pRun,
                            java.lang.String pExpectedCurrentStatusCode,
                            java.lang.String pNewStatusCode,
                            java.lang.String pExecStatusCodeToUpdate)
Description copied from interface: TestRunDAO
Updates the status of the given run to the specified status code. Also updates status of any nested executions

Specified by:
updateRunStatus in interface TestRunDAO
Parameters:
pRun - Test Run for which to update the status. The run ID attribute for the test run must be set on the instance.
pExpectedCurrentStatusCode - the current expected status code of the run. If the run is not in the expected status code at the time of update then an exception is thrown and update is not performed. If null, update is always performed regardless of current status.
pNewStatusCode - the new status code to update to.
pExecStatusCodeToUpdate - Any nested executions for the given run with with this status code are also updated to the new status code. If this is null, then status of nested executions are not updated.

deleteRun

public void deleteRun(java.lang.String pRunId)
Description copied from interface: TestRunDAO
Deletes the run with the given run ID (including all the executions in the run).

Specified by:
deleteRun in interface TestRunDAO
Parameters:
pRunId - ID for the run to delete.

getQueryRunsMaxLimit

public int getQueryRunsMaxLimit()
Description copied from interface: TestRunDAO
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.

Specified by:
getQueryRunsMaxLimit in interface TestRunDAO
Returns:
maximum limit on the number of rows returned by the query runs API.

deleteRuns

public void deleteRuns(java.lang.String[] pRunIds)
Description copied from interface: TestRunDAO
Deletes runs with the given set of run IDs. Deletes all corresponding executions for the runs as well.

Specified by:
deleteRuns in interface TestRunDAO
Parameters:
pRunIds - list of run IDs to delete.

existsRun

public boolean existsRun(java.lang.String pRunId)
Description copied from interface: TestRunDAO
Checks to see if a Run with the given Run ID exists.

Specified by:
existsRun in interface TestRunDAO
Parameters:
pRunId - Run ID
Returns:
true if the Run exists. Returns false otherwise.

existsExecution

public boolean existsExecution(java.lang.String pExecutionId)
Description copied from interface: TestRunDAO
Checks to see if an Execution with the given Execution ID exists.

Specified by:
existsExecution in interface TestRunDAO
Parameters:
pExecutionId - Execution ID
Returns:
true if the Execution exists. Returns false otherwise.

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

E22565-02

Copyright © 2011 Oracle. All Rights Reserved.