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

Skip to content

Commit 81240fb

Browse files
committed
Updated install and deinstall
1 parent dd63970 commit 81240fb

4 files changed

Lines changed: 94 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
create or replace type body ut_include as
2+
/*
3+
utPLSQL - Version 3
4+
Copyright 2016 - 2018 utPLSQL Project
5+
6+
Licensed under the Apache License, Version 2.0 (the "License"):
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
member procedure init(self in out nocopy ut_include, a_expected ut_data_value) is
20+
begin
21+
self.self_type := $$plsql_unit;
22+
self.expected := a_expected;
23+
self.include_list := ut_varchar2_list();
24+
self.exclude_list := ut_varchar2_list();
25+
self.join_columns := ut_varchar2_list();
26+
end;
27+
28+
constructor function ut_include(self in out nocopy ut_include, a_expected sys_refcursor) return self as result is
29+
begin
30+
init(ut_data_value_refcursor(a_expected));
31+
return;
32+
end;
33+
34+
member function get_inclusion_compare return boolean is
35+
begin
36+
return true;
37+
end;
38+
39+
overriding member function run_matcher(self in out nocopy ut_include, a_actual ut_data_value) return boolean is
40+
l_result boolean;
41+
begin
42+
if self.expected.data_type = a_actual.data_type then
43+
l_result := 0 = treat(self.expected as ut_data_value_refcursor).compare_implementation(a_actual, self.get_exclude_xpath(), self.get_include_xpath(), self.get_join_by_xpath(),
44+
true,get_inclusion_compare());
45+
else
46+
l_result := (self as ut_matcher).run_matcher(a_actual);
47+
end if;
48+
return l_result;
49+
end;
50+
51+
overriding member function failure_message(a_actual ut_data_value) return varchar2 is
52+
l_result varchar2(32767);
53+
begin
54+
if self.expected.data_type = a_actual.data_type and self.expected.is_diffable then
55+
l_result :=
56+
'Actual: '||a_actual.get_object_info()||' '||self.description()||': '||self.expected.get_object_info()
57+
|| chr(10) || 'Diff:' || expected.diff(a_actual, self.get_exclude_xpath(), self.get_include_xpath(), self.get_join_by_xpath(), true);
58+
else
59+
l_result := (self as ut_matcher).failure_message(a_actual) || ': '|| self.expected.to_string_report();
60+
end if;
61+
return l_result;
62+
end;
63+
64+
end;
65+
/
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
create or replace type ut_include under ut_equal(
2+
/*
3+
utPLSQL - Version 3
4+
Copyright 2016 - 2018 utPLSQL Project
5+
6+
Licensed under the Apache License, Version 2.0 (the "License"):
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
*/
18+
19+
member procedure init(self in out nocopy ut_include, a_expected ut_data_value),
20+
constructor function ut_include(self in out nocopy ut_include, a_expected sys_refcursor) return self as result,
21+
member function get_inclusion_compare return boolean,
22+
overriding member function run_matcher(self in out nocopy ut_include, a_actual ut_data_value) return boolean,
23+
overriding member function failure_message(a_actual ut_data_value) return varchar2
24+
)
25+
/

source/install.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ prompt Installing DBMSPLSQL Tables objects into &&ut3_owner schema
203203
@@install_component.sql 'expectations/matchers/ut_be_null.tps'
204204
@@install_component.sql 'expectations/matchers/ut_be_true.tps'
205205
@@install_component.sql 'expectations/matchers/ut_equal.tps'
206+
@@install_component.sql 'expectations/matchers/ut_include.tps'
206207
@@install_component.sql 'expectations/matchers/ut_have_count.tps'
207208
@@install_component.sql 'expectations/matchers/ut_be_between.tps'
208209
@@install_component.sql 'expectations/matchers/ut_be_empty.tps'
@@ -241,6 +242,7 @@ prompt Installing DBMSPLSQL Tables objects into &&ut3_owner schema
241242
@@install_component.sql 'expectations/matchers/ut_be_null.tpb'
242243
@@install_component.sql 'expectations/matchers/ut_be_true.tpb'
243244
@@install_component.sql 'expectations/matchers/ut_equal.tpb'
245+
@@install_component.sql 'expectations/matchers/ut_include.tpb'
244246
@@install_component.sql 'expectations/matchers/ut_have_count.tpb'
245247
@@install_component.sql 'expectations/matchers/ut_be_between.tpb'
246248
@@install_component.sql 'expectations/matchers/ut_be_empty.tpb'

source/uninstall_objects.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ drop type ut_match force;
6969

7070
drop type ut_be_between force;
7171

72+
drop type ut_include force;
73+
7274
drop type ut_equal force;
7375

7476
drop type ut_be_true force;

0 commit comments

Comments
 (0)