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

Skip to content

Commit 4a0dadc

Browse files
authored
Merge branch 'develop' into issue-364
2 parents e896c61 + f82dcac commit 4a0dadc

14 files changed

Lines changed: 215 additions & 335 deletions

docs/about/authors.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11

2-
### Version 3 Major Contributors
2+
### utPLSQL v3 Major Contributors
33

44
**Listed Alphabetically**
55

6-
| Name | GitHub account
7-
| ------------ | --------------
8-
| David Pyke | [Shoelace](https://github.com/Shoelace)
9-
| Jacek Gebal | [jgebal](https://github.com/jgebal)
10-
| Pavel Kaplya | [Pazus](https://github.com/Pazus)
11-
| Robert Love | [rlove](https://github.com/rlove)
6+
| Name | GitHub account
7+
| ---------------- | --------------
8+
| David Pyke | [Shoelace](https://github.com/Shoelace)
9+
| Jacek Gebal | [jgebal](https://github.com/jgebal)
10+
| Pavel Kaplya | [Pazus](https://github.com/Pazus)
11+
| Robert Love | [rlove](https://github.com/rlove)
12+
| Vinicius Avellar | [viniciusam](https://github.com/viniciusam/)
1213

1314

15+
16+
Many thanks to all the [contributors](https://github.com/utPLSQL/utPLSQL/graphs/contributors)
17+
1418
### Special thanks to prior major contributors
1519

1620
- Steven Feuerstein - Original Author

docs/userguide/upgrade.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# How to upgrade from prior versions
1+
# Upgrading from version 2
2+
3+
utPLSQL v3 is a total rewrite of the framework.
4+
To make utPLSQL v2 packages run on v3 framework you need to install and execute migration utility.
5+
See the [utPLSQL-v2-v3-migration](https://github.com/utPLSQL/utPLSQL-v2-v3-migration) project for details on how to install and execute the migration.
26

3-
utPLSQL v3 is a total rewrite of the previous version. There is no automated way to migrate tests from version 2.x to version 3.
4-
There are plans to build a mapping/bridging solution that would allow running v2 tests using v3 framework.
57

readme.md

Lines changed: 100 additions & 92 deletions
Large diffs are not rendered by default.

source/core/types/ut_expectation_result.tpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ create or replace type body ut_expectation_result is
2323
self.description := a_description;
2424
self.message := a_message;
2525
if self.status = ut_utils.tr_failure then
26-
self.caller_info := ut_expectation_processor.who_called_expectation();
26+
self.caller_info := ut_expectation_processor.who_called_expectation(dbms_utility.format_call_stack());
2727
end if;
2828
return;
2929
end;

source/core/ut_expectation_processor.pkb

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,30 +120,28 @@ create or replace package body ut_expectation_processor as
120120

121121
end;
122122

123-
function who_called_expectation return varchar2 is
124-
c_call_stack constant varchar2(32767) := dbms_utility.format_call_stack();
123+
function who_called_expectation(a_call_stack varchar2) return varchar2 is
125124
l_caller_stack_line varchar2(4000);
126-
l_caller_type_and_name varchar2(4000);
127125
l_line_no integer;
128126
l_owner varchar2(1000);
129-
l_object_name varchar2(1000);
127+
l_object_name varchar2(1000);
128+
l_result varchar2(4000);
130129
-- in 12.2 format_call_stack reportes not only package name, but also the procedure name
131130
-- when 11g and 12c reports only package name
132-
c_expectation_search_pattern constant varchar2(500) :=
131+
c_expectation_search_pattern constant varchar2(500) :=
133132
'(.*\.(UT_EXPECTATION[A-Z0-9#_$]*|UT|UTASSERT2?)(\.[A-Z0-9#_$]+)?\s+)+(.*)';
134133
begin
135-
l_caller_stack_line := regexp_substr( c_call_stack, c_expectation_search_pattern, 1, 1, 'm', 4);
136-
l_line_no := to_number( regexp_substr(l_caller_stack_line,'0x[0-9a-f]+\s+(\d+)',subexpression => 1) );
137-
l_caller_type_and_name := trim(regexp_substr(l_caller_stack_line,'0x[0-9a-f]+\s+\d+\s+(.+)',subexpression => 1));
134+
l_caller_stack_line := regexp_substr( a_call_stack, c_expectation_search_pattern, 1, 1, 'm', 4);
138135
if l_caller_stack_line like '%.%' then
136+
l_line_no := to_number( regexp_substr(l_caller_stack_line,'(0x)?[0-9a-f]+\s+(\d+)',subexpression => 2) );
139137
l_owner := regexp_substr(l_caller_stack_line,'([A-Za-z0-9$#_]+)\.([A-Za-z0-9$#_]|\.)+',subexpression => 1);
140138
l_object_name := regexp_substr(l_caller_stack_line,'([A-Za-z0-9$#_]+)\.(([A-Za-z0-9$#_]|\.)+)',subexpression => 2);
139+
if l_owner is not null and l_object_name is not null and l_line_no is not null then
140+
l_result := 'at "' || l_owner || '.' || l_object_name || '", line '|| l_line_no || ' '
141+
|| ut_metadata.get_source_definition_line(l_owner, l_object_name, l_line_no);
142+
end if;
141143
end if;
142-
return
143-
case when l_owner is not null and l_object_name is not null and l_line_no is not null then
144-
'at "' || l_owner || '.' || l_object_name || '", line '|| l_line_no || ' ' ||
145-
ut_metadata.get_source_definition_line(l_owner, l_object_name, l_line_no)
146-
end;
144+
return l_result;
147145
end;
148146
end;
149147
/

source/core/ut_expectation_processor.pks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ create or replace package ut_expectation_processor authid current_user as
4444
-- if found, it returns a text:
4545
-- at: owner.name:line "source code line text"
4646
-- The text is to be consumed by expectation result
47-
function who_called_expectation return varchar2;
47+
function who_called_expectation(a_call_stack varchar2) return varchar2;
4848

4949
end;
5050
/

source/create_utplsql_owner.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ define ut3_user = &1
2525
define ut3_password = &2
2626
define ut3_tablespace = &3
2727

28+
prompt Creating utPLSQL user &&ut3_user
29+
2830
create user &ut3_user identified by &ut3_password default tablespace &ut3_tablespace quota unlimited on &ut3_tablespace;
2931

3032
grant create session, create sequence, create procedure, create type, create table, create view, create synonym to &ut3_user;

source/install.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
spool install.log
2121

2222
prompt &&line_separator
23-
prompt Installing utPLSQL v3 framework
23+
prompt Installing utPLSQL v3 framework into &&ut3_owner schema
2424
prompt &&line_separator
2525

2626
whenever sqlerror exit failure rollback

source/install_headless.sql

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,25 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
*/
17-
define ut3_owner = ut3
18-
define ut3_password = XNtxj8eEgA6X6b6f
19-
define ut3_tablespace = users
17+
set echo off
18+
set verify off
19+
column 1 new_value 1 noprint
20+
column 2 new_value 2 noprint
21+
column 3 new_value 3 noprint
22+
select null as "1", null as "2" , null as "3" from dual where 1=0;
23+
column sep new_value sep noprint
24+
select '--------------------------------------------------------------' as sep from dual;
25+
26+
spool params.sql.tmp
27+
28+
column ut3_owner new_value ut3_owner noprint
29+
column ut3_password new_value ut3_password noprint
30+
column ut3_tablespace new_value ut3_tablespace noprint
31+
32+
select coalesce('&&1','UT3') ut3_owner,
33+
coalesce('&&2','XNtxj8eEgA6X6b6f') ut3_password,
34+
coalesce('&&3','users') ut3_tablespace from dual;
35+
2036

2137
@@create_utplsql_owner.sql &&ut3_owner &&ut3_password &&ut3_tablespace
2238
@@install.sql &&ut3_owner

source/license.txt

Lines changed: 0 additions & 205 deletions
This file was deleted.

0 commit comments

Comments
 (0)