DBA Data[Home] [Help]

PACKAGE BODY: APPS.BIS_DIAG_SETUP_ENV_TEST

Source


1 PACKAGE BODY BIS_DIAG_SETUP_ENV_TEST AS
2 /* $Header: BISPDENB.pls 120.0.12000000.1 2007/08/09 09:59:05 appldev noship $ */
3 --
4 /*
5 REM +=======================================================================+
6 REM |    Copyright (c) 2007 Oracle Corporation, Redwood Shores, CA, USA     |
7 REM |                         All rights reserved.                          |
8 REM +=======================================================================+
9 REM | FILENAME                                                              |
10 REM |     BISPDENB.pls                                                      |
11 REM |                                                                       |
12 REM | DESCRIPTION                                                           |
13 REM |     Diagnostics Environment Test Package Body                         |
14 REM |                                                                       |
15 REM | NOTES                                                                 |
16 REM |                                                                       |
17 REM | HISTORY                                                               |
18 REM | Date              Developer           Comments                        |
19 REM | 02-AUG-2007       nbarik              Creation                        |
20 REM |                                                                       |
21 REM +=======================================================================+
22 */
23 
24 ------------------------------------------------------------
25 -- procedure to initialize test datastructures
26 -- executed prior to test run - leave body as null otherwise
27 ------------------------------------------------------------
28 PROCEDURE init IS
29 BEGIN
30 -- test writer could insert special setup code here
31   NULL;
32 END init;
33 ------------------------------------------------------------
34 -- procedure to cleanup any test datastructures that were setup in the init
35 -- procedure call executes after test run - leave body as null otherwize
36 ------------------------------------------------------------
37 PROCEDURE cleanup IS
38 BEGIN
39 -- test writer could insert special cleanup code here
40   NULL;
41 END cleanup;
42 ------------------------------------------------------------
43 -- procedure to execute the PLSQL test
44 -- the inputs needed for the test are passed in and a report object and CLOB are
45 -- returned.
46 -- note the way that support API writes to the report CLOB.
47 ------------------------------------------------------------
48 PROCEDURE runtest(inputs IN JTF_DIAG_INPUTTBL,
49 	report OUT NOCOPY JTF_DIAG_REPORT,
50 	reportClob OUT NOCOPY CLOB)
51 IS
52   reportStr LONG;
53   counter NUMBER;
54   dummy_v2t JTF_DIAGNOSTIC_COREAPI.v2t;
55   c_userid VARCHAR2(50);
56   statusStr VARCHAR2(50);
57   errStr VARCHAR2(4000);
58   fixInfo VARCHAR2(4000); isFatal VARCHAR2(50);
59   dummy_num NUMBER;
60   sqltxt VARCHAR2 (2000);
61   l_apps_version VARCHAR2(30);
62   l_db_version VARCHAR2 (2000);
63   l_num_rows NUMBER;
64 BEGIN
65   JTF_DIAGNOSTIC_ADAPTUTIL.setUpVars;
66   JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport('@html');
67   JTF_DIAGNOSTIC_COREAPI.insert_style_sheet;
68   -- JTF_DIAGNOSTIC_COREAPI.line_out('this also writes to the clob');
69   JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportClob,reportStr);
70   -- JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport('String into report');
71   l_apps_version := JTF_DIAGNOSTIC_COREAPI.Get_DB_Apps_Version;
72   JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(fnd_message.get_string('BIS', 'BIS_DIAG_APPS_VERSION') || ': ' || l_apps_version);
73   JTF_DIAGNOSTIC_COREAPI.BRPrint;
74   l_db_version := JTF_DIAGNOSTIC_COREAPI.Get_RDBMS_Header;
75   JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(fnd_message.get_string('BIS', 'BIS_DIAG_DB_VERSION') || ': ' || l_db_version);
76   JTF_DIAGNOSTIC_COREAPI.BRPrint;
77   l_num_rows := JTF_DIAGNOSTIC_COREAPI.Display_SQL('SELECT patch_level FROM fnd_product_installations WHERE patch_level LIKE ''%BIS%''', 'BIS Version', 'Y', 'Y', null, 0);
78   l_num_rows := JTF_DIAGNOSTIC_COREAPI.Display_SQL('SELECT decode(bug_number,''5404886'',''DBI 7.3: 11i.BIS_PF.G: 5404886'',''5565583'',''DBI 7.4: 11i.BIS_PF.H: 5565583'',''4458359'',''DBI 8.0: R12.BIS_PF.A: 4458359'') ' ||
79                                                                            ' "Current DBI Family Pack level:" FROM ad_bugs WHERE bug_number IN (''5404886'',''5565583'',''4458359'')', 'DBI Version', 'Y', 'Y', null, 0);
80   l_num_rows := JTF_DIAGNOSTIC_COREAPI.Display_SQL('SELECT object_name, object_type FROM user_objects WHERE object_name LIKE ''BIS%'' AND status = ''INVALID''', 'Invalid Packages', 'Y', 'Y', null, 0);
81   JTF_DIAGNOSTIC_COREAPI.BRPrint;
82   JTF_DIAGNOSTIC_COREAPI.ActionPrint(fnd_message.get_string('BIS', 'BIS_DIAG_TESTCASE_FIX_INFO'));
83   statusStr := 'SUCCESS';
84   -- JTF_DIAGNOSTIC_COREAPI.ActionErrorPrint('You better do something!');
85   errStr := '';
86   fixInfo := '';
87   isFatal := 'FALSE';
88   report := JTF_DIAGNOSTIC_ADAPTUTIL.constructReport(statusStr,errStr,fixInfo,isFatal);
89   reportClob := JTF_DIAGNOSTIC_ADAPTUTIL.getReportClob;
90 END runTest;
91 ------------------------------------------------------------
92 -- procedure to report name back to framework
93 ------------------------------------------------------------
94 PROCEDURE getComponentName(name OUT NOCOPY VARCHAR2) IS
95 BEGIN
96   name := fnd_message.get_string('BIS', 'BIS_DIAG_ENVIRONMENTS');
97 END getComponentName;
98 ------------------------------------------------------------
99 -- procedure to report test description back to framework
100 ------------------------------------------------------------
101 PROCEDURE getTestDesc(descStr OUT NOCOPY VARCHAR2) IS
102 BEGIN
103   descStr := fnd_message.get_string('BIS', 'BIS_DIAG_ENVIRONMENTS_DESC');
104 END getTestDesc;
105 ------------------------------------------------------------
106 -- procedure to report test name back to framework
107 ------------------------------------------------------------
108 PROCEDURE getTestName(name OUT NOCOPY VARCHAR2) IS
109 BEGIN
110   name := fnd_message.get_string('BIS', 'BIS_DIAG_ENVIRONMENTS_TEST');
111 END getTestName;
112 ------------------------------------------------------------
113 -- procedure to provide the default parameters for the test case.
114 -- please note the paramters have to be registered through the UI
115 -- before basic tests can be run.
116 --
117 ------------------------------------------------------------
118 PROCEDURE getDefaultTestParams(defaultInputValues OUT NOCOPY JTF_DIAG_INPUTTBL)
119 IS
120   tempInput JTF_DIAG_INPUTTBL;
121 BEGIN
122   tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.initinputtable;
123   -- tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'USERID','SYSADMIN');
124   -- tempInput := JTF_DIAGNOSTIC_defaultInputValues := tempInput;
125 EXCEPTION
126   when others then
127     defaultInputValues := JTF_DIAGNOSTIC_ADAPTUTIL.initinputtable;
128 END getDefaultTestParams;
129 
130 END BIS_DIAG_SETUP_ENV_TEST;