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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix the RunAll.sql script
  • Loading branch information
Pazus committed Dec 7, 2016
commit 829833b0f756090adff99c650a84918b80067a2b
38 changes: 16 additions & 22 deletions tests/RunAll.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ set serveroutput on size unlimited format truncated
create table ut$test_table (val varchar2(1));
@@helpers/ut_transaction_control.pck
@@helpers/department.tps
@@helpers/test_package_3.pck
@@helpers/test_package_1.pck
@@helpers/test_package_2.pck

--Tests to invoke

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

@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheSchema.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByPath.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByPath.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByPath.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByName.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByName.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByName.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureByPath.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageProcedureByPath.sql

@@lib/RunTest.sql ut_output_dbms_pipe/ut_output_dbms_pipe.close.TimesOutAfterAGivenPeriodOfTimeAndRemovesPipe.sql
@@lib/RunTest.sql ut_output_dbms_pipe/ut_output_dbms_pipe.get_clob_lines.ReturnsSentLines.sql
@@lib/RunTest.sql ut_output_dbms_pipe/ut_output_dbms_pipe.get_lines.ReturnsSentLines.sql
Expand All @@ -178,28 +191,9 @@ drop procedure check_annotation_parsing;
drop package ut_transaction_control;
drop table ut$test_table;
drop type department$;

-- at this point we have to be ready that it's the only packages with annotation in the schema
@@helpers/test_package_1.pck
@@helpers/test_package_2.pck
@@helpers/test_package_3.pck

@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheSchema.sql

@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByPath.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByPath.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByPath.sql

@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByName.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByName.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByName.sql

@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureByPath.sql
@@lib/RunTest.sql ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageProcedureByPath.sql

drop package test_package_1.pck
drop package test_package_2.pck
drop package test_package_3.pck
drop package test_package_1;
drop package test_package_2;
drop package test_package_3;

--Finally
@@lib/RunSummary
Expand Down
69 changes: 69 additions & 0 deletions tests/helpers/test_package_3.pck
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
create or replace package test_package_3 is

--%suite
--%suitepackage(tests2)

gv_glob_val number;

--%setup
procedure global_setup;

--%teardown
procedure global_teardown;

--%test
procedure test1;

--%test
--%testsetup(test2_setup)
--%testteardown(test2_teardown)
procedure test2;

procedure test2_setup;

procedure test2_teardown;

end test_package_3;
/
create or replace package body test_package_3 is

gv_var_1 number;

gv_var_1_temp number;

procedure global_setup is
begin
gv_var_1 := 1;
gv_glob_val := 1;
end;

procedure global_teardown is
begin
gv_var_1 := 0;
gv_glob_val := 0;
end;

procedure test1 is
begin
ut.expect(gv_var_1).to_equal(1);
end;

procedure test2 is
begin
ut.expect(gv_var_1).to_equal(2);
end;

procedure test2_setup is
begin
gv_var_1_temp := gv_var_1;
gv_var_1 := 2;
end;

procedure test2_teardown is
begin
gv_var_1 := gv_var_1_temp;
gv_var_1_temp := null;
end;

end test_package_3;
/
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PROMPT Prepare runner for the schema

--Arrange
declare
c_path varchar2(100) := user;
c_path varchar2(100) := USER;
l_objects_to_run ut_objects_list;

l_test0_suite ut_test_suite;
Expand Down