Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
898fe26
Updated project version after build [skip ci]
Sep 3, 2019
c59671d
Merge branch 'master' into develop
jgebal Sep 4, 2019
307a169
Updated version to 3.1.9
jgebal Sep 4, 2019
83b66c0
Updated project version after build [skip ci]
Sep 4, 2019
3c88874
Update .gitattributes
Pazus Sep 10, 2019
2de010d
Update .gitattributes
Pazus Sep 10, 2019
f1e5c89
Merge pull request #991 from utPLSQL/linguist-language-PLSQL
PhilippSalvisberg Sep 10, 2019
a3faea4
Updated project version after build [skip ci]
Sep 10, 2019
3ef06eb
Fix check of sys grants with ANY (issue #992)
mickev-of Sep 12, 2019
976ab4d
Merge pull request #993 from MickeVr/develop
jgebal Sep 13, 2019
48b9d2e
Updated project version after build [skip ci]
Sep 13, 2019
c61f954
Corrected rebuild_annotation_cache parameter
abasharin Sep 20, 2019
8739173
Merge pull request #995 from abasharin/develop
jgebal Sep 21, 2019
a02eed8
Updated project version after build [skip ci]
Sep 21, 2019
169d0fe
Changed names on internal columns in cursor & object compare.
jgebal Sep 22, 2019
f3cfc18
Merge pull request #999 from utPLSQL/feature/cursor_compare_columns
jgebal Sep 23, 2019
ba6243b
Updated project version after build [skip ci]
Sep 23, 2019
41ef9bb
Fixed test dependency.
jgebal Sep 27, 2019
87db227
Merge pull request #1001 from utPLSQL/fix/unit_test_dependency
jgebal Sep 27, 2019
14b6243
Fixed issue with stack parsing on Windows install of utPLSQL
jgebal Sep 27, 2019
268a65b
Merge pull request #1002 from utPLSQL/bugfix/call_stack_parsing
jgebal Sep 28, 2019
2f89527
Updated project version after build [skip ci]
Sep 28, 2019
48a3f9e
Make "Version 2 to 3 comparison" an actual section in readme
pesse Oct 11, 2019
f8a3b87
Outsource the Version comparison to a separate file so it can be
pesse Oct 11, 2019
40badac
Describe the usage of tags in the "Running"-section
pesse Oct 11, 2019
4cfb0cf
Add link to Tag-annotation and tweak for consistency
pesse Oct 11, 2019
d7c3a2f
Just trying to replace Java 9 with Java 11
pesse Oct 11, 2019
0506cf1
Trying with OpenJDK instead
pesse Oct 14, 2019
4252647
Update cli version to 3.1.7
jgebal Oct 20, 2019
c035df7
Merge pull request #1005 from utPLSQL/bugfix/missing_java9_package
jgebal Oct 20, 2019
cdd7feb
Updated project version after build [skip ci]
Oct 20, 2019
a0ba9ad
Merge remote-tracking branch 'origin/develop' into feature/docs_impro…
jgebal Oct 20, 2019
afca248
Fixed broken doc link
jgebal Oct 20, 2019
cdb6d3e
Added ability to exclude items by tags.
jgebal Oct 20, 2019
0d64c08
Changed syntax to avoid Oracle internal errors on 11.2 and 12.1
jgebal Oct 21, 2019
492f9e1
Merge pull request #1004 from utPLSQL/feature/docs_improvement
jgebal Oct 21, 2019
68e625f
Updated project version after build [skip ci]
Oct 21, 2019
49c0768
Merge remote-tracking branch 'origin/develop' into feature/exclude_paths
jgebal Oct 21, 2019
f48e7e5
Improve documentation around tags
pesse Oct 22, 2019
2caa749
Use cli 3.1.8
pesse Oct 22, 2019
eebfba0
Added support for nested contexts.
jgebal Oct 23, 2019
66dde90
Merge pull request #1008 from utPLSQL/feature/exclude_paths
jgebal Oct 23, 2019
d367d52
Updated project version after build [skip ci]
Oct 23, 2019
c5f81eb
Fixing failing tests
jgebal Oct 23, 2019
837bd47
Merge remote-tracking branch 'origin/develop' into feature/nested_con…
jgebal Oct 23, 2019
e1dfd05
Updated documentation.
jgebal Oct 23, 2019
0070cf8
changed hard stop to "full stop/period"
jgebal Oct 23, 2019
8f0b267
Cleanup
jgebal Oct 23, 2019
c905233
Added downloads badge
jgebal Oct 24, 2019
7ec0751
Merge pull request #1014 from utPLSQL/feature/download_badge
jgebal Oct 25, 2019
b07d0e9
Updated project version after build [skip ci]
Oct 25, 2019
06a6881
Updated description of annotation types
jgebal Oct 25, 2019
2abd27e
Merge remote-tracking branch 'origin/develop' into feature/nested_con…
jgebal Oct 25, 2019
409a70e
Merge pull request #1015 from utPLSQL/feature/update_annotation_doc
jgebal Oct 26, 2019
c69af46
Updated project version after build [skip ci]
Oct 26, 2019
be39586
Added support for `--%name` annotation, to name the contexts.
jgebal Oct 27, 2019
7740ec2
Merge pull request #1013 from utPLSQL/feature/nested_context
jgebal Nov 1, 2019
4ca4ea8
Updated project version after build [skip ci]
Nov 1, 2019
bc49a81
Fixed issue fit false-positive warnings on suites with multiple conte…
jgebal Nov 2, 2019
cc3114c
Merge pull request #1017 from utPLSQL/feature/fix_contexts
jgebal Nov 2, 2019
b08ede3
Updated project version after build [skip ci]
Nov 2, 2019
57a89ba
Touch readme to kickoff build.
jgebal Nov 5, 2019
00d0fb4
Updated project version after build [skip ci]
Nov 5, 2019
c724493
Updated documentation.
jgebal Nov 6, 2019
05c063f
Dash-> hyphen
jgebal Nov 6, 2019
2f089b3
Updated project version after build [skip ci]
Nov 6, 2019
5b5ca12
Fixing issue with sonar token.
jgebal Nov 9, 2019
e1b8ee6
Updated project version after build [skip ci]
Nov 9, 2019
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
Next Next commit
Changed names on internal columns in cursor & object compare.
Columns:
 - ITEM_DATA
 - DATA_ID
 - ITEM_NO
 - DUP_NO
 - POSITION
Can now be safely used in cursors.
Resolves #997

Added delete on DIFF temp tables after cursor / object compare.
Resolves #998
  • Loading branch information
jgebal committed Sep 22, 2019
commit 169d0fe07c69339d7b1bc5ca4965c307cdcb7f3c
54 changes: 28 additions & 26 deletions source/expectations/data_values/ut_compound_data_helper.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,46 @@ create or replace package body ut_compound_data_helper is
with exp as (
select
ucd.*,
{:duplicate_number:} dup_no
{:duplicate_number:} "UT3$_Dup#No"
from (
select
ucd.item_data
,x.data_id data_id
,position + x.item_no item_no
ucd."UT3$_Item#Data"
,x.data_id "UT3$_Data#Id"
,ucd."UT3$_Position#" + x.item_no "UT3$_Item#No"
{:columns:}
from ut_compound_data_tmp x,
xmltable('/ROWSET/ROW' passing x.item_data columns
item_data xmltype path '*'
,position for ordinality
"UT3$_Item#Data" xmltype path '*'
,"UT3$_Position#" for ordinality
{:xml_to_columns:} ) ucd
where data_id = :exp_guid
where x.data_id = :exp_guid
) ucd
)
, act as (
select
ucd.*,
{:duplicate_number:} dup_no
{:duplicate_number:} "UT3$_Dup#No"
from (
select
ucd.item_data
,x.data_id data_id
,position + x.item_no item_no
ucd."UT3$_Item#Data"
,x.data_id "UT3$_Data#Id"
,ucd."UT3$_Position#" + x.item_no "UT3$_Item#No"
{:columns:}
from ut_compound_data_tmp x,
xmltable('/ROWSET/ROW' passing x.item_data columns
item_data xmltype path '*'
,position for ordinality
"UT3$_Item#Data" xmltype path '*'
,"UT3$_Position#" for ordinality
{:xml_to_columns:} ) ucd
where data_id = :act_guid
where x.data_id = :act_guid
) ucd
)
select
a.item_data as act_item_data,
a.data_id act_data_id,
e.item_data as exp_item_data,
e.data_id exp_data_id,
a."UT3$_Item#Data" as act_item_data,
a."UT3$_Data#Id" act_data_id,
e."UT3$_Item#Data" as exp_item_data,
e."UT3$_Data#Id" exp_data_id,
{:item_no:} as item_no,
nvl(e.dup_no,a.dup_no) dup_no
nvl(e."UT3$_Dup#No",a."UT3$_Dup#No") dup_no
from act a {:join_type:} exp e on ( {:join_condition:} )
where {:where_condition:}]';

Expand Down Expand Up @@ -306,16 +306,16 @@ create or replace package body ut_compound_data_helper is
a_join_by_stmt := ut_utils.table_to_clob(l_join_by_list, ' and ');
elsif a_unordered then
-- If no key defined do the join on all columns
a_join_by_stmt := ' e.dup_no = a.dup_no and '||ut_utils.table_to_clob(l_equal_list, ' and ');
a_join_by_stmt := ' e."UT3$_Dup#No" = a."UT3$_Dup#No" and '||ut_utils.table_to_clob(l_equal_list, ' and ');
else
-- Else join on rownumber
a_join_by_stmt := 'a.item_no = e.item_no ';
a_join_by_stmt := 'a."UT3$_Item#No" = e."UT3$_Item#No" ';
end if;
a_not_equal_stmt := ut_utils.table_to_clob(l_not_equal_list, ' or ');
else
--Partition by piece when no data
ut_utils.append_to_clob(a_partition_stmt,' 1 ');
a_join_by_stmt := 'a.item_no = e.item_no ';
a_join_by_stmt := 'a."UT3$_Item#No" = e."UT3$_Item#No" ';
end if;
end;

Expand Down Expand Up @@ -349,8 +349,8 @@ create or replace package body ut_compound_data_helper is
begin
return
case
when a_unordered then 'row_number() over ( order by nvl(e.item_no,a.item_no))'
else 'nvl(e.item_no,a.item_no) '
when a_unordered then 'row_number() over ( order by nvl(e."UT3$_Item#No",a."UT3$_Item#No"))'
else 'nvl(e."UT3$_Item#No",a."UT3$_Item#No") '
end;
end;

Expand Down Expand Up @@ -387,9 +387,9 @@ create or replace package body ut_compound_data_helper is
end if;
--If its inclusion we expect a actual set to fully match and have no extra elements over expected
if a_inclusion_type then
ut_utils.append_to_clob(l_where_stmt,case when a_is_negated then ' 1 = 1 ' else ' ( a.data_id is null ) ' end);
ut_utils.append_to_clob(l_where_stmt,case when a_is_negated then ' 1 = 1 ' else ' ( a."UT3$_Data#Id" is null ) ' end);
else
ut_utils.append_to_clob(l_where_stmt,' (a.data_id is null or e.data_id is null) ');
ut_utils.append_to_clob(l_where_stmt,' (a."UT3$_Data#Id" is null or e."UT3$_Data#Id" is null) ');
end if;

l_compare_sql := replace(l_compare_sql,'{:where_condition:}',l_where_stmt);
Expand Down Expand Up @@ -561,6 +561,8 @@ create or replace package body ut_compound_data_helper is
procedure cleanup_diff is
begin
g_diff_count := 0;
delete from ut_compound_data_diff_tmp;
delete from ut_json_data_diff_tmp;
end;

function get_rows_diff_count return integer is
Expand Down
45 changes: 45 additions & 0 deletions test/ut3_user/expectations/test_expectations_cursor.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -2825,5 +2825,50 @@ Check the query and data for errors.';
$end
end;

procedure compare_specific_column_names is
function get_cursor return sys_refcursor is
l_result sys_refcursor;
begin
open l_result for
select 'a' as item_data, rownum as data_id, rownum as item_no, rownum as dup_no, rownum as position from dual;
return l_result;
end;
begin
ut3.ut.expect(get_cursor()).to_equal(get_cursor());
ut3.ut.expect(get_cursor()).to_equal(get_cursor()).unordered();
ut3.ut.expect(get_cursor()).to_equal(get_cursor()).join_by('ITEM_DATA,DATA_ID,ITEM_NO,DUP_NO');
--Assert
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
end;

procedure multiple_cursor_expectations is
l_actual sys_refcursor;
l_expected sys_refcursor;
begin
open l_actual for select rownum rn from dual connect by level < 5;
open l_expected for select rownum rn from dual connect by level = 1;
ut3.ut.expect(l_actual).to_equal(l_expected);
open l_actual for select rownum rn from dual connect by level < 3;
open l_expected for select * from (select rownum rn from dual connect by level < 3) order by 1 desc;
ut3.ut.expect(l_actual).to_equal(l_expected);
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations(1)).to_equal(
'Actual: refcursor [ count = 4 ] was expected to equal: refcursor [ count = 1 ]
Diff:
Rows: [ 3 differences ]
Row No. 2 - Extra: <RN>2</RN>
Row No. 3 - Extra: <RN>3</RN>
Row No. 4 - Extra: <RN>4</RN>'
);
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations(2)).to_equal(
'Actual: refcursor [ count = 2 ] was expected to equal: refcursor [ count = 2 ]
Diff:
Rows: [ 2 differences ]
Row No. 1 - Actual: <RN>1</RN>
Row No. 1 - Expected: <RN>2</RN>
Row No. 2 - Actual: <RN>2</RN>
Row No. 2 - Expected: <RN>1</RN>'
);
end;

end;
/
8 changes: 7 additions & 1 deletion test/ut3_user/expectations/test_expectations_cursor.pks
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,14 @@ create or replace package test_expectations_cursor is
--%test( Mixed column order exclusion )
procedure uc_columns_exclude;

--%test(Compares cursors with long column names - Issue #952 )
--%test( Compares cursors with long column names - Issue #952 )
procedure compare_long_column_names;

--%test( Compares cursors with specific column names - Issue #997 )
procedure compare_specific_column_names;

--%test( Multiple failures reported correctly - Issue #998 )
procedure multiple_cursor_expectations;

end;
/