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

Skip to content

Commit e4043b5

Browse files
committed
Updates to include nested an collections
1 parent 6726f1a commit e4043b5

4 files changed

Lines changed: 11 additions & 7 deletions

File tree

source/expectations/data_values/ut_compound_data_helper.pkb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ create or replace package body ut_compound_data_helper is
543543
--TODO : Collection is intersting exmaple that we probably has to extract full xml and hash it.
544544
ut_utils.append_to_clob(a_partition_stmt,', row_number() over (partition by ');
545545
for i in 1..l_cursor_info.count loop
546-
if l_cursor_info(i).is_user_defined = 0 then
546+
if l_cursor_info(i).has_nested_col = 0 then
547547
l_col_name := case when l_cursor_info(i).parent_name is null then
548548
l_cursor_info(i).xml_valid_name
549549
else
@@ -690,7 +690,6 @@ create or replace package body ut_compound_data_helper is
690690
end if;
691691
ut_utils.append_to_clob(l_compare_sql,l_temp_string);
692692

693-
--dbms_output.put_line(l_compare_sql);
694693
return l_compare_sql;
695694
end;
696695

source/expectations/data_values/ut_cursor_column.tpb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ create or replace type body ut_cursor_column as
2323
self.xml_valid_name := '"'||self.column_name||'"';
2424
self.column_type := a_col_type;
2525
self.column_schema := a_col_schema_name;
26-
self.is_sql_diffable := ut_utils.boolean_to_int(ut_curr_usr_compound_helper.is_sql_compare_allowed(self.column_type));
26+
self.is_sql_diffable := case when lower(self.column_type) = 'user_defined_type' then
27+
0
28+
else
29+
ut_utils.boolean_to_int(ut_curr_usr_compound_helper.is_sql_compare_allowed(self.column_type))
30+
end;
31+
--TODO : Part of the constructor same as has nested ??
2732
self.is_collection := ut_utils.boolean_to_int(ut_curr_usr_compound_helper.is_collection(a_col_schema_name,a_col_type_name));
2833
--TODO : fix that as is nasty hardcode
29-
self.is_user_defined := case when lower(self.column_type) = 'user_defined_type' then 1 else 0 end;
34+
self.has_nested_col := case when lower(self.column_type) = 'user_defined_type' and self.is_collection = 0 then 1 else 0 end;
3035
end;
3136

3237
constructor function ut_cursor_column( self in out nocopy ut_cursor_column,

source/expectations/data_values/ut_cursor_column.tps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ create or replace type ut_cursor_column force authid current_user as object
22
(
33
parent_name varchar2(100),
44
access_path varchar2(500),
5+
has_nested_col number(1,0),
56
nested_name varchar2(32),
67
hierarchy_level number,
78
column_position number,
@@ -15,7 +16,6 @@ create or replace type ut_cursor_column force authid current_user as object
1516
column_scale integer,
1617
is_sql_diffable number(1, 0),
1718
is_collection number(1, 0),
18-
is_user_defined number(1, 0),
1919

2020
member procedure init(self in out nocopy ut_cursor_column,
2121
a_col_name varchar2, a_col_schema_name varchar2,

test/core/expectations/test_expectations_cursor.pkb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,9 +1542,9 @@ Diff:%
15421542
ut3.ut.expect(l_actual).to_equal(l_expected).unordered;
15431543
l_expected_message := q'[%Actual: refcursor [ count = 2 ] was expected to equal: refcursor [ count = 3 ]%
15441544
Diff:%
1545-
Rows: [ 5 differences 1
1546-
%Extra: <COLVAL><ID>1</ID><name>Something 1</name><Value>1</Value></COLVAL>%
1545+
Rows: [ 5 differences%
15471546
%Extra: <COLVAL><ID>2</ID><name>Something 2</name><Value>2</Value></COLVAL>%
1547+
%Extra: <COLVAL><ID>1</ID><name>Something 1</name><Value>1</Value></COLVAL>%
15481548
%Missing: <COLVAL><ID>1</ID><name>Somethings 1</name><Value>1</Value></COLVAL>%
15491549
%Missing: <COLVAL><ID>2</ID><name>Somethings 2</name><Value>2</Value></COLVAL>%
15501550
%Missing: <COLVAL><ID>3</ID><name>Somethings 3</name><Value>3</Value></COLVAL>%]';

0 commit comments

Comments
 (0)