forked from KenRoytman/utPLSQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtequery_utpkg.gdr
executable file
·111 lines (101 loc) · 3.65 KB
/
tequery_utpkg.gdr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#===========================================================RevealNet GenX Driver==========
# Description: Create package to perform unit testing against base package with utPLSQL.
#==========================================================================================
# Category: Unit Test Package for Table Encapsulation package
#==========================================================================================
# Summary: Designed to be a DOUBLE PASS generation. Generate once against the
# package, then generate this output against the base table!
#
# WARNING: Generating duplicate of entire package!
#
#==========================================================================================
# Application area: Testing
#==========================================================================================
# Key words: PLSQL,PROG,ARG,UTPLSQL
#==========================================================================================
# Script Requirements/Dependencies
# Backend Version: PL/SQL 2.3 (Oracle 7.3) and above
# INCLUDEs: None
# EXECs: None
#==========================================================================================
# Generated Text Requirements/Dependencies
# Language and Version: PL/SQL 2.3 (Oracle 7.3) and above
# Operating System(s): Non-specific
#==========================================================================================
# Author: Steven Feuerstein, RevealNet: [email protected]
#==========================================================================================
# Modification History
#
# When Who What
# -----------------------------------------------------------------------------------------
# 05/2000 SEF Created
#==========================================================================================
[SETALIAS]utprefix[TO]ut#
[SETALIAS]tabprefix[TO]ut_
[SETALIAS]olprog[TO]\[progname][overload]
[SETALIAS]progtab[TO]\{tabprefix}{olprog}
[SETALIAS]oltestprog[TO]\{utprefix}{olprog}
[STOREIN]{utprefix}[objname].gdr
[ASIS]
[SET]objname[TO]#CHANGE THIS
[SETALIAS]tabprefix[TO]ut_
[ENDASIS]
CREATE OR REPLACE PACKAGE [schema].{utprefix}[objname] AUTHID CURRENT_USER
-- SECOND PASS INSTRUCTIONS:
--
-- Set the object name and generate this GDR to produce the test package.
-- After generation, save to pks and pkb files and put in the specific
-- code for the various tests.
IS
[ASIS]
rec [objname]%ROWTYPE;
[ENDASIS]
PROCEDURE {utprefix}setup;
PROCEDURE {utprefix}teardown;
[FOREACH]prog
[IF][progname][LIKE]%ROW%[OR][progname][LIKE]%$VAL[OR][progname][LIKE]$PKY
PROCEDURE ^{oltestprog}^;
[ENDIF]
[ENDFOREACH]
END {utprefix}[objname];
/
CREATE OR REPLACE PACKAGE BODY [schema].{utprefix}[objname] AUTHID CURRENT_USER
IS
PROCEDURE setup
IS
BEGIN
-- Clean start
{utprefix}teardown;
END;
PROCEDURE teardown
IS
BEGIN
NULL;
END;
[FOREACH]prog
[IF][progname][LIKE]%ROW%[OR][progname][LIKE]%$VAL[OR][progname][LIKE]$PKY
PROCEDURE {utprefix}[progname][overload]
IS
BEGIN
-- Run baseline code.
-- Compare to program call:
[progname] (
);
-- Test results
utAssert.eqtable (
'Successful [progname][overload]',
[progname],
'base query'
);
EXCEPTION
WHEN OTHERS
THEN
-- Force registration of test failure.
utAssert.this (
'[progname] exception ' || SQLERRM,
SQLCODE = 0);
END;
[ENDIF]
[ENDFOREACH]
END {utprefix}[objname];
/