Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 829833b

Browse files
committed
fix the RunAll.sql script
1 parent 40554c9 commit 829833b

3 files changed

Lines changed: 86 additions & 23 deletions

File tree

tests/RunAll.sql

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ set serveroutput on size unlimited format truncated
1515
create table ut$test_table (val varchar2(1));
1616
@@helpers/ut_transaction_control.pck
1717
@@helpers/department.tps
18+
@@helpers/test_package_3.pck
19+
@@helpers/test_package_1.pck
20+
@@helpers/test_package_2.pck
1821

1922
--Tests to invoke
2023

@@ -160,6 +163,16 @@ create table ut$test_table (val varchar2(1));
160163
@@lib/RunTest.sql ut_utils/ut_utils.to_string.verySmallNumber.sql
161164
@@ut_utils/ut_utils.clob_to_table.sql
162165

166+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheSchema.sql
167+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByPath.sql
168+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByPath.sql
169+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByPath.sql
170+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByName.sql
171+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByName.sql
172+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByName.sql
173+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureByPath.sql
174+
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageProcedureByPath.sql
175+
163176
@@lib/RunTest.sql ut_output_dbms_pipe/ut_output_dbms_pipe.close.TimesOutAfterAGivenPeriodOfTimeAndRemovesPipe.sql
164177
@@lib/RunTest.sql ut_output_dbms_pipe/ut_output_dbms_pipe.get_clob_lines.ReturnsSentLines.sql
165178
@@lib/RunTest.sql ut_output_dbms_pipe/ut_output_dbms_pipe.get_lines.ReturnsSentLines.sql
@@ -178,28 +191,9 @@ drop procedure check_annotation_parsing;
178191
drop package ut_transaction_control;
179192
drop table ut$test_table;
180193
drop type department$;
181-
182-
-- at this point we have to be ready that it's the only packages with annotation in the schema
183-
@@helpers/test_package_1.pck
184-
@@helpers/test_package_2.pck
185-
@@helpers/test_package_3.pck
186-
187-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheSchema.sql
188-
189-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByPath.sql
190-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByPath.sql
191-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByPath.sql
192-
193-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByName.sql
194-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByName.sql
195-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByName.sql
196-
197-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureByPath.sql
198-
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageProcedureByPath.sql
199-
200-
drop package test_package_1.pck
201-
drop package test_package_2.pck
202-
drop package test_package_3.pck
194+
drop package test_package_1;
195+
drop package test_package_2;
196+
drop package test_package_3;
203197

204198
--Finally
205199
@@lib/RunSummary

tests/helpers/test_package_3.pck

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
create or replace package test_package_3 is
2+
3+
--%suite
4+
--%suitepackage(tests2)
5+
6+
gv_glob_val number;
7+
8+
--%setup
9+
procedure global_setup;
10+
11+
--%teardown
12+
procedure global_teardown;
13+
14+
--%test
15+
procedure test1;
16+
17+
--%test
18+
--%testsetup(test2_setup)
19+
--%testteardown(test2_teardown)
20+
procedure test2;
21+
22+
procedure test2_setup;
23+
24+
procedure test2_teardown;
25+
26+
end test_package_3;
27+
/
28+
create or replace package body test_package_3 is
29+
30+
gv_var_1 number;
31+
32+
gv_var_1_temp number;
33+
34+
procedure global_setup is
35+
begin
36+
gv_var_1 := 1;
37+
gv_glob_val := 1;
38+
end;
39+
40+
procedure global_teardown is
41+
begin
42+
gv_var_1 := 0;
43+
gv_glob_val := 0;
44+
end;
45+
46+
procedure test1 is
47+
begin
48+
ut.expect(gv_var_1).to_equal(1);
49+
end;
50+
51+
procedure test2 is
52+
begin
53+
ut.expect(gv_var_1).to_equal(2);
54+
end;
55+
56+
procedure test2_setup is
57+
begin
58+
gv_var_1_temp := gv_var_1;
59+
gv_var_1 := 2;
60+
end;
61+
62+
procedure test2_teardown is
63+
begin
64+
gv_var_1 := gv_var_1_temp;
65+
gv_var_1_temp := null;
66+
end;
67+
68+
end test_package_3;
69+
/

tests/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheSchema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PROMPT Prepare runner for the schema
22

33
--Arrange
44
declare
5-
c_path varchar2(100) := user;
5+
c_path varchar2(100) := USER;
66
l_objects_to_run ut_objects_list;
77

88
l_test0_suite ut_test_suite;

0 commit comments

Comments
 (0)