DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_DIAG_QAPACKAGE

Source


1 PACKAGE BODY JTF_DIAG_QAPACKAGE AS
2 /* $Header: jtfdiagadptdqa_b.pls 120.2 2005/08/13 01:16:21 minxu noship $ */
3   ------------------------------------------------------------
4   -- procedure to initialize test datastructures
5   -- executes prior to test run
6   ------------------------------------------------------------
7   PROCEDURE init IS
8   BEGIN
9    -- test writer could insert special setup code here
10    null;
11   END init;
12 
13   ------------------------------------------------------------
14   -- procedure to cleanup any  test datastructures that were setup in the init
15   --  procedure call executes after test run
16   ------------------------------------------------------------
17   PROCEDURE cleanup IS
18   BEGIN
19    -- test writer could insert special cleanup code here
20    NULL;
21   END cleanup;
22 
23   ------------------------------------------------------------
24   -- procedure to execute the PLSQL test
25   -- the inputs needed for the test are passed in and a report object and CLOB are -- returned.
26   ------------------------------------------------------------
27   PROCEDURE runtest(inputs IN  JTF_DIAG_INPUTTBL,
28                             report OUT NOCOPY JTF_DIAG_REPORT,
29                             reportClob OUT NOCOPY CLOB) IS
30      reportStr   LONG;
31      counter     NUMBER;
32      c_username  VARCHAR2(50);
33      statusStr   VARCHAR2(50);  -- SUCCESS or FAILURE
34      errStr      VARCHAR2(4000);
35      fixInfo     VARCHAR2(4000);
36      isFatal     VARCHAR2(50);  -- TRUE or FALSE
37    BEGIN
38      JTF_DIAGNOSTIC_ADAPTUTIL.setUpVars;
39          c_username := JTF_DIAGNOSTIC_ADAPTUTIL.getInputValue('USERNAME',inputs);
40          select count(*) into counter
41          from  fnd_user
42          where user_name  like c_username;
43          IF (counter = 1) THEN
44            reportStr := 'Report on Successful run displayed here';
45            JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportStr);
46            statusStr := 'SUCCESS';
47          ELSE
48            c_username := upper(c_username);
49            select count(*) into counter
50            from fnd_user
51            where user_name like c_username;
52            IF (counter = 1) THEN
53              reportStr := 'Warning: user found, but name was not in all caps';
54              errStr := 'Test failure message displayed here';
55              fixInfo := 'Fixing the test suggestions here';
56              isFatal := 'FALSE';
57              statusStr := 'WARNING';
58              JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportStr);
59            ELSE
60              statusStr := 'FAILURE';
61              errStr := 'Test failure message displayed here';
62              fixInfo := 'Fixing the test suggestions here';
63              isFatal := 'FALSE';
64            END IF;
65          END IF;
66          report := JTF_DIAGNOSTIC_ADAPTUTIL.constructReport(statusStr,errStr,fixInfo,isFatal);
67 	reportClob := JTF_DIAGNOSTIC_ADAPTUTIL.getReportClob;
68    END runTest;
69 
70   ------------------------------------------------------------
71   -- procedure to report name back to framework
72   ------------------------------------------------------------
73   PROCEDURE getComponentName(str OUT NOCOPY VARCHAR2) IS
74   BEGIN
75     str := 'QA Tests';
76   END getComponentName;
77 
78   ------------------------------------------------------------
79   -- procedure to report test description back to framework
80   ------------------------------------------------------------
81   PROCEDURE getTestDesc(str OUT NOCOPY VARCHAR2) IS
82   BEGIN
83     str := 'QAPackage Test to test core API calls';
84   END getTestDesc;
85 
86   ------------------------------------------------------------
87   -- procedure to report test name back to framework
88   ------------------------------------------------------------
89   PROCEDURE getTestName(str OUT NOCOPY VARCHAR2) IS
90   BEGIN
91     str := 'QAPackage Test';
92   END getTestName;
93 
94   ------------------------------------------------------------
95   -- procedure to provide/populate  the default parameters for the test case.
96   ------------------------------------------------------------
97   PROCEDURE getDefaultTestParams(defaultInputValues OUT NOCOPY JTF_DIAG_INPUTTBL) IS
98     tempInput JTF_DIAG_INPUTTBL;
99   BEGIN
100     tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.initinputtable;
101     tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'USERNAME','SYSADMIN');
102     defaultInputValues := tempInput;
103   EXCEPTION
104    when others then
105    defaultInputValues := JTF_DIAGNOSTIC_ADAPTUTIL.initinputtable;
106   END getDefaultTestParams;
107 
108   ------------------------------------------------------------
109   -- procedure to report test mode back to the framework
110   ------------------------------------------------------------
111   FUNCTION getTestMode RETURN NUMBER IS
112   BEGIN
113     return(2);
114   END getTestMode;
115 
116 
117 END JTF_DIAG_QAPACKAGE;
118 
119 
120