Skip to content

Commit d7697c1

Browse files
committed
Prepare for Installation Testing
1 parent c9886b1 commit d7697c1

File tree

9 files changed

+182
-216
lines changed

9 files changed

+182
-216
lines changed

src/core/README.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ wtplsql.pkb WTPLSQL package body.
3737
wtplsql.pks WTPLSQL package specification.
3838

3939

40+
NOTE: "install.sql" creates PUBLIC SYNONYMS.
41+
42+
4043
Install Procedure:
4144
------------------
4245
1) sqlplus SYS/password as SYSDBA @install

src/core/common_setup.sql

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
V1.0 of wtPLSQL was too flawed. No downgrade available.

src/core/install.sql

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ begin
1818
if USER not in ('SYS','SYSTEM')
1919
then
2020
raise_application_error (-20000,
21-
'Not logged in as SYS or SYSTEM');
21+
'Not logged in as SYS');
2222
end if;
2323
end;
2424
/
@@ -93,27 +93,19 @@ end;
9393

9494
-- Public Synonyms
9595

96-
create or replace public synonym wt_test_runs_seq for &schema_owner..wt_test_runs_seq;
97-
98-
create or replace public synonym wt_test_runs for &schema_owner..wt_test_runs;
99-
create or replace public synonym wt_results for &schema_owner..wt_results;
100-
create or replace public synonym wt_dbout_profiles for &schema_owner..wt_dbout_profiles;
101-
create or replace public synonym wt_version for &schema_owner..wt_version;
102-
103-
create or replace public synonym plsql_profiler_runs for &schema_owner..plsql_profiler_runs;
104-
create or replace public synonym plsql_profiler_units for &schema_owner..plsql_profiler_units;
105-
create or replace public synonym plsql_profiler_data for &schema_owner..plsql_profiler_data;
106-
create or replace public synonym plsql_profiler_runnumber for &schema_owner..plsql_profiler_runnumber;
107-
108-
--create or replace public synonym ut_assert for &schema_owner..wt_assert;
109-
create or replace public synonym wt_assert for &schema_owner..wt_assert;
110-
create or replace public synonym wt_profiler for &schema_owner..wt_profiler;
111-
create or replace public synonym wt_result for &schema_owner..wt_result;
112-
create or replace public synonym wt_test_run_stat for &schema_owner..wt_test_run_stat;
113-
create or replace public synonym wt_text_report for &schema_owner..wt_text_report;
114-
create or replace public synonym wt_wtplsql for &schema_owner..wtplsql;
115-
create or replace public synonym wtplsql for &schema_owner..wtplsql;
96+
create or replace public synonym wt_version for &schema_owner..wt_version;
97+
create or replace public synonym wt_test_runs for &schema_owner..wt_test_runs;
98+
create or replace public synonym wt_results for &schema_owner..wt_results;
99+
create or replace public synonym wt_dbout_profiles for &schema_owner..wt_dbout_profiles;
100+
create or replace public synonym wt_test_run_stats.tab for &schema_owner..wt_test_run_stats.tab;
101+
create or replace public synonym wt_testcase_stats.tab for &schema_owner..wt_testcase_stats.tab;
102+
create or replace public synonym wt_self_test.tab for &schema_owner..wt_self_test.tab;
116103

104+
create or replace public synonym ut_assert for &schema_owner..wt_assert;
105+
create or replace public synonym wt_assert for &schema_owner..wt_assert;
106+
create or replace public synonym wt_text_report for &schema_owner..wt_text_report;
107+
create or replace public synonym wt_wtplsql for &schema_owner..wtplsql;
108+
create or replace public synonym wtplsql for &schema_owner..wtplsql;
117109

118110

119111
WHENEVER SQLERROR exit SQL.SQLCODE
@@ -142,10 +134,7 @@ WHENEVER SQLERROR continue
142134
--
143135
create index plsql_profiler_runs_idx1
144136
on plsql_profiler_runs (run_date);
145-
grant select, insert, delete on plsql_profiler_runs to public;
146-
grant select, insert, delete on plsql_profiler_units to public;
147-
grant select, insert, delete on plsql_profiler_data to public;
148-
grant select on plsql_profiler_runnumber to public;
137+
149138
-- Core Tables
150139
@wt_version.tab
151140
@wt_test_runs.tab
@@ -156,29 +145,21 @@ grant select on plsql_profiler_runnumber to public;
156145
@wt_self_test.tab
157146

158147
-- Package Specifications
159-
160148
@wtplsql.pks
161149
/
162-
grant execute on wtplsql to public;
163-
164150
@wt_result.pks
165151
/
166-
grant execute on wt_result to public;
167-
168152
@wt_assert.pks
169153
/
170-
grant execute on wt_assert to public;
171-
172154
@wt_profiler.pks
173155
/
174-
grant execute on wt_profiler to public;
175-
176156
@wt_test_run_stat.pks
177157
/
178-
grant execute on wt_profiler to public;
179-
180158
@wt_text_report.pks
181159
/
160+
161+
grant execute on wtplsql to public;
162+
grant execute on wt_assert to public;
182163
grant execute on wt_text_report to public;
183164

184165
-- Package Bodies
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
White Box PL/SQL Testing
3+
src/core/upgrades/V1.0.0_to_Current/README.txt
4+
5+
FILE DESCRIPTION
6+
---------------------- -----------------------
7+
update_all_stats.sql Populate the new STATS tables
8+
upgrade.sql Main upgrade script
9+
10+
11+
Install Procedure:
12+
------------------
13+
1) sqlplus SYS/password as SYSDBA @upgrade
14+
2) exit
15+
3) Compare upgrade.LST to upgradeO.LST

src/core/upgrades/V1.0.0_to_Current/update_all_statsO.LST

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
2+
--
3+
-- Core Installation
4+
--
5+
-- Run as System
6+
--
7+
8+
-- Capture output
9+
spool install
10+
set showmode off
11+
12+
-- Shared Setup Script
13+
@../../common_setup.sql
14+
15+
WHENEVER SQLERROR exit SQL.SQLCODE
16+
17+
begin
18+
if USER not in ('SYS')
19+
then
20+
raise_application_error (-20000,
21+
'Not logged in as SYS');
22+
end if;
23+
end;
24+
/
25+
26+
WHENEVER SQLERROR continue
27+
28+
revoke connect, resource from &schema_owner.;
29+
30+
grant quota unlimited to &schema_owner.;
31+
grant create session to &schema_owner.;
32+
grant create type to &schema_owner.;
33+
grant create sequence to &schema_owner.;
34+
grant create table to &schema_owner.;
35+
grant create trigger to &schema_owner.;
36+
grant create view to &schema_owner.;
37+
grant create procedure to &schema_owner.;
38+
grant select on dba_source to &schema_owner.;
39+
40+
-- This MUST be run by SYS.
41+
grant select on dba_objects to &schema_owner.;
42+
43+
drop public synonym wt_not_executable;
44+
drop public synonym plsql_profiler_runs;
45+
drop public synonym plsql_profiler_units;
46+
drop public synonym plsql_profiler_data;
47+
drop public synonym wt_profiler;
48+
drop public synonym wt_result;
49+
50+
create or replace public synonym wt_version for &schema_owner..wt_version;
51+
create or replace public synonym wt_test_run_stats for &schema_owner..wt_test_run_stats;
52+
create or replace public synonym wt_testcase_stats for &schema_owner..wt_testcase_stats;
53+
create or replace public synonym wt_self_test for &schema_owner..wt_self_test;
54+
55+
WHENEVER SQLERROR exit SQL.SQLCODE
56+
57+
-- Connect as SCHEMA_OWNER
58+
connect &schema_owner./&schema_owner.
59+
60+
begin
61+
if USER != upper('&schema_owner')
62+
then
63+
raise_application_error (-20000,
64+
'Not logged in as &schema_owner');
65+
end if;
66+
end;
67+
/
68+
69+
WHENEVER SQLERROR continue
70+
71+
@../../proftab_comments.sql
72+
--
73+
grant select on plsql_profiler_runnumber to public;
74+
-- Core Tables
75+
drop table wt_test_data;
76+
revoke select, insert, delete on plsql_profiler_runs from public;
77+
revoke select, insert, delete on plsql_profiler_units from public;
78+
revoke select, insert, delete on plsql_profiler_data from public;
79+
revoke insert on wt_test_runs from public;
80+
revoke insert on wt_results from public;
81+
revoke insert on wt_dbout_profiles from public;
82+
revoke update on wt_dbout_profiles from public;
83+
84+
@../../wt_version.tab
85+
@../../wt_testcase_stats.tab
86+
@../../wt_test_run_stats.tab
87+
@../../wt_self_test.tab
88+
89+
-- @wt_test_runs.tab
90+
grant select on wt_test_runs_seq to public;
91+
92+
-- @wt_results.tab
93+
alter table wt_results rename column elapsed_msecs to interval_msecs;
94+
comment on column wt_results.interval_msecs is 'Interval time in milliseonds since the previous Result or start ot the Test Run.';
95+
96+
-- @wt_dbout_profiles.tab
97+
alter table wt_dbout_profiles rename column total_time to total_usecs;
98+
alter table wt_dbout_profiles rename column min_time to min_usecs;
99+
alter table wt_dbout_profiles rename column max_time to max_usecs;
100+
comment on column wt_dbout_profiles.status is 'Executed/NotExecuted/Excluded/Annotated/Unknown Status from the Profiler';
101+
comment on column wt_dbout_profiles.total_time is 'Total time spent executing this line.';
102+
comment on column wt_dbout_profiles.min_time is 'Minimum execution time for this line.';
103+
comment on column wt_dbout_profiles.max_time is 'Maximum execution time for this line.';
104+
alter table wt_dbout_profiles drop constraint wt_dbout_profiles_ck1;
105+
update wt_dbout_profiles set status = 'IGNR' where status = 'ANNO';
106+
alter table wt_dbout_profiles add constraint wt_dbout_profiles_ck1 check (status in ('EXEC','NOTX','EXCL','IGNR','UNKN'));
107+
108+
@update_all_stats
109+
110+
-- Package Specifications
111+
112+
@../../wtplsql.pks
113+
/
114+
@../../wt_result.pks
115+
/
116+
@../../wt_assert.pks
117+
/
118+
@../../wt_profiler.pks
119+
/
120+
@../../wt_test_run_stat.pks
121+
/
122+
@../../wt_text_report.pks
123+
/
124+
125+
grant execute on wtplsql to public;
126+
grant execute on wt_assert to public;
127+
grant execute on wt_text_report to public;
128+
129+
130+
-- Package Bodies
131+
@../../wtplsql.pkb
132+
/
133+
@../../wt_result.pkb
134+
/
135+
@../../wt_assert.pkb
136+
/
137+
@../../wt_profiler.pkb
138+
/
139+
@../../wt_test_run_stat.pkb
140+
/
141+
@../../wt_text_report.pkb
142+
/
143+
144+
set showmode on
145+
spool off

src/core/wt_test_runs.tab

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ comment on column wt_test_runs.profiler_runid is 'Optional DBMS_PROFILER unique
4343
comment on column wt_test_runs.error_message is 'Optional Last error messages from this Test Run.';
4444

4545
grant select on wt_test_runs to public;
46-
grant insert on wt_test_runs to public;
4746
grant delete on wt_test_runs to public;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy