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

Skip to content

Release/v3.1.6 #875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Mar 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.1.5
v3.1.6
5 changes: 4 additions & 1 deletion development/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ To create a release:
- merge the release branch to master and wait for master build to complete successfully
- create a release from the master branch using [github releases page](https://github.com/utPLSQL/utPLSQL/releases) and populate release description using information found on the issues and pull requests since previous release.
To find issues closed after certain date use [advanced filters](https://help.github.com/articles/searching-issues-and-pull-requests/#search-by-open-or-closed-state).
Example: [`is:issue closed:>2018-07-22`](https://github.com/utPLSQL/utPLSQL/issues?utf8=%E2%9C%93&q=is%3Aissue+closed%3A%3E2018-07-22+)
Example: [`is:issue closed:>2018-07-22`](https://github.com/utPLSQL/utPLSQL/issues?utf8=%E2%9C%93&q=is%3Aissue+closed%3A%3E2018-07-22+)
- After release was successfully built, merge master branch back into develop branch
- After develop branch was built, update version number in `VERSION` file to represent next planned release version.
- Clone `utplsql.githug.io` project and add a new announcement about next version being released in `_posts`. Use previous announcements as a template. Make sure to set date, time and post title properly.

The following will happen:
- build executed on branch `release/vX.Y.Z-[something]` updates files `sonar-project.properties`, `VERSION` with project version derived from the release branch name
Expand Down
2 changes: 1 addition & 1 deletion docs/about/authors.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

### utPLSQL v3 Major Contributors

Expand Down
2 changes: 1 addition & 1 deletion docs/about/license.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Version Information

Expand Down
2 changes: 1 addition & 1 deletion docs/about/project-details.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# utPLSQL Project Details

Expand Down
2 changes: 1 addition & 1 deletion docs/about/support.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# How to get support

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Introduction to utPLSQL

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/advanced_data_comparison.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Advanced data comparison

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/annotations.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Annotations

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/best-practices.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Best Practices

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/coverage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Coverage
utPLSQL comes with a built-in coverage reporting engine. The code coverage reporting is based on the DBMS_PROFILER package provided with Oracle database.
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/exception-reporting.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Exception handling and reporting

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/expectations.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Expectation concepts
Validation of the code under test (the tested logic of procedure/function etc.) is performed by comparing the actual data against the expected data.
Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Getting started with TDD and utPLSQL

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/install.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Downloading latest version of utPLSQL

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/querying_suites.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Qyerying for test suites

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/reporters.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

utPLSQL provides the following reporting formats.

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/running-unit-tests.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Running tests

Expand Down
2 changes: 1 addition & 1 deletion docs/userguide/upgrade.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![version](https://img.shields.io/badge/version-v3.1.5.2707-blue.svg)
![version](https://img.shields.io/badge/version-v3.1.6.2729-blue.svg)

# Upgrading from version 2

Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sonar.projectKey=utPLSQL
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=utPLSQL
sonar.projectVersion=v3.1.5
sonar.projectVersion=v3.1.6

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
Expand Down
2 changes: 1 addition & 1 deletion source/core/ut_utils.pks
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ create or replace package ut_utils authid definer is
*
*/

gc_version constant varchar2(50) := 'v3.1.5.2707';
gc_version constant varchar2(50) := 'v3.1.6.2729';

subtype t_executable_type is varchar2(30);
gc_before_all constant t_executable_type := 'beforeall';
Expand Down
4 changes: 0 additions & 4 deletions source/create_synonyms_and_grants_for_public.sql
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ grant select, insert, delete, update on &&ut3_owner..dbmspcc_units to public;
grant execute on &&ut3_owner..ut_matcher_options to public;
grant execute on &&ut3_owner..ut_matcher_options_items to public;
grant execute on &&ut3_owner..ut_run_info to public;
grant execute on &&ut3_owner..ut_cursor_column_tab to public;
grant execute on &&ut3_owner..ut_cursor_details to public;

prompt Creating synonyms for UTPLSQL objects in &&ut3_owner schema to PUBLIC

Expand Down Expand Up @@ -169,5 +167,3 @@ create public synonym dbmspcc_blocks for &&ut3_owner..dbmspcc_blocks;
create public synonym dbmspcc_runs for &&ut3_owner..dbmspcc_runs;
create public synonym dbmspcc_units for &&ut3_owner..dbmspcc_units;
create public synonym ut_run_info for &&ut3_owner..ut_run_info;
create public synonym ut_cursor_column_tab for &&ut3_owner..ut_cursor_column_tab;
create public synonym ut_cursor_details for &&ut3_owner..ut_cursor_details;
2 changes: 0 additions & 2 deletions source/create_user_grants.sql
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,3 @@ grant select, insert, delete, update on &&ut3_owner..dbmspcc_units to &ut3_user;
grant execute on &&ut3_owner..ut_matcher_options to &ut3_user;
grant execute on &&ut3_owner..ut_matcher_options_items to &ut3_user;
grant execute on &&ut3_owner..ut_run_info to &ut3_user;
grant execute on &&ut3_owner..ut_cursor_column_tab to &ut3_user;
grant execute on &&ut3_owner..ut_cursor_details to &ut3_user;
2 changes: 0 additions & 2 deletions source/create_user_synonyms.sql
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,3 @@ create or replace synonym &ut3_user..dbmspcc_blocks for &&ut3_owner..dbmspcc_blo
create or replace synonym &ut3_user..dbmspcc_runs for &&ut3_owner..dbmspcc_runs;
create or replace synonym &ut3_user..dbmspcc_units for &&ut3_owner..dbmspcc_units;
create or replace synonym &ut3_user..ut_run_info for &&ut3_owner..ut_run_info;
create or replace synonym &ut3_user..ut_cursor_column_tab for &&ut3_owner..ut_cursor_column_tab;
create or replace synonym &ut3_user..ut_cursor_details for &&ut3_owner..ut_cursor_details;
16 changes: 13 additions & 3 deletions source/expectations/data_values/ut_compound_data_helper.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ create or replace package body ut_compound_data_helper is
execute immediate q'[with
expected_cols as (
select access_path exp_column_name,column_position exp_col_pos,
replace(column_type,'VARCHAR2','CHAR') exp_col_type_compare, column_type exp_col_type
replace(column_type_name,'VARCHAR2','CHAR') exp_col_type_compare, column_type_name exp_col_type
from table(:a_expected)
where parent_name is null and hierarchy_level = 1 and column_name is not null
),
actual_cols as (
select access_path act_column_name,column_position act_col_pos,
replace(column_type,'VARCHAR2','CHAR') act_col_type_compare, column_type act_col_type
from table(:a_actual)),
replace(column_type_name,'VARCHAR2','CHAR') act_col_type_compare, column_type_name act_col_type
from table(:a_actual)
where parent_name is null and hierarchy_level = 1 and column_name is not null
),
joined_cols as (
select e.*,a.*]'
|| case when a_order_enforced then ',
Expand Down Expand Up @@ -586,6 +589,13 @@ create or replace package body ut_compound_data_helper is
end;
end;

function get_compare_cursor(a_diff_cursor_text in clob,a_self_id raw, a_other_id raw) return sys_refcursor is
l_diff_cursor sys_refcursor;
begin
open l_diff_cursor for a_diff_cursor_text using a_self_id, a_other_id;
return l_diff_cursor;
end;

begin
g_anytype_name_map(dbms_types.typecode_date) := 'DATE';
g_anytype_name_map(dbms_types.typecode_number) := 'NUMBER';
Expand Down
4 changes: 3 additions & 1 deletion source/expectations/data_values/ut_compound_data_helper.pks
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ create or replace package ut_compound_data_helper authid definer is
function is_sql_compare_allowed(a_type_name varchar2) return boolean;

function get_column_type_desc(a_type_code in integer, a_dbms_sql_desc in boolean) return varchar2;


function get_compare_cursor(a_diff_cursor_text in clob,a_self_id raw, a_other_id raw) return sys_refcursor;

end;
/
2 changes: 1 addition & 1 deletion source/expectations/data_values/ut_cursor_column.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ create or replace type body ut_cursor_column as
self.column_position := a_col_position; --Position of the column in cursor/ type
self.column_len := a_col_max_len; --length of column
self.column_name := TRIM( BOTH '''' FROM a_col_name); --name of the column
self.column_type_name := a_col_type_name; --type name e.g. test_dummy_object or varchar2
self.column_type_name := coalesce(a_col_type_name,a_col_type); --type name e.g. test_dummy_object or varchar2
self.access_path := case when a_access_path is null then
self.column_name
else
Expand Down
6 changes: 2 additions & 4 deletions source/expectations/data_values/ut_cursor_details.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,10 @@ create or replace type body ut_cursor_details as
member function get_xml_children(a_parent_name varchar2 := null) return xmltype is
l_result xmltype;
begin
select xmlagg(xmlelement(evalname t.column_name,t.column_type,
self.get_xml_children(t.column_name)))
select xmlagg(xmlelement(evalname t.column_name,t.column_type_name))
into l_result
from table(self.cursor_columns_info) t
where (a_parent_name is not null and parent_name = a_parent_name and hierarchy_level > 1 and column_name is not null)
or (a_parent_name is null and parent_name is null and hierarchy_level = 1 and column_name is not null)
where (a_parent_name is null and parent_name is null and hierarchy_level = 1 and column_name is not null)
having count(*) > 0;

return l_result;
Expand Down
3 changes: 2 additions & 1 deletion source/expectations/data_values/ut_data_value_refcursor.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ create or replace type body ut_data_value_refcursor as
l_diff_id := ut_compound_data_helper.get_hash(a_self.data_id||a_other.data_id);

begin
open l_cursor for a_diff_cursor_text using a_self.data_id, a_other.data_id;
l_cursor := ut_compound_data_helper.get_compare_cursor(a_diff_cursor_text,
a_self.data_id, a_other.data_id);
--fetch and save rows for display of diff
fetch l_cursor bulk collect into l_diff_tab limit ut_utils.gc_diff_max_rows;

Expand Down
60 changes: 60 additions & 0 deletions test/core/expectations/test_expectations_cursor.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -2465,5 +2465,65 @@ Diff:%
ut.expect(l_actual_message).to_be_like(l_expected_message);
end;

procedure udt_messg_format_eq is
l_actual sys_refcursor;
l_expected sys_refcursor;
l_expected_tab ut3.ut_key_value_pairs := ut3.ut_key_value_pairs();
l_expected_message varchar2(32767);
l_actual_message varchar2(32767);
begin
select ut3.ut_key_value_pair(rownum,'Something '||rownum)
bulk collect into l_expected_tab
from dual connect by level <=2;

--Arrange
open l_actual for select object_name, owner from all_objects where rownum < 3;
open l_expected for select value(x) as udt from table(l_expected_tab) x;

--Act
ut3.ut.expect(l_actual).to_contain(l_expected);
--Assert
l_expected_message := q'[%Actual: refcursor [ count = 2 ] was expected to contain: refcursor [ count = 2 ]
%Diff:
%Columns:
%Column <UDT> [data-type: UT_KEY_VALUE_PAIR] is missing. Expected column position: 1.
%Column <OBJECT_NAME> [position: 1, data-type: VARCHAR2] is not expected in results.
%Column <OWNER> [position: 2, data-type: VARCHAR2] is not expected in results.
%Rows: [ 2 differences ]
%Missing: <UDT><KEY>1</KEY><VALUE>Something 1</VALUE></UDT>
%Missing: <UDT><KEY>2</KEY><VALUE>Something 2</VALUE></UDT>%]';
l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
--Assert
ut.expect(l_actual_message).to_be_like(l_expected_message);
end;

procedure udt_messg_format_empt is
l_actual sys_refcursor;
l_actual_tab ut3.ut_key_value_pairs := ut3.ut_key_value_pairs();
l_actual_message varchar2(32767);
l_expected_message varchar2(32767);
begin
select ut3.ut_key_value_pair(rownum,'Something '||rownum)
bulk collect into l_actual_tab
from dual connect by level <=2;

--Arrange
open l_actual for select value(x) as udt from table(l_actual_tab) x;

--Act
ut3.ut.expect(l_actual).to_be_empty();
--Assert
l_expected_message := q'[%Actual: (refcursor [ count = 2 ])
%Data-types:
%<UDT>UT_KEY_VALUE_PAIR</UDT>
%Data:
%<ROW><UDT><KEY>1</KEY><VALUE>Something 1</VALUE></UDT></ROW><ROW><UDT><KEY>2</KEY><VALUE>Something 2</VALUE></UDT></ROW>
%was expected to be empty%]';

l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
--Assert
ut.expect(l_actual_message).to_be_like(l_expected_message);
end;

end;
/
7 changes: 6 additions & 1 deletion test/core/expectations/test_expectations_cursor.pks
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,11 @@ create or replace package test_expectations_cursor is

--%test(Cursor to contain duplicates fail)
procedure to_contain_duplicates_fail;


--%test(Display a message with a uer defined type with only type name not structure on equal)
procedure udt_messg_format_eq;

--%test(Display a message with a uer defined type with only type name not structure on empty)
procedure udt_messg_format_empt;
end;
/
11 changes: 11 additions & 0 deletions test/core/min_grant_user/test_min_grant_user.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ create or replace package body test_min_grant_user is
'%1 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)%' );

end;

procedure test_equal_non_diff_sql is
l_results clob;
begin
execute immediate 'begin ut3$user#.test_cursor_grants.run_test_equal_non_diff_sql(); end;';
l_results := core.get_dbms_output_as_clob();
--Assert
ut.expect( l_results ).to_be_like( '%execute test with non diff datatype [% sec]' ||
'%1 tests, 0 failed, 0 errored, 0 disabled, 0 warning(s)%' );

end;

end;
/
3 changes: 3 additions & 0 deletions test/core/min_grant_user/test_min_grant_user.pks
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ create or replace package test_min_grant_user is
--%test(execute empty test)
procedure test_empty_cursor;

--%test(execute test with non diff datatype)
procedure test_equal_non_diff_sql;

end;
/
18 changes: 18 additions & 0 deletions test/helpers/ut3user#.test_cursor_grants.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ create or replace package body ut3$user#.test_cursor_grants is
begin
ut3.ut.run('test_cursor_grants.test_empty_cursor');
end;

procedure run_test_equal_non_diff_sql is
begin
ut3.ut.run('test_cursor_grants.test_equal_non_diff_sql');
end;

procedure test_join_by_cursor is
l_actual SYS_REFCURSOR;
Expand Down Expand Up @@ -92,5 +97,18 @@ create or replace package body ut3$user#.test_cursor_grants is
ut3.ut.expect(l_expected).to_be_empty();
end;

procedure test_equal_non_diff_sql is
l_actual SYS_REFCURSOR;
l_expected SYS_REFCURSOR;
begin
open l_actual for
select to_clob('test1') as item from dual;

open l_expected for
select to_clob('test1') as item from dual;

ut3.ut.expect(l_actual).to_equal(l_expected);
end;

end;
/
6 changes: 5 additions & 1 deletion test/helpers/ut3user#.test_cursor_grants.pks
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ create or replace package ut3$user#.test_cursor_grants is
procedure run_test_not_empty_cursor;
procedure run_test_have_count_cursor;
procedure run_test_empty_cursor;

procedure run_test_equal_non_diff_sql;

--%test(execute join by test)
procedure test_join_by_cursor;

Expand All @@ -22,5 +23,8 @@ create or replace package ut3$user#.test_cursor_grants is
--%test(execute empty test)
procedure test_empty_cursor;

--%test(execute test with non diff datatype)
procedure test_equal_non_diff_sql;

end;
/