From 169c7c2133d919399dab2a81bd92a60d0244e74e Mon Sep 17 00:00:00 2001 From: Jacek Date: Sat, 22 Jul 2017 00:46:29 +0100 Subject: [PATCH 01/42] Adding additional installation of utPLSQL framework into schema ut3_release --- .travis.yml | 8 ++++++ .travis/install_utplsql_release.sh | 42 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .travis/install_utplsql_release.sh diff --git a/.travis.yml b/.travis.yml index 54a9a1697..633f2208d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,8 @@ env: # Database Env - SQLCLI="$HOME/sqlcl/bin/sql" - ORACLE_PWD="oracle" + #utPLSQL released version directory + - UTPLSQL_DIR="utPLSQL" matrix: - ORACLE_VERSION="11g-xe-r2" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g' - ORACLE_VERSION="12c-se2-r1-v2" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs" @@ -50,7 +52,12 @@ cache: - $CACHE_DIR - node_modules +before_install: + # download latest utPLSQL release + - curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') + install: + - unzip utPLSQL.zip - pip install mkdocs - bash .travis/install_sqlcl.sh - sudo mkdir -p /dev/pdbs @@ -68,6 +75,7 @@ before_script: script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples_and_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then sonar-scanner; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi diff --git a/.travis/install_utplsql_release.sh b/.travis/install_utplsql_release.sh new file mode 100644 index 000000000..d033e9467 --- /dev/null +++ b/.travis/install_utplsql_release.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +RELEASE_VERSION_SCHEMA=UT3_LATEST_RELEASE +set -ev + +cd $UTPLSQL_DIR/source + +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL +declare + i integer := 0; +begin + dbms_output.put_line('Dropping synonyms pointing to schema '||upper('${UT3_OWNER}')); + for syn in ( + select + case when owner = 'PUBLIC' + then 'public synonym ' + else 'synonym ' || owner || '.' end || synonym_name as syn_name, + table_owner||'.'||table_name as for_object + from all_synonyms s + where table_owner = upper('${UT3_OWNER}') and table_owner != owner + ) + loop + i := i + 1; + begin + execute immediate 'drop '||syn.syn_name; + dbms_output.put_line('Dropped '||syn.syn_name||' for object '||syn.for_object); + exception + when others then + dbms_output.put_line('FAILED to drop '||syn.syn_name||' for object '||syn.for_object); + end; + end loop; + dbms_output.put_line('&&line_separator'); + dbms_output.put_line(i||' synonyms dropped'); +end; +/ +SQL +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA @install_headless.sql ${RELEASE_VERSION_SCHEMA} + +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA < Date: Sat, 22 Jul 2017 09:45:19 +0100 Subject: [PATCH 02/42] Changer install.sh to be runnable from both `sqlplus` and `sqlcl`. Added output for dropping synonyms. --- .travis.yml | 1 + .travis/install.sh | 22 ++++------------------ .travis/install_utplsql_release.sh | 12 +++++++----- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 633f2208d..f00211378 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ env: global: - UT3_OWNER=ut3 - UT3_OWNER_PASSWORD=ut3 + - UT3_RELEASE_VERSION_SCHEMA=UT3_LATEST_RELEASE - UT3_USER="UT3\$USER#" - UT3_USER_PASSWORD=ut3 - UT3_TABLESPACE=users diff --git a/.travis/install.sh b/.travis/install.sh index e09da1eab..8aaa1fd9c 100644 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -1,14 +1,13 @@ #!/bin/bash -cd "$(dirname "$(readlink -f "$0")")" +cd source set -ev #install core of utplsql "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL -pwd set feedback off set verify off -@../source/install_headless.sql $UT3_OWNER $UT3_OWNER_PASSWORD +@install_headless.sql $UT3_OWNER $UT3_OWNER_PASSWORD SQL "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL @@ -19,23 +18,10 @@ grant select any dictionary to $UT3_OWNER; grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER; set feedback off -@../source/create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE +@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE -cd .. - ---enable plsql debug ---cd development ---@ut_debug_enable.sql ---cd .. - ---cd source ---@install.sql $UT3_OWNER ---@create_synonyms_and_grants_for_user.sql $UT3_OWNER $UT3_USER ---cd .. - -cd development conn $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR -@utplsql_style_check.sql +@../development/utplsql_style_check.sql exit SQL diff --git a/.travis/install_utplsql_release.sh b/.travis/install_utplsql_release.sh index d033e9467..e3c42e3b2 100644 --- a/.travis/install_utplsql_release.sh +++ b/.travis/install_utplsql_release.sh @@ -1,11 +1,13 @@ #!/bin/bash -RELEASE_VERSION_SCHEMA=UT3_LATEST_RELEASE set -ev cd $UTPLSQL_DIR/source -"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA < Date: Sun, 23 Jul 2017 01:03:11 +0100 Subject: [PATCH 03/42] Trying to test ut3 using ut3 framework installed in separate schema. --- .travis.yml | 3 + .travis/install.sh | 18 ++++- tests/run_tests.sh | 16 ++++ tests/ut_utils/test_ut_utils.pkb | 130 +++++++++++++++++++++++++++++++ tests/ut_utils/test_ut_utils.pks | 75 ++++++++++++++++++ 5 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 tests/run_tests.sh create mode 100644 tests/ut_utils/test_ut_utils.pkb create mode 100644 tests/ut_utils/test_ut_utils.pks diff --git a/.travis.yml b/.travis.yml index f00211378..aa65e0ad4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,8 @@ env: - UT3_RELEASE_VERSION_SCHEMA=UT3_LATEST_RELEASE - UT3_USER="UT3\$USER#" - UT3_USER_PASSWORD=ut3 + - UT3_TESTER=ut3_tester + - UT3_TESTER_PASSWORD=UT3 - UT3_TABLESPACE=users # Environment for building a release - CURRENT_BRANCH=${TRAVIS_BRANCH} @@ -78,6 +80,7 @@ script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples_and_tests.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash tests/install_and_run_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then sonar-scanner; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi - bash .travis/build_docs.sh diff --git a/.travis/install.sh b/.travis/install.sh index 8aaa1fd9c..765dd0abb 100644 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -10,6 +10,7 @@ set verify off @install_headless.sql $UT3_OWNER $UT3_OWNER_PASSWORD SQL +#additional privileges to run scripted tests "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL set feedback on --needed for Mystats script to work @@ -17,11 +18,22 @@ grant select any dictionary to $UT3_OWNER; --Needed for testing a coverage outside ut3_owner. grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER; -set feedback off -@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE - conn $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR @../development/utplsql_style_check.sql +exit +SQL +#Create additional users +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL +set feedback off +@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE +@create_utplsql_owner.sql $UT3_TESTER $UT3_TESTER_PASSWORD $UT3_TABLESPACE +exit +SQL + +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL +set feedback on +--Needed for testing coverage outside of main UT3 schema. +grant create any procedure, drop any procedure, execute any procedure to $UT3_TESTER; exit SQL diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100644 index 000000000..52194b8c0 --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -ev +#replace "/" with "@" +conn_str=${CONNECTION_STR//\//@} + +"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} <<-SQL +@ut_utils/test_ut_utils.pks +@ut_utils/test_ut_utils.pkb +exit +SQL + +utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}${conn_str} \ +-source_path=source -test_path=tests \ +-f=ut_documentation_reporter -c \ +-f=ut_coverage_sonar_reporter -o=coverage.xml \ +-f=ut_sonar_test_reporter -o=test_results.xml diff --git a/tests/ut_utils/test_ut_utils.pkb b/tests/ut_utils/test_ut_utils.pkb new file mode 100644 index 000000000..564921e8a --- /dev/null +++ b/tests/ut_utils/test_ut_utils.pkb @@ -0,0 +1,130 @@ +create or replace package body test_ut_utils as + + procedure clob_to_table_test( + a_clob clob, a_expected ut_varchar2_list, + a_delimiter varchar2 := ',', + a_overflow_limit integer := 1000 + ) is + l_result ut_varchar2_list; + begin + --Act + l_result := ut3.ut_utils.clob_to_table(a_clob, a_overflow_limit, a_delimiter); + --Assert + ut.expect(anydata.convertCollection(l_result)).to_( equal(anydata.convertCollection(a_expected)) ); + end; + + procedure clob_to_table_by_delim is + begin + clob_to_table_test( a_clob => 'a,b,c,d', a_expected => ut_varchar2_list('a','b','c','d') ); + end; + + --%test(clob_to_table returns empty table for null clob) + procedure clob_to_table_null_data is + begin + clob_to_table_test( a_clob => null, a_expected => ut_varchar2_list() ); + end; + + --%test(clob_to_table splits table by char limit when no delimiter) + procedure clob_to_table_char_limit is + begin + clob_to_table_test( + a_clob => '1,2,3,4', + a_expected => ut_varchar2_list('1,2,','3,4'), + a_delimiter => '', + a_overflow_limit => 4 + ); + end; + + --%test(clob_to_table splits table by char limit on overflow and continues by delimiter) + procedure clob_to_table_char_limit_delim is + begin + clob_to_table_test( + a_clob => 'abcdefg,hijk,axa,a', + a_expected => ut_varchar2_list('abc','def','g','hij','k','axa','a'), + a_overflow_limit => 3 + ); + end; + + --%test(clob_to_table returns empty lines for null data between delimiter) + procedure clob_to_table_empty_lines is + begin + clob_to_table_test( + a_clob => ',a,,c,d,', + a_expected => ut_varchar2_list('','a','','c','d','') + ); + end; + + --%test(test_result_to_char) + procedure test_result_to_char is + begin + ut.expect( ut_utils.test_result_to_char(NULL)).to_equal('Unknown(NULL)'); + ut.expect( ut_utils.test_result_to_char(-1)).to_equal('Unknown(-1)'); + ut.expect( ut_utils.test_result_to_char(ut_utils.tr_disabled)).to_equal(ut_utils.tr_disabled_char); + ut.expect( ut_utils.test_result_to_char(ut_utils.tr_success)).to_equal(ut_utils.tr_success_char); + ut.expect( ut_utils.test_result_to_char(ut_utils.tr_failure)).to_equal(ut_utils.tr_failure_char); + ut.expect( ut_utils.test_result_to_char(ut_utils.tr_error)).to_equal(ut_utils.tr_error_char); + end; + + --%test(to_test_result converts boolean value to test result integer) + procedure to_test_result is + begin + ut.expect( ut_utils.to_test_result(true)).to_equal(ut_utils.tr_success); + ut.expect( ut_utils.to_test_result(false)).to_equal(ut_utils.tr_failure); + ut.expect( ut_utils.to_test_result(null)).to_equal(ut_utils.tr_failure); + end; + + --%test(to_string on null blob) + procedure to_string_null_blob is + begin + ut.expect( ut_utils.to_string(to_blob(null)) ).to_equal('NULL'); + end; + + --%test(to_string on blob) + procedure to_string_blob is + l_text varchar2(32767) := 'A test char'; + l_value blob := utl_raw.cast_to_raw(l_text); + l_expected varchar2(32767) := ''''||rawtohex(l_value)||''''; + begin + ut.expect( ut_utils.to_string(l_value) ).to_equal(l_expected); + end; + +-- --%test(to_string on null clob) +-- procedure to_string_null_clob; +-- --%test(to_string on clob) +-- procedure to_string_clob; +-- --%test(to_string on clob no surrounding quotes) +-- procedure to_string_clob_no_quotes; +-- --%test(to_string on clob other surrounding quotes) +-- procedure to_string_clob_other_quotes; +-- +-- --%test(to_string on null number) +-- procedure to_string_null_number; +-- --%test(to_string on number) +-- procedure to_string_number; +-- +-- --%test(to_string on null timestamp) +-- procedure to_string_null_timestamp; +-- --%test(to_string on timestamp) +-- procedure to_string_timestamp; +-- +-- --%test(to_string on null timestamp with time zone) +-- procedure to_string_null_timestamp_tz; +-- --%test(to_string on timestamp with time zone) +-- procedure to_string_timestamp_tz; +-- +-- --%test(to_string on null timestamp with local time zone) +-- procedure to_string_null_timestamp_ltz; +-- --%test(to_string on timestamp with local time zone) +-- procedure to_string_timestamp_ltz; +-- +-- --%test(to_string on null varchar) +-- procedure to_string_null_varchar; +-- --%test(to_string on varchar) +-- procedure to_string_varchar; +-- --%test(to_string on varchar no surrounding quotes) +-- procedure to_string_varchar_no_quotes; +-- --%test(to_string on varchar non default surrounding quotes) +-- procedure to_string_varchar_other_quotes; + +end; +/ diff --git a/tests/ut_utils/test_ut_utils.pks b/tests/ut_utils/test_ut_utils.pks new file mode 100644 index 000000000..f493f2faf --- /dev/null +++ b/tests/ut_utils/test_ut_utils.pks @@ -0,0 +1,75 @@ +create or replace package test_ut_utils as + + --%suite(Testing common utility package: ut_utils) + --%suitepath(org.utplsql.utplsql.ut_utils) + + --%context(clob_to_table) + + --%test(splits clob by delimiter) + procedure clob_to_table_by_delim; + + --%test(returns empty table for null clob) + procedure clob_to_table_null_data; + + --%test(splits table by char limit when no delimiter) + procedure clob_to_table_char_limit; + + --%test(splits table by char limit on overflow and continues by delimiter) + procedure clob_to_table_char_limit_delim; + + --%test(returns empty lines for null data between delimiter) + procedure clob_to_table_empty_lines; + + --%endcontext + + --%test(test_result_to_char) + procedure test_result_to_char; + + --%test(to_test_result converts boolean value to test result integer) + procedure to_test_result; + + --%test(to_string on null blob) + procedure to_string_null_blob; + --%test(to_string on blob) + procedure to_string_blob; + +-- --%test(to_string on null clob) +-- procedure to_string_null_clob; +-- --%test(to_string on clob) +-- procedure to_string_clob; +-- --%test(to_string on clob no surrounding quotes) +-- procedure to_string_clob_no_quotes; +-- --%test(to_string on clob other surrounding quotes) +-- procedure to_string_clob_other_quotes; +-- +-- --%test(to_string on null number) +-- procedure to_string_null_number; +-- --%test(to_string on number) +-- procedure to_string_number; +-- +-- --%test(to_string on null timestamp) +-- procedure to_string_null_timestamp; +-- --%test(to_string on timestamp) +-- procedure to_string_timestamp; +-- +-- --%test(to_string on null timestamp with time zone) +-- procedure to_string_null_timestamp_tz; +-- --%test(to_string on timestamp with time zone) +-- procedure to_string_timestamp_tz; +-- +-- --%test(to_string on null timestamp with local time zone) +-- procedure to_string_null_timestamp_ltz; +-- --%test(to_string on timestamp with local time zone) +-- procedure to_string_timestamp_ltz; +-- +-- --%test(to_string on null varchar) +-- procedure to_string_null_varchar; +-- --%test(to_string on varchar) +-- procedure to_string_varchar; +-- --%test(to_string on varchar no surrounding quotes) +-- procedure to_string_varchar_no_quotes; +-- --%test(to_string on varchar non default surrounding quotes) +-- procedure to_string_varchar_other_quotes; + +end; +/ From adbb5431226ac5c5ae2371128a1c0f0f1663d1a9 Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 28 Jul 2017 09:43:42 +0100 Subject: [PATCH 04/42] Testing schema `UT3` with tests in schema `UT3_TESTER` and most recently released version of framework installed in `UT3_LATEST_RELEASE` schema. --- .travis.yml | 8 +++- sonar-project.properties | 4 +- .../install_and_run_tests.sh | 14 +++---- test/install_tests.sql | 4 ++ {tests => test}/ut_utils/test_ut_utils.pkb | 38 ++++++++++--------- {tests => test}/ut_utils/test_ut_utils.pks | 0 6 files changed, 39 insertions(+), 29 deletions(-) rename tests/run_tests.sh => test/install_and_run_tests.sh (69%) create mode 100644 test/install_tests.sql rename {tests => test}/ut_utils/test_ut_utils.pkb (67%) rename {tests => test}/ut_utils/test_ut_utils.pks (100%) diff --git a/.travis.yml b/.travis.yml index aa65e0ad4..f6ea2bac1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ addons: branches: - develop - master + - feature/using_released_to_test_develop services: - docker @@ -27,7 +28,7 @@ env: - UT3_USER="UT3\$USER#" - UT3_USER_PASSWORD=ut3 - UT3_TESTER=ut3_tester - - UT3_TESTER_PASSWORD=UT3 + - UT3_TESTER_PASSWORD=ut3 - UT3_TABLESPACE=users # Environment for building a release - CURRENT_BRANCH=${TRAVIS_BRANCH} @@ -58,9 +59,12 @@ cache: before_install: # download latest utPLSQL release - curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') + # download utPLSQL-cli develop + - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip install: - unzip utPLSQL.zip + - unzip utPLSQL-cli.zip - pip install mkdocs - bash .travis/install_sqlcl.sh - sudo mkdir -p /dev/pdbs @@ -80,7 +84,7 @@ script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples_and_tests.sh; fi - - if [ "${TRAVIS_TAG}" = "" ]; then bash tests/install_and_run_tests.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then sonar-scanner; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi - bash .travis/build_docs.sh diff --git a/sonar-project.properties b/sonar-project.properties index 0950549e3..356f9b818 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,7 +9,9 @@ sonar.projectVersion=v3.0.2 # If not set, SonarQube starts looking for source code from the directory containing # the sonar-project.properties file. sonar.sources=./source -sonar.coverageReportPaths=./tests/coverage.xml +sonar.coverageReportPaths=./tests/coverage.xml,coverage.xml +sonar.tests=./test +sonar.testExecutionReportPaths=test_results.xml sonar.links.issue=https://github.com/utPLSQL/utPLSQL/issues sonar.links.ci=https://travis-ci.org/utPLSQL/utPLSQL sonar.links.homepage=https://github.com/utPLSQL/utPLSQL diff --git a/tests/run_tests.sh b/test/install_and_run_tests.sh similarity index 69% rename from tests/run_tests.sh rename to test/install_and_run_tests.sh index 52194b8c0..76a6cb298 100644 --- a/tests/run_tests.sh +++ b/test/install_and_run_tests.sh @@ -1,15 +1,13 @@ #!/bin/bash set -ev -#replace "/" with "@" -conn_str=${CONNECTION_STR//\//@} -"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} <<-SQL -@ut_utils/test_ut_utils.pks -@ut_utils/test_ut_utils.pkb -exit -SQL +cd test -utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}${conn_str} \ +"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql + +cd .. + +utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ -source_path=source -test_path=tests \ -f=ut_documentation_reporter -c \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ diff --git a/test/install_tests.sql b/test/install_tests.sql new file mode 100644 index 000000000..4060f879b --- /dev/null +++ b/test/install_tests.sql @@ -0,0 +1,4 @@ + +@ut_utils/test_ut_utils.pks +@ut_utils/test_ut_utils.pkb +exit diff --git a/tests/ut_utils/test_ut_utils.pkb b/test/ut_utils/test_ut_utils.pkb similarity index 67% rename from tests/ut_utils/test_ut_utils.pkb rename to test/ut_utils/test_ut_utils.pkb index 564921e8a..76e9ccc51 100644 --- a/tests/ut_utils/test_ut_utils.pkb +++ b/test/ut_utils/test_ut_utils.pkb @@ -1,11 +1,11 @@ create or replace package body test_ut_utils as procedure clob_to_table_test( - a_clob clob, a_expected ut_varchar2_list, + a_clob clob, a_expected ut3.ut_varchar2_list, a_delimiter varchar2 := ',', a_overflow_limit integer := 1000 ) is - l_result ut_varchar2_list; + l_result ut3.ut_varchar2_list; begin --Act l_result := ut3.ut_utils.clob_to_table(a_clob, a_overflow_limit, a_delimiter); @@ -15,13 +15,13 @@ create or replace package body test_ut_utils as procedure clob_to_table_by_delim is begin - clob_to_table_test( a_clob => 'a,b,c,d', a_expected => ut_varchar2_list('a','b','c','d') ); + clob_to_table_test( a_clob => 'a,b,c,d', a_expected => ut3.ut_varchar2_list('a','b','c','d') ); end; --%test(clob_to_table returns empty table for null clob) procedure clob_to_table_null_data is begin - clob_to_table_test( a_clob => null, a_expected => ut_varchar2_list() ); + clob_to_table_test( a_clob => null, a_expected => ut3.ut_varchar2_list() ); end; --%test(clob_to_table splits table by char limit when no delimiter) @@ -29,7 +29,7 @@ create or replace package body test_ut_utils as begin clob_to_table_test( a_clob => '1,2,3,4', - a_expected => ut_varchar2_list('1,2,','3,4'), + a_expected => ut3.ut_varchar2_list('1,2,','3,4'), a_delimiter => '', a_overflow_limit => 4 ); @@ -40,7 +40,7 @@ create or replace package body test_ut_utils as begin clob_to_table_test( a_clob => 'abcdefg,hijk,axa,a', - a_expected => ut_varchar2_list('abc','def','g','hij','k','axa','a'), + a_expected => ut3.ut_varchar2_list('abc','def','g','hij','k','axa','a'), a_overflow_limit => 3 ); end; @@ -50,33 +50,33 @@ create or replace package body test_ut_utils as begin clob_to_table_test( a_clob => ',a,,c,d,', - a_expected => ut_varchar2_list('','a','','c','d','') + a_expected => ut3.ut_varchar2_list('','a','','c','d','') ); end; --%test(test_result_to_char) procedure test_result_to_char is begin - ut.expect( ut_utils.test_result_to_char(NULL)).to_equal('Unknown(NULL)'); - ut.expect( ut_utils.test_result_to_char(-1)).to_equal('Unknown(-1)'); - ut.expect( ut_utils.test_result_to_char(ut_utils.tr_disabled)).to_equal(ut_utils.tr_disabled_char); - ut.expect( ut_utils.test_result_to_char(ut_utils.tr_success)).to_equal(ut_utils.tr_success_char); - ut.expect( ut_utils.test_result_to_char(ut_utils.tr_failure)).to_equal(ut_utils.tr_failure_char); - ut.expect( ut_utils.test_result_to_char(ut_utils.tr_error)).to_equal(ut_utils.tr_error_char); + ut.expect( ut3.ut_utils.test_result_to_char(NULL)).to_equal('Unknown(NULL)'); + ut.expect( ut3.ut_utils.test_result_to_char(-1)).to_equal('Unknown(-1)'); + ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_disabled)).to_equal(ut3.ut_utils.tr_disabled_char); + ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_success)).to_equal(ut3.ut_utils.tr_success_char); + ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_failure)).to_equal(ut3.ut_utils.tr_failure_char); + ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_error)).to_equal(ut3.ut_utils.tr_error_char); end; --%test(to_test_result converts boolean value to test result integer) procedure to_test_result is begin - ut.expect( ut_utils.to_test_result(true)).to_equal(ut_utils.tr_success); - ut.expect( ut_utils.to_test_result(false)).to_equal(ut_utils.tr_failure); - ut.expect( ut_utils.to_test_result(null)).to_equal(ut_utils.tr_failure); + ut.expect( ut3.ut_utils.to_test_result(true)).to_equal(ut3.ut_utils.tr_success); + ut.expect( ut3.ut_utils.to_test_result(false)).to_equal(ut3.ut_utils.tr_failure); + ut.expect( ut3.ut_utils.to_test_result(null)).to_equal(ut3.ut_utils.tr_failure); end; --%test(to_string on null blob) procedure to_string_null_blob is begin - ut.expect( ut_utils.to_string(to_blob(null)) ).to_equal('NULL'); + ut.expect( ut3.ut_utils.to_string(to_blob(null)) ).to_equal('NULL'); end; --%test(to_string on blob) @@ -85,7 +85,7 @@ create or replace package body test_ut_utils as l_value blob := utl_raw.cast_to_raw(l_text); l_expected varchar2(32767) := ''''||rawtohex(l_value)||''''; begin - ut.expect( ut_utils.to_string(l_value) ).to_equal(l_expected); + ut.expect( ut3.ut_utils.to_string(l_value) ).to_equal(l_expected); end; -- --%test(to_string on null clob) @@ -128,3 +128,5 @@ create or replace package body test_ut_utils as end; / + +show errors diff --git a/tests/ut_utils/test_ut_utils.pks b/test/ut_utils/test_ut_utils.pks similarity index 100% rename from tests/ut_utils/test_ut_utils.pks rename to test/ut_utils/test_ut_utils.pks From 746eb07569936ce2404433464a875b6016668158 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sun, 30 Jul 2017 11:38:33 +0300 Subject: [PATCH 05/42] Moved test_annotations from commit a56231c9b232418f589709d5672c1bee23eeee02 --- test/install_tests.sql | 6 + test/ut_annotations/test_annotations.pkb | 514 +++++++++++++++++++++++ test/ut_annotations/test_annotations.pks | 40 ++ test/ut_utils/test_ut_utils.pkb | 4 +- test/ut_utils/test_ut_utils.pks | 2 +- 5 files changed, 562 insertions(+), 4 deletions(-) create mode 100644 test/ut_annotations/test_annotations.pkb create mode 100644 test/ut_annotations/test_annotations.pks diff --git a/test/install_tests.sql b/test/install_tests.sql index 4060f879b..7d4e920e7 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -1,4 +1,10 @@ @ut_utils/test_ut_utils.pks +@ut_annotations/test_annotations.pks + @ut_utils/test_ut_utils.pkb +@ut_annotations/test_annotations.pkb + +show errors + exit diff --git a/test/ut_annotations/test_annotations.pkb b/test/ut_annotations/test_annotations.pkb new file mode 100644 index 000000000..b60c17499 --- /dev/null +++ b/test/ut_annotations/test_annotations.pkb @@ -0,0 +1,514 @@ +create or replace package body test_annotations is + + procedure check_annotation_parsing(a_expected ut3.ut_annotations.typ_annotated_package, a_parsing_result ut3.ut_annotations.typ_annotated_package) is + + procedure check_annotation_params(a_msg varchar2, a_expected ut3.ut_annotations.tt_annotation_params, a_actual ut3.ut_annotations.tt_annotation_params) is + begin + ut.expect(a_actual.count, '[' || a_msg || ']Check number of annotation params').to_equal(a_expected.count); + + if a_expected.count = a_actual.count and a_expected.count > 0 then + for i in 1 .. a_expected.count loop + if a_expected(i).key is not null then + ut.expect(a_actual(i).key, '[' || a_msg || '(' || i || ')]Check annotation param key').to_equal(a_expected(i).key); + else + ut.expect(a_actual(i).key, '[' || a_msg || '(' || i || ')]Check annotation param key').to_be_null; + end if; + + if a_expected(i).val is not null then + ut.expect(a_actual(i).val, '[' || a_msg || '(' || i || ')]Check annotation param value').to_equal(a_expected(i).val); + else + ut.expect(a_actual(i).val, '[' || a_msg || '(' || i || ')]Check annotation param value').to_be_null; + end if; + end loop; + end if; + end; + + procedure check_annotations(a_msg varchar2, a_expected ut3.ut_annotations.tt_annotations, a_actual ut3.ut_annotations.tt_annotations) is + l_ind varchar2(500); + begin + ut.expect(a_actual.count, '[' || a_msg || ']Check number of annotations parsed').to_equal(a_expected.count); + + if a_expected.count = a_actual.count and a_expected.count > 0 then + l_ind := a_expected.first; + while l_ind is not null loop + + ut.expect(a_actual.exists(l_ind), ('[' || a_msg || ']Check annotation exists')).to_be_true; + if a_actual.exists(l_ind) then + check_annotation_params(a_msg || '.' || l_ind, a_expected(l_ind).params, a_actual(l_ind).params); + end if; + l_ind := a_expected.next(l_ind); + end loop; + end if; + end; + + procedure check_procedures(a_msg varchar2, a_expected ut3.ut_annotations.tt_procedure_list, a_actual ut3.ut_annotations.tt_procedure_list) is + l_found boolean := false; + l_index pls_integer; + begin + ut.expect(a_actual.count, '[' || a_msg || ']Check number of procedures parsed').to_equal(a_expected.count); + + if a_expected.count = a_actual.count and a_expected.count > 0 then + for i in 1 .. a_expected.count loop + l_found := false; + l_index := null; + for j in 1 .. a_actual.count loop + if a_expected(i).name = a_actual(j).name then + l_found := true; + l_index := j; + exit; + end if; + end loop; + + ut.expect(l_found, '[' || a_msg || ']Check procedure exists').to_be_true; + if l_found then + check_annotations(a_msg || '.' || a_expected(i).name + ,a_expected(i).annotations + ,a_actual(l_index).annotations); + end if; + end loop; + end if; + end; + begin + check_annotations('PACKAGE', a_expected.package_annotations, a_parsing_result.package_annotations); + check_procedures('PROCEDURES', a_expected.procedure_annotations, a_parsing_result.procedure_annotations); + end check_annotation_parsing; + + procedure test1 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + -- %suite + -- %displayname(Name of suite) + -- %suitepath(all.globaltests) + + -- %ann1(Name of suite) + -- wrong line + -- %ann2(some_value) + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + l_expected.package_annotations('displayname').text := l_ann_param.val; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + l_expected.package_annotations('suitepath').text := l_ann_param.val; + + l_ann_param := null; + l_ann_param.val := 'some_value'; + l_expected.procedure_annotations(1).name := 'foo'; + l_expected.procedure_annotations(1).annotations('ann2').params(1) := l_ann_param; + l_expected.procedure_annotations(1).annotations('ann2').text := l_ann_param.val; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test2 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + -- %suite + -- %displayname(Name of suite) + -- %suitepath(all.globaltests) + + -- %ann1(Name of suite) + -- %ann2(all.globaltests) + + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test3 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + -- %suite + -- %displayname(Name of suite) + -- %suitepath(all.globaltests) + + --%test + procedure foo; + + + --%beforeeach + procedure foo2; + + --test comment + -- wrong comment + + + /* + describtion of the procedure + */ + --%beforeeach(key=testval) + PROCEDURE foo3(a_value number default null); + + function foo4(a_val number default null + , a_par varchar2 default := ''asdf''); + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + l_expected.procedure_annotations(1).name := 'foo'; + l_expected.procedure_annotations(1).annotations('test').params := cast(null as ut3.ut_annotations.tt_annotation_params); + + l_expected.procedure_annotations(2).name := 'foo2'; + l_expected.procedure_annotations(2).annotations('beforeeach').params := cast(null as + ut3.ut_annotations.tt_annotation_params); + + l_ann_param := null; + l_ann_param.key := 'key'; + l_ann_param.val := 'testval'; + + l_expected.procedure_annotations(3).name := 'foo3'; + l_expected.procedure_annotations(3).annotations('beforeeach').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test4 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + -- %suite + -- %displayname(Name of suite) + -- %suitepath(all.globaltests) + + --%test + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + l_expected.procedure_annotations(1).name := 'foo'; + l_expected.procedure_annotations(1).annotations('test').params := cast(null as ut3.ut_annotations.tt_annotation_params); + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test5 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + -- %suite + -- %displayname(Name of suite) + -- %suitepath(all.globaltests) + + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test6 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt accessible by (foo) AS + -- %suite + -- %displayname(Name of suite) + -- %suitepath(all.globaltests) + + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test7 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt + ACCESSIBLE BY (calling_proc) + authid current_user + AS + -- %suite + -- %displayname(Name of suite) + -- %suitepath(all.globaltests) + + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test8 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + -- %suite + --%displayname(name = Name of suite) + -- %suitepath(key=all.globaltests,key2=foo) + + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.key := 'name'; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.key := 'key'; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.key := 'key2'; + l_ann_param.val := 'foo'; + l_expected.package_annotations('suitepath').params(2) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure test9 is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + /* + Some comment + -- inlined + */ + -- %suite + --%displayname(Name of suite) + -- %suitepath(all.globaltests) + + procedure foo; + END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param := null; + l_ann_param.val := 'Name of suite'; + l_expected.package_annotations('suite').params := cast(null as ut3.ut_annotations.tt_annotation_params); + l_expected.package_annotations('displayname').params(1) := l_ann_param; + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + + end; + + procedure ignore_wrapped_package is + l_pck_annotation ut3.ut_annotations.typ_annotated_package; + pragma autonomous_transaction; + begin + + l_pck_annotation := ut3.ut_annotations.get_package_annotations(user, 'TST_WRAPPED_PCK'); + ut.expect(l_pck_annotation.procedure_annotations.count).to_equal(0); + ut.expect(l_pck_annotation.package_annotations.count).to_equal(0); + + end; + + procedure cre_wrapped_pck is + pragma autonomous_transaction; + begin + dbms_ddl.create_wrapped(q'[ +CREATE OR REPLACE PACKAGE tst_wrapped_pck IS + PROCEDURE dummy; +END; +]'); + end; + + procedure drop_wrapped_pck is + ex_pck_doesnt_exist exception; + pragma autonomous_transaction; + pragma exception_init(ex_pck_doesnt_exist, -04043); + begin + execute immediate 'drop package tst_wrapped_pck'; + exception + when ex_pck_doesnt_exist then + null; + end; + + procedure brackets_in_desc is + + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param := null; + --l_results ut_expectation_results; + begin + l_source := 'PACKAGE test_tt AS + -- %suite(Name of suite (including some brackets) and some more text) +END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_ann_param.val := 'Name of suite (including some brackets) and some more text'; + l_expected.package_annotations('suite').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + end; + + procedure test_space_Before_Annot_Params is + l_source clob; + l_parsing_result ut3.ut_annotations.typ_annotated_package; + l_expected ut3.ut_annotations.typ_annotated_package; + l_ann_param ut3.ut_annotations.typ_annotation_param; + + begin + l_source := 'PACKAGE test_tt AS + /* + Some comment + -- inlined + */ + -- %suite + -- %suitepath (all.globaltests) + + procedure foo; +END;'; + + --Act + l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source); + + --Assert + l_expected.package_annotations('suite').params := cast( null as ut3.ut_annotations.tt_annotation_params); + + l_ann_param := null; + l_ann_param.val := 'all.globaltests'; + l_expected.package_annotations('suitepath').params(1) := l_ann_param; + + check_annotation_parsing(l_expected, l_parsing_result); + end; + +end test_annotations; +/ diff --git a/test/ut_annotations/test_annotations.pks b/test/ut_annotations/test_annotations.pks new file mode 100644 index 000000000..3c219bfc2 --- /dev/null +++ b/test/ut_annotations/test_annotations.pks @@ -0,0 +1,40 @@ +create or replace package test_annotations is + + --%suite(annotations) + --%suitepath(utplsql.core) + + --%test(Parse procedure level annotations with annotations mixed with comments) + procedure test1; + --%test(Parse package level annotations with annotations "in the air") + procedure test2; + --%test(Parse complex package) + procedure test3; + --%test(Parse package level annotations) + procedure test4; + --%test(Parse package level annotations) + procedure test5; + --%test(Parse package level annotations Accessible by) + procedure test6; + --%test(Parse package level annotations with multiline declaration) + procedure test7; + --%test(Parse package level annotations) + procedure test8; + --%test(Parse package level annotations with multiline comment) + procedure test9; + + --%test(Ignore Wrapped Package And Does Not Raise Exception) + --%beforetest(cre_wrapped_pck) + --%aftertest(drop_wrapped_pck) + procedure ignore_wrapped_package; + + procedure cre_wrapped_pck; + procedure drop_wrapped_pck; + + --%test(Parse package level annotations with annotation params containing brackets) + procedure brackets_in_desc; + + --%test(Test space before annotation params) + procedure test_space_Before_Annot_Params; + +end test_annotations; +/ diff --git a/test/ut_utils/test_ut_utils.pkb b/test/ut_utils/test_ut_utils.pkb index 76e9ccc51..acde20984 100644 --- a/test/ut_utils/test_ut_utils.pkb +++ b/test/ut_utils/test_ut_utils.pkb @@ -127,6 +127,4 @@ create or replace package body test_ut_utils as -- procedure to_string_varchar_other_quotes; end; -/ - -show errors +/ \ No newline at end of file diff --git a/test/ut_utils/test_ut_utils.pks b/test/ut_utils/test_ut_utils.pks index f493f2faf..32a354164 100644 --- a/test/ut_utils/test_ut_utils.pks +++ b/test/ut_utils/test_ut_utils.pks @@ -1,7 +1,7 @@ create or replace package test_ut_utils as --%suite(Testing common utility package: ut_utils) - --%suitepath(org.utplsql.utplsql.ut_utils) + --%suitepath(utplsql.core) --%context(clob_to_table) From fe4b99339b582ebb756fee5bf7f74ca0ba36a521 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sun, 30 Jul 2017 11:47:06 +0300 Subject: [PATCH 06/42] actualized ut_utils tests to current state of old tests --- test/ut_utils/test_ut_utils.pkb | 365 +++++++++++++++++++++++--------- test/ut_utils/test_ut_utils.pks | 126 +++++------ 2 files changed, 315 insertions(+), 176 deletions(-) diff --git a/test/ut_utils/test_ut_utils.pkb b/test/ut_utils/test_ut_utils.pkb index acde20984..7fc0e737b 100644 --- a/test/ut_utils/test_ut_utils.pkb +++ b/test/ut_utils/test_ut_utils.pkb @@ -1,130 +1,287 @@ -create or replace package body test_ut_utils as +create or replace package body test_ut_utils is - procedure clob_to_table_test( - a_clob clob, a_expected ut3.ut_varchar2_list, - a_delimiter varchar2 := ',', - a_overflow_limit integer := 1000 - ) is - l_result ut3.ut_varchar2_list; - begin - --Act - l_result := ut3.ut_utils.clob_to_table(a_clob, a_overflow_limit, a_delimiter); - --Assert - ut.expect(anydata.convertCollection(l_result)).to_( equal(anydata.convertCollection(a_expected)) ); - end; + gv_nls_value nls_session_parameters.value%type; - procedure clob_to_table_by_delim is + procedure common_clob_to_table_exec(p_clob varchar2, p_delimiter varchar2, p_expected_list ut3.ut_varchar2_list, p_limit number) is + begin + execute immediate 'declare + l_clob clob := '''||p_clob||'''; + l_delimiter varchar2(1) := '''||p_delimiter||'''; + l_expected ut3.ut_varchar2_list := :p_expected_list; + l_result ut3.ut_varchar2_list; + l_limit integer := '||p_limit||q'[; + l_result_str varchar2(32767); + l_errors integer := 0; + function compare_element(a_element_id integer, a_expected ut3.ut_varchar2_list, a_actual ut3.ut_varchar2_list) return integer is begin - clob_to_table_test( a_clob => 'a,b,c,d', a_expected => ut3.ut_varchar2_list('a','b','c','d') ); + if a_expected.exists(a_element_id) and a_actual.exists(a_element_id) then + if a_expected(a_element_id) = a_actual(a_element_id) or a_expected(a_element_id) is null and a_actual(a_element_id) is null then + return 0; + else + dbms_output.put('a_expected('||a_element_id||')='||a_expected(a_element_id)||' | a_actual('||a_element_id||')='||a_actual(a_element_id)); + end if; + end if; + if not a_expected.exists(a_element_id) then + dbms_output.put('a_expected('||a_element_id||') does not exist '); + end if; + if not a_actual.exists(a_element_id) then + dbms_output.put('a_actual('||a_element_id||') does not exist '); + end if; + dbms_output.put_line(null); + return 1; + end; +begin +--Act + select column_value bulk collect into l_result from table( ut3.ut_utils.clob_to_table(l_clob, l_limit, l_delimiter) ); + for i in 1 .. l_result.count loop + l_result_str := l_result_str||''''||l_result(i)||''''||l_delimiter; + end loop; + l_result_str := rtrim(l_result_str,l_delimiter); +--Assert + for i in 1 .. greatest(l_expected.count, l_result.count) loop + l_errors := l_errors + compare_element(i, l_expected, l_result); + end loop; + ut.expect(l_errors).to_equal(0); +end;]' using p_expected_list; end; - --%test(clob_to_table returns empty table for null clob) - procedure clob_to_table_null_data is + procedure test_clob_to_table is + begin + common_clob_to_table_exec('a,b,c,d', ',', ut3.ut_varchar2_list('a','b','c','d'), 1000); + common_clob_to_table_exec( '', ',', ut3.ut_varchar2_list(), 1000); + common_clob_to_table_exec( '1,b,c,d', '', ut3.ut_varchar2_list('1,b,','c,d'), 4); + common_clob_to_table_exec( 'abcdefg,hijk,axa,a', ',', ut3.ut_varchar2_list('abc','def','g','hij','k','axa','a'), 3); + common_clob_to_table_exec( ',a,,c,d,', ',', ut3.ut_varchar2_list('','a','','c','d',''), 1000); + end; + + procedure test_to_char is + begin + ut.expect(ut3.ut_utils.test_result_to_char(-1),'test unknown').to_equal('Unknown(-1)'); + ut.expect(ut3.ut_utils.test_result_to_char(null),'test unknown').to_equal('Unknown(NULL)'); + ut.expect(ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_success),'test unknown').to_equal(ut3.ut_utils.tr_success_char); + end; + + procedure test_to_string_blob is + l_text varchar2(32767) := 'A test char'; + l_value blob := utl_raw.cast_to_raw(l_text); + l_expected varchar2(32767) := ''''||rawtohex(l_value)||''''; + l_result varchar2(32767); begin - clob_to_table_test( a_clob => null, a_expected => ut3.ut_varchar2_list() ); + l_result := ut3.ut_utils.to_String(l_value); + ut.expect(l_result).to_equal(l_expected); end; + + procedure test_to_string_clob is + l_value clob := 'A test char'; + l_expected varchar2(32767) := ''''||l_value||''''; + l_result varchar2(32767); + begin + l_result := ut3.ut_utils.to_String(l_value); + ut.expect(l_result).to_equal(l_expected); + end; + + procedure test_to_string_date is + l_value date := to_date('2016-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss'); + l_expected varchar2(100) := '2016-12-31T23:59:59'; + l_result varchar2(32767); + begin + l_result := ut3.ut_utils.to_String(l_value); + ut.expect(l_result).to_equal(l_expected); + end; + + procedure to_string_null is + begin + ut.expect(ut3.ut_utils.to_String(to_blob(NULL))).to_equal('NULL'); + ut.expect(ut3.ut_utils.to_String(to_clob(NULL))).to_equal('NULL'); + ut.expect(ut3.ut_utils.to_String(to_date(NULL))).to_equal('NULL'); + ut.expect(ut3.ut_utils.to_String(to_number(NULL))).to_equal('NULL'); + ut.expect(ut3.ut_utils.to_String(to_timestamp(NULL))).to_equal('NULL'); + end; + + procedure to_string is + l_value timestamp(9) := to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff'); + l_value2 timestamp(9) with local time zone:= to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff'); + l_value3 timestamp(9) with time zone := to_timestamp_tz('2016-12-31 23:59:59.123456789 -8:00', 'yyyy-mm-dd hh24:mi:ss.ff tzh:tzm'); + l_value4 varchar2(20) := 'A test char'; + l_expected varchar2(100); + l_result varchar2(100); + l_delimiter varchar2(10); + begin + select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS'; + l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789'; + + l_result := ut3.ut_utils.to_String(l_value); + ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected); + + l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789'; + l_result := ut3.ut_utils.to_String(l_value2); + ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected); - --%test(clob_to_table splits table by char limit when no delimiter) - procedure clob_to_table_char_limit is - begin - clob_to_table_test( - a_clob => '1,2,3,4', - a_expected => ut3.ut_varchar2_list('1,2,','3,4'), - a_delimiter => '', - a_overflow_limit => 4 - ); + l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789 -08:00'; + + l_result := ut3.ut_utils.to_String(l_value3); + ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected); + + l_expected := ''''||l_value4||''''; + l_result := ut3.ut_utils.to_String(l_value4); + ut.expect(l_result,'Returns a varchar2 eclosed in quotes').to_equal(l_expected); + end; + + procedure to_string_big_blob is + l_text clob := lpad('A test char',32767,'1')||lpad('1',32767,'1'); + l_value blob; + l_result varchar2(32767); + function clob_to_blob(p_clob clob) return blob + as + l_blob blob; + l_dest_offset integer := 1; + l_source_offset integer := 1; + l_lang_context integer := dbms_lob.default_lang_ctx; + l_warning integer := dbms_lob.warn_inconvertible_char; + begin + dbms_lob.createtemporary(l_blob, true); + dbms_lob.converttoblob( + dest_lob =>l_blob, + src_clob =>p_clob, + amount =>DBMS_LOB.LOBMAXSIZE, + dest_offset =>l_dest_offset, + src_offset =>l_source_offset, + blob_csid =>DBMS_LOB.DEFAULT_CSID, + lang_context=>l_lang_context, + warning =>l_warning + ); + return l_blob; + end; + begin + l_value := clob_to_blob(l_text); + --Act + l_result := ut3.ut_utils.to_String(l_value); + --Assert + ut.EXPECT(length(l_result)).to_equal(ut3.ut_utils.gc_max_output_string_length); + ut.EXPECT(l_result).to_be_like('%'||ut3.ut_utils.gc_more_data_string); - --%test(clob_to_table splits table by char limit on overflow and continues by delimiter) - procedure clob_to_table_char_limit_delim is + end; + + procedure to_string_big_clob is + l_value clob := lpad('A test char',32767,'1')||lpad('1',32767,'1'); + l_result varchar2(32767); begin - clob_to_table_test( - a_clob => 'abcdefg,hijk,axa,a', - a_expected => ut3.ut_varchar2_list('abc','def','g','hij','k','axa','a'), - a_overflow_limit => 3 - ); + --Act + l_result := ut3.ut_utils.to_String(l_value); + --Assert + ut.EXPECT(length(l_result)).to_equal(ut3.ut_utils.gc_max_output_string_length); + ut.EXPECT(l_result).to_be_like('%'||ut3.ut_utils.gc_more_data_string); end; - - --%test(clob_to_table returns empty lines for null data between delimiter) - procedure clob_to_table_empty_lines is + + procedure to_string_big_number is + l_value number := 1234567890123456789012345678901234567890; + l_expected varchar2(100) := '1234567890123456789012345678901234567890'; + l_result varchar2(100); begin - clob_to_table_test( - a_clob => ',a,,c,d,', - a_expected => ut3.ut_varchar2_list('','a','','c','d','') - ); + --Act + l_result := ut3.ut_utils.to_String(l_value); + --Assert + ut.expect(l_result).TO_equal(l_expected); end; - - --%test(test_result_to_char) - procedure test_result_to_char is + + procedure to_string_big_varchar2 is + l_value varchar2(32767) := lpad('A test char',32767,'1'); + l_result varchar2(32767); begin - ut.expect( ut3.ut_utils.test_result_to_char(NULL)).to_equal('Unknown(NULL)'); - ut.expect( ut3.ut_utils.test_result_to_char(-1)).to_equal('Unknown(-1)'); - ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_disabled)).to_equal(ut3.ut_utils.tr_disabled_char); - ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_success)).to_equal(ut3.ut_utils.tr_success_char); - ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_failure)).to_equal(ut3.ut_utils.tr_failure_char); - ut.expect( ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_error)).to_equal(ut3.ut_utils.tr_error_char); + --Act + l_result := ut3.ut_utils.to_String(l_value); + --Assert + ut.EXPECT(length(l_result)).to_equal(ut3.ut_utils.gc_max_output_string_length); + ut.EXPECT(l_result).to_be_like('%'||ut3.ut_utils.gc_more_data_string); end; - --%test(to_test_result converts boolean value to test result integer) - procedure to_test_result is + procedure to_string_big_tiny_number is + l_value number := 0.123456789012345678901234567890123456789; + l_expected varchar2(100); + l_result varchar2(100); + l_delimiter varchar2(1); begin - ut.expect( ut3.ut_utils.to_test_result(true)).to_equal(ut3.ut_utils.tr_success); - ut.expect( ut3.ut_utils.to_test_result(false)).to_equal(ut3.ut_utils.tr_failure); - ut.expect( ut3.ut_utils.to_test_result(null)).to_equal(ut3.ut_utils.tr_failure); - end; + --Act + select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS'; + l_expected := l_delimiter||'123456789012345678901234567890123456789'; + + l_result := ut3.ut_utils.to_String(l_value); + + --Assert + ut.expect(l_result).TO_equal(l_expected); - --%test(to_string on null blob) - procedure to_string_null_blob is + end; + + procedure test_table_to_clob is + procedure exec_table_to_clob(a_list ut3.ut_varchar2_list, a_delimiter varchar2, a_expected clob) is + l_result clob; + begin + l_result := ut3.ut_utils.table_to_clob(a_list, a_delimiter); + + ut.expect(l_result).to_equal(a_expected, a_nulls_are_equal => true); + end; begin - ut.expect( ut3.ut_utils.to_string(to_blob(null)) ).to_equal('NULL'); + exec_table_to_clob(null, ',', ''); + exec_table_to_clob(ut3.ut_varchar2_list(), ',', ''); + exec_table_to_clob(ut3.ut_varchar2_list('a', 'b', 'c', 'd'), ',', 'a,b,c,d'); + exec_table_to_clob(ut3.ut_varchar2_list('1,b,', 'c,d'), ',', '1,b,,c,d'); + exec_table_to_clob(ut3.ut_varchar2_list('', 'a', '', 'c', 'd', ''), ',', ',a,,c,d,'); end; - --%test(to_string on blob) - procedure to_string_blob is - l_text varchar2(32767) := 'A test char'; - l_value blob := utl_raw.cast_to_raw(l_text); - l_expected varchar2(32767) := ''''||rawtohex(l_value)||''''; + procedure test_append_with_multibyte is + l_lines sys.dbms_preprocessor.source_lines_t; + l_result clob; begin - ut.expect( ut3.ut_utils.to_string(l_value) ).to_equal(l_expected); + l_lines := sys.dbms_preprocessor.get_post_processed_source( + object_type => 'PACKAGE', + schema_name => user, + object_name => 'TST_CHARS' + ); + + for i in 1..l_lines.count loop + l_result := null; + ut3.ut_utils.append_to_clob(l_result, l_lines(i)); + + --Assert + ut.expect(dbms_lob.getlength(l_result),'Error for index '||i).to_equal(dbms_lob.getlength(l_lines(i))); + end loop; end; --- --%test(to_string on null clob) --- procedure to_string_null_clob; --- --%test(to_string on clob) --- procedure to_string_clob; --- --%test(to_string on clob no surrounding quotes) --- procedure to_string_clob_no_quotes; --- --%test(to_string on clob other surrounding quotes) --- procedure to_string_clob_other_quotes; --- --- --%test(to_string on null number) --- procedure to_string_null_number; --- --%test(to_string on number) --- procedure to_string_number; --- --- --%test(to_string on null timestamp) --- procedure to_string_null_timestamp; --- --%test(to_string on timestamp) --- procedure to_string_timestamp; --- --- --%test(to_string on null timestamp with time zone) --- procedure to_string_null_timestamp_tz; --- --%test(to_string on timestamp with time zone) --- procedure to_string_timestamp_tz; --- --- --%test(to_string on null timestamp with local time zone) --- procedure to_string_null_timestamp_ltz; --- --%test(to_string on timestamp with local time zone) --- procedure to_string_timestamp_ltz; --- --- --%test(to_string on null varchar) --- procedure to_string_null_varchar; --- --%test(to_string on varchar) --- procedure to_string_varchar; --- --%test(to_string on varchar no surrounding quotes) --- procedure to_string_varchar_no_quotes; --- --%test(to_string on varchar non default surrounding quotes) --- procedure to_string_varchar_other_quotes; + procedure setup_append_with_multibyte is + pragma autonomous_transaction; + begin + select value into gv_nls_value from nls_session_parameters where parameter = 'NLS_DATE_LANGUAGE'; + execute immediate 'alter session set nls_date_language=ENGLISH'; + execute immediate 'create or replace package tst_chars as +-- 2) Status of the process = ‘PE’ with no linked data +end;'; + execute immediate 'alter session set nls_date_language=RUSSIAN'; + + end; + procedure clean_append_with_multibyte is + pragma autonomous_transaction; + begin + execute immediate 'alter session set nls_date_language='||gv_nls_value; + execute immediate 'drop package tst_chars'; + end; + + procedure test_clob_to_table_multibyte is + l_varchar2_byte_limit integer := 32767; + l_workaround_byte_limit integer := 8191; + l_singlebyte_string_max_size varchar2(32767 char) := rpad('x',l_varchar2_byte_limit,'x'); + l_twobyte_character char(1 char) := 'æ'; + l_clob_multibyte clob := l_twobyte_character||l_singlebyte_string_max_size; --here we have 32769(2+32767) bytes and 32768 chars + l_expected ut3.ut_varchar2_list := ut3.ut_varchar2_list(); + l_result ut3.ut_varchar2_list; + begin + l_expected.extend(1); + l_expected(1) := l_twobyte_character||substr(l_singlebyte_string_max_size,1,l_workaround_byte_limit-1); + --Act + l_result := ut3.ut_utils.clob_to_table(l_clob_multibyte); + --Assert + ut.expect(l_result(1)).to_equal(l_expected(1)); + end; -end; -/ \ No newline at end of file +end test_ut_utils; +/ diff --git a/test/ut_utils/test_ut_utils.pks b/test/ut_utils/test_ut_utils.pks index 32a354164..e9ef53be5 100644 --- a/test/ut_utils/test_ut_utils.pks +++ b/test/ut_utils/test_ut_utils.pks @@ -1,75 +1,57 @@ -create or replace package test_ut_utils as +create or replace package test_ut_utils is - --%suite(Testing common utility package: ut_utils) + --%suite --%suitepath(utplsql.core) - - --%context(clob_to_table) - - --%test(splits clob by delimiter) - procedure clob_to_table_by_delim; - - --%test(returns empty table for null clob) - procedure clob_to_table_null_data; - - --%test(splits table by char limit when no delimiter) - procedure clob_to_table_char_limit; - - --%test(splits table by char limit on overflow and continues by delimiter) - procedure clob_to_table_char_limit_delim; - - --%test(returns empty lines for null data between delimiter) - procedure clob_to_table_empty_lines; - - --%endcontext - - --%test(test_result_to_char) - procedure test_result_to_char; - - --%test(to_test_result converts boolean value to test result integer) - procedure to_test_result; - - --%test(to_string on null blob) - procedure to_string_null_blob; - --%test(to_string on blob) - procedure to_string_blob; - --- --%test(to_string on null clob) --- procedure to_string_null_clob; --- --%test(to_string on clob) --- procedure to_string_clob; --- --%test(to_string on clob no surrounding quotes) --- procedure to_string_clob_no_quotes; --- --%test(to_string on clob other surrounding quotes) --- procedure to_string_clob_other_quotes; --- --- --%test(to_string on null number) --- procedure to_string_null_number; --- --%test(to_string on number) --- procedure to_string_number; --- --- --%test(to_string on null timestamp) --- procedure to_string_null_timestamp; --- --%test(to_string on timestamp) --- procedure to_string_timestamp; --- --- --%test(to_string on null timestamp with time zone) --- procedure to_string_null_timestamp_tz; --- --%test(to_string on timestamp with time zone) --- procedure to_string_timestamp_tz; --- --- --%test(to_string on null timestamp with local time zone) --- procedure to_string_null_timestamp_ltz; --- --%test(to_string on timestamp with local time zone) --- procedure to_string_timestamp_ltz; --- --- --%test(to_string on null varchar) --- procedure to_string_null_varchar; --- --%test(to_string on varchar) --- procedure to_string_varchar; --- --%test(to_string on varchar no surrounding quotes) --- procedure to_string_varchar_no_quotes; --- --%test(to_string on varchar non default surrounding quotes) --- procedure to_string_varchar_other_quotes; - -end; + + --%test + procedure test_clob_to_table; + + --%test + procedure test_to_char; + + --%test + procedure test_to_string_blob; + + --%test + procedure test_to_string_clob; + + --%test + procedure test_to_string_date; + + --%test + procedure to_string_null; + + --%test + procedure to_string; + + --%test(Trims long Blob to max lenght and appends '[...]' at the end of string) + procedure to_string_big_blob; + + --%test(Trims long Clob to max lenght and appends '[...]' at the end of string) + procedure to_string_big_clob; + + --%test(Returns a full string representation of a very big number) + procedure to_string_big_number; + + --%test(Trims long varchars to max lenght and appends '[...]' at the end of string) + procedure to_string_big_varchar2; + + --%test(Returns a full string representation of a very small number) + procedure to_string_big_tiny_number; + + --%test(Table to clob function test) + procedure test_table_to_clob; + + --%test(append_to_clob works With Multi Byte Chars) + --%beforetest(setup_append_with_multibyte) + --%aftertest(clean_append_with_multibyte) + procedure test_append_with_multibyte; + procedure setup_append_with_multibyte; + procedure clean_append_with_multibyte; + + --%test(clob_to_table multibyte) + procedure test_clob_to_table_multibyte; + + +end test_ut_utils; / From b7c59176b6c1446b5a2b2c0763724baf1b0f12da Mon Sep 17 00:00:00 2001 From: Pazus Date: Sun, 30 Jul 2017 12:18:39 +0300 Subject: [PATCH 07/42] implemented matcher tests --- test/install_tests.sql | 2 + test/ut_matchers/test_matchers.pkb | 539 +++++++++++++++++++++++++++++ test/ut_matchers/test_matchers.pks | 45 +++ 3 files changed, 586 insertions(+) create mode 100644 test/ut_matchers/test_matchers.pkb create mode 100644 test/ut_matchers/test_matchers.pks diff --git a/test/install_tests.sql b/test/install_tests.sql index 7d4e920e7..605c043f0 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -1,9 +1,11 @@ @ut_utils/test_ut_utils.pks @ut_annotations/test_annotations.pks +@ut_matchers/test_matchers.pks @ut_utils/test_ut_utils.pkb @ut_annotations/test_annotations.pkb +@ut_matchers/test_matchers.pkb show errors diff --git a/test/ut_matchers/test_matchers.pkb b/test/ut_matchers/test_matchers.pkb new file mode 100644 index 000000000..5808a9bf8 --- /dev/null +++ b/test/ut_matchers/test_matchers.pkb @@ -0,0 +1,539 @@ +create or replace package body test_matchers is + + procedure restore_asserts(a_assert_results ut3.ut_expectation_results) is + begin + ut3.ut_expectation_processor.clear_expectations; + + if a_assert_results is not null then + for i in 1 .. a_assert_results.count loop + ut3.ut_expectation_processor.add_expectation_result(a_assert_results(i)); + end loop; + end if; + end; + + procedure transfer_results is + l_assert_results ut3.ut_expectation_results; + l_new_result ut3_latest_release.ut_expectation_result; + begin + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + for i in 1..l_assert_results.count loop + l_new_result := ut3_latest_release.ut_expectation_result(l_assert_results(i).status, + l_assert_results(i).description, + l_assert_results(i).message); + l_new_result.caller_info := l_assert_results(i).caller_info; + ut3_latest_release.ut_expectation_processor.add_expectation_result(l_new_result); + end loop; + end; + + procedure exec_matcher(a_type varchar2, a_actual_value varchar2, a_expected_value varchar2, a_matcher varchar2, a_result integer, a_prefix varchar2 default null) is + l_assert_results ut3.ut_expectation_results; + l_result integer; + l_statement varchar2(32767); + begin + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + l_statement := 'declare + l_value1 '||a_type||' := '||a_actual_value||'; + l_value2 '||a_type||' := '||a_expected_value||'; +begin ut3.ut.expect(l_value1).'||a_prefix||'to_'||a_matcher||'(l_value2); end;'; + execute immediate l_statement; + l_result := ut3.ut_expectation_processor.get_status(); + restore_asserts(l_assert_results); + ut.expect(l_result, 'exec_'||a_matcher||':'||chr(10)||l_statement).to_equal(a_result); + end exec_matcher; + + procedure exec_be_between(a_type varchar2, a_actual_value varchar2, a_expected1_value varchar2, a_expected2_value varchar2,a_result integer) is + l_assert_results ut3.ut_expectation_results; + l_result integer; + l_statement varchar2(32767); + begin + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + l_statement := 'declare + l_actual_value '||a_type||' := '||a_actual_value||'; + l_value1 '||a_type||' := '||a_expected1_value||'; + l_value2 '||a_type||' := '||a_expected2_value||'; +begin ut3.ut.expect(l_actual_value).to_be_between(l_value1, l_value2); end;'; + execute immediate l_statement; + l_result := ut3.ut_expectation_processor.get_status(); + restore_asserts(l_assert_results); + ut.expect(l_result, 'exec_be_between:'||chr(10)||l_statement).to_equal(a_result); + end exec_be_between; + + procedure exec_be_less_than(a_type varchar2, a_actual_value varchar2, a_expected_value varchar2, a_result integer, a_prefix varchar2 default null) + is + begin + exec_matcher(a_type, a_actual_value, a_expected_value, 'be_less_than',a_result, a_prefix); + end; + + procedure exec_be_less_or_equal(a_type varchar2, a_actual_value varchar2, a_expected_value varchar2, a_result integer, a_prefix varchar2 default null) + is + begin + exec_matcher(a_type, a_actual_value, a_expected_value, 'be_less_or_equal',a_result, a_prefix); + end; + + procedure exec_be_greater_than(a_type varchar2, a_actual_value varchar2, a_expected_value varchar2, a_result integer, a_prefix varchar2 default null) + is + begin + exec_matcher(a_type, a_actual_value, a_expected_value, 'be_greater_than',a_result, a_prefix); + end; + + procedure exec_be_greater_or_equal(a_type varchar2, a_actual_value varchar2, a_expected_value varchar2, a_result integer, a_prefix varchar2 default null) + is + begin + exec_matcher(a_type, a_actual_value, a_expected_value, 'be_greater_or_equal',a_result, a_prefix); + end; + + procedure exec_be_between2(a_type varchar2, a_actual_value varchar2, a_expected1_value varchar2, a_expected2_value varchar2,a_result integer, a_not_prefix varchar2 default null) is + l_assert_results ut3.ut_expectation_results; + l_result integer; + l_statement varchar2(32767); + begin + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + l_statement := 'declare + l_actual_value '||a_type||' := '||a_actual_value||'; + l_value1 '||a_type||' := '||a_expected1_value||'; + l_value2 '||a_type||' := '||a_expected2_value||'; +begin ut3.ut.expect(l_actual_value).'||a_not_prefix||'to_be_between(l_value1, l_value2); end;'; + execute immediate l_statement; + l_result := ut3.ut_expectation_processor.get_status(); + restore_asserts(l_assert_results); + ut.expect(l_result, 'exec_be_between2:'||chr(10)||l_statement).to_equal(a_result); + end exec_be_between2; + + procedure exec_match(a_type varchar2, a_actual_value varchar2, a_pattern varchar2, a_modifiers varchar2, a_result integer, a_not_prefix varchar2 default null) is + l_statement varchar2(32767); + l_assert_results ut3.ut_expectation_results; + l_result integer; + begin + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + l_statement := 'declare + l_actual '||a_type||' := '||a_actual_value||'; + l_pattern varchar2(32767) := :a_pattern; + l_modifiers varchar2(32767) := :a_modifiers; + l_result integer; +begin ut3.ut.expect( l_actual ).'||a_not_prefix||'to_match(l_pattern, l_modifiers); end;'; + execute immediate l_statement using a_pattern, a_modifiers; + l_result := ut3.ut_expectation_processor.get_status(); + restore_asserts(l_assert_results); + ut.expect(l_result, 'exec_match:'||chr(10)||l_statement).to_equal(a_result); + end; + + procedure test_be_less_than is + begin + + exec_be_less_than('date', 'sysdate', 'sysdate-1', ut3.ut_utils.tr_failure, ''); + exec_be_less_than('number', '2.0', '1.99', ut3.ut_utils.tr_failure, ''); + exec_be_less_than('interval year to month', '''2-1''', '''2-0''', ut3.ut_utils.tr_failure, ''); + exec_be_less_than('interval day to second', '''2 01:00:00''', '''2 00:59:59''', ut3.ut_utils.tr_failure, ''); + exec_be_less_than('timestamp', 'to_timestamp(''1997 13'',''YYYY FF'')', 'to_timestamp(''1997 12'',''YYYY FF'')', ut3.ut_utils.tr_failure, ''); + exec_be_less_than('timestamp with time zone', 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')', 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')', ut3.ut_utils.tr_failure, ''); + exec_be_less_than('timestamp with local time zone', 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')', 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')', ut3.ut_utils.tr_failure, ''); + + exec_be_less_than('date', 'sysdate-1', 'sysdate', ut3.ut_utils.tr_success, ''); + exec_be_less_than('number', '1.0', '1.01', ut3.ut_utils.tr_success, ''); + exec_be_less_than('interval year to month', '''2-1''', '''2-2''', ut3.ut_utils.tr_success, ''); + exec_be_less_than('interval day to second', '''2 00:59:58''', '''2 00:59:59''', ut3.ut_utils.tr_success, ''); + exec_be_less_than('timestamp', 'to_timestamp(''1997 12'',''YYYY FF'')', 'to_timestamp(''1997 13'',''YYYY FF'')', ut3.ut_utils.tr_success, ''); + exec_be_less_than('timestamp with time zone', 'to_timestamp_tz(''1997 12 +03:00'',''YYYY FF TZR'')', 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')', ut3.ut_utils.tr_success, ''); + exec_be_less_than('timestamp with local time zone', 'to_timestamp_tz(''1997 12 +03:00'',''YYYY FF TZR'')', 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')', ut3.ut_utils.tr_success, ''); + + exec_be_less_than('date', 'sysdate', 'sysdate-1', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_than('number', '2.0', '1.99', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_than('interval year to month', '''2-1''', '''2-0''', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_than('interval day to second', '''2 01:00:00''', '''2 00:59:59''', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_than('timestamp', 'to_timestamp(''1997 13'',''YYYY FF'')', 'to_timestamp(''1997 12'',''YYYY FF'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_than('timestamp with time zone', 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')', 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_than('timestamp with local time zone', 'to_timestamp_tz(''1997 12 +01:00'',''YYYY FF TZR'')', 'to_timestamp_tz(''1997 12 +02:00'',''YYYY FF TZR'')', ut3.ut_utils.tr_success, 'not_'); + + end; + + procedure test_be_greater_or_equal is + begin + exec_be_greater_or_equal('date', 'sysdate', 'sysdate-1', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('number', '2.0', '1.99', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('interval year to month', '''2-1''', '''2-0''', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('interval day to second', '''2 01:00:00''', '''2 00:59:59''', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('timestamp', 'to_timestamp(''1997-01 09:26:50.13'',''YYYY-MM HH24.MI.SS.FF'')', 'to_timestamp(''1997-01 09:26:50.12'',''YYYY-MM HH24.MI.SS.FF'')', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success); + + exec_be_greater_or_equal('date', 'sysdate', 'sysdate', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('number', '1.99', '1.99', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('interval year to month', '''2-0''', '''2-0''', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('INTERVAL DAY TO SECOND', '''2 00:59:01''', '''2 00:59:01''', ut3.ut_utils.tr_success); + exec_be_greater_or_equal('timestamp', 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')', 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')', ut3.ut_utils.tr_success, ''); + exec_be_greater_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + exec_be_greater_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + + exec_be_greater_or_equal('date', 'sysdate-1', 'sysdate', ut3.ut_utils.tr_failure, ''); + exec_be_greater_or_equal('number', '1.0', '1.01', ut3.ut_utils.tr_failure, ''); + exec_be_greater_or_equal('interval year to month', '''2-1''', '''2-2''', ut3.ut_utils.tr_failure, ''); + exec_be_greater_or_equal('interval day to second', '''2 00:59:58''', '''2 00:59:59''', ut3.ut_utils.tr_failure, ''); + exec_be_greater_or_equal('timestamp', 'to_timestamp(''1997 09:26:50.12'',''YYYY HH24.MI.SS.FF'')', 'to_timestamp(''1997 09:26:50.13'',''YYYY HH24.MI.SS.FF'')', ut3.ut_utils.tr_failure, ''); + exec_be_greater_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_failure, ''); + exec_be_greater_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_failure, ''); + + exec_be_greater_or_equal('date', 'sysdate-2', 'sysdate-1', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_or_equal('number', '1.0', '1.99', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_or_equal('interval year to month', '''1-1''', '''2-0''', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_or_equal('interval day to second', '''1 01:00:00''', '''2 00:59:59''', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_or_equal('timestamp', 'to_timestamp(''1997-01 09:26:50.11'',''YYYY-MM HH24.MI.SS.FF'')', 'to_timestamp(''1997-01 09:26:50.12'',''YYYY-MM HH24.MI.SS.FF'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, 'not_'); + + end; + + procedure test_be_greater_than is + begin + + exec_be_greater_than('date', 'sysdate', 'sysdate-1', ut3.ut_utils.tr_success, ''); + exec_be_greater_than('number', '2.0', '1.99', ut3.ut_utils.tr_success, ''); + exec_be_greater_than('interval year to month', '''2-1''', '''2-0''', ut3.ut_utils.tr_success, ''); + exec_be_greater_than('interval day to second', '''2 01:00:00''', '''2 00:59:59''', ut3.ut_utils.tr_success, ''); + exec_be_greater_than('timestamp', 'to_timestamp(''1997 13'',''YYYY FF'')', 'to_timestamp(''1997 12'',''YYYY FF'')', ut3.ut_utils.tr_success, ''); + exec_be_greater_than('timestamp with time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + exec_be_greater_than('timestamp with local time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + + exec_be_greater_than('date', 'sysdate', 'sysdate', ut3.ut_utils.tr_failure, ''); + exec_be_greater_than('number', '1.0', '1.0', ut3.ut_utils.tr_failure, ''); + exec_be_greater_than('interval year to month', '''2-1''', '''2-1''', ut3.ut_utils.tr_failure, ''); + exec_be_greater_than('interval day to second', '''2 00:59:58''', '''2 00:59:58''', ut3.ut_utils.tr_failure, ''); + exec_be_greater_than('timestamp', 'to_timestamp(''1997 12'',''YYYY FF'')', 'to_timestamp(''1997 12'',''YYYY FF'')', ut3.ut_utils.tr_failure, ''); + exec_be_greater_than('timestamp with time zone', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997+02:00'',''YYYY TZR'')', ut3.ut_utils.tr_failure, ''); + exec_be_greater_than('timestamp with local time zone', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', ut3.ut_utils.tr_failure, ''); + + exec_be_greater_than('date', 'sysdate-1', 'sysdate-1', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_than('number', '1', '1.99', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_than('interval year to month', '''1-1''', '''2-0''', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_than('interval day to second', '''2 01:00:00''', '''2 01:00:00''', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_than('timestamp', 'to_timestamp(''1997 13'',''YYYY FF'')', 'to_timestamp(''1997 13'',''YYYY FF'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_than('timestamp with time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_greater_than('timestamp with local time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, 'not_'); + + end; + + procedure test_be_less_or_equal is + begin + + exec_be_less_or_equal('date', 'sysdate', 'sysdate-1', ut3.ut_utils.tr_failure, ''); + exec_be_less_or_equal('number', '2.0', '1.99', ut3.ut_utils.tr_failure, ''); + exec_be_less_or_equal('interval year to month', '''2-1''', '''2-0''', ut3.ut_utils.tr_failure, ''); + exec_be_less_or_equal('interval day to second', '''2 01:00:00''', '''2 00:59:59''', ut3.ut_utils.tr_failure, ''); + exec_be_less_or_equal('timestamp', 'to_timestamp(''1997 13'',''YYYY FF'')', 'to_timestamp(''1997 12'',''YYYY FF'')', ut3.ut_utils.tr_failure, ''); + exec_be_less_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_failure, ''); + exec_be_less_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_failure, ''); + + exec_be_less_or_equal('date', 'sysdate', 'sysdate', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('number', '1.99', '1.99', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('interval year to month', '''2-0''', '''2-0''', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('interval day to second', '''2 00:59:01''', '''2 00:59:01''', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('timestamp', 'to_timestamp(''1997 12'',''YYYY FF'')', 'to_timestamp(''1997 12'',''YYYY FF'')', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + + exec_be_less_or_equal('date', 'sysdate-1', 'sysdate', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('number', '1.0', '1.01', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('interval year to month', '''2-1''', '''2-2''', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('interval day to second', '''2 00:59:58''', '''2 00:59:59''', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('timestamp', 'to_timestamp(''1997 12'',''YYYY FF'')', 'to_timestamp(''1997 13'',''YYYY FF'')', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + exec_be_less_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +03:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, ''); + + exec_be_less_or_equal('date', 'sysdate', 'sysdate-1', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_or_equal('number', '2.0', '1.99', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_or_equal('interval year to month', '''2-1''', '''2-0''', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_or_equal('interval day to second', '''2 01:00:00''', '''2 00:59:59''', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_or_equal('timestamp', 'to_timestamp(''1997 13'',''YYYY FF'')', 'to_timestamp(''1997 12'',''YYYY FF'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_or_equal('timestamp with time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, 'not_'); + exec_be_less_or_equal('timestamp with local time zone', 'to_timestamp_tz(''1997 +01:00'',''YYYY TZR'')', 'to_timestamp_tz(''1997 +02:00'',''YYYY TZR'')', ut3.ut_utils.tr_success, 'not_'); + + end; + + procedure test_be_between is + begin + + exec_be_between('date', 'sysdate', 'sysdate-2', 'sysdate-1', ut3.ut_utils.tr_failure); + exec_be_between('number', '2.0', '1.99', '1.999', ut3.ut_utils.tr_failure); + exec_be_between('varchar2(1)', '''c''', '''a''', '''b''', ut3.ut_utils.tr_failure); + exec_be_between('interval year to month', '''2-2''', '''2-0''', '''2-1''', ut3.ut_utils.tr_failure); + exec_be_between('interval day to second', '''2 01:00:00''', '''2 00:59:58''', '''2 00:59:59''', ut3.ut_utils.tr_failure); + exec_be_between('timestamp', 'to_timestamp(''1997-01-31 09:26:50.13'',''YYYY-MM-DD HH24.MI.SS.FF'')', 'to_timestamp(''1997-01-31 09:26:50.11'',''YYYY-MM-DD HH24.MI.SS.FF'')', 'to_timestamp(''1997-01-31 09:26:50.12'',''YYYY-MM-DD HH24.MI.SS.FF'')', ut3.ut_utils.tr_failure); + exec_be_between('timestamp with local time zone', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +01:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +02:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +03:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', ut3.ut_utils.tr_failure); + exec_be_between('timestamp with time zone', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +01:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +02:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +03:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', ut3.ut_utils.tr_failure); + + exec_be_between('date', 'sysdate', 'sysdate-1', 'sysdate+1', ut3.ut_utils.tr_success); + exec_be_between('number', '2.0', '1.99', '2.01', ut3.ut_utils.tr_success); + exec_be_between('varchar2(1)', '''b''', '''a''', '''c''', ut3.ut_utils.tr_success); + exec_be_between('interval year to month', '''2-1''', '''2-0''', '''2-2''', ut3.ut_utils.tr_success); + exec_be_between('interval day to second', '''2 01:00:00''', '''2 00:59:58''', '''2 01:00:01''', ut3.ut_utils.tr_success); + exec_be_between('timestamp', 'to_timestamp(''1997-01-31 09:26:50.13'',''YYYY-MM-DD HH24.MI.SS.FF'')', 'to_timestamp(''1997-01-31 09:26:50.11'',''YYYY-MM-DD HH24.MI.SS.FF'')', 'to_timestamp(''1997-01-31 09:26:50.14'',''YYYY-MM-DD HH24.MI.SS.FF'')', ut3.ut_utils.tr_success); + exec_be_between('timestamp with local time zone', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +02:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +03:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +01:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', ut3.ut_utils.tr_success); + exec_be_between('timestamp with time zone', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +02:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +03:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', 'to_timestamp_tz(''1997-01-31 09:26:50.12 +01:00'',''YYYY-MM-DD HH24.MI.SS.FF TZR'')', ut3.ut_utils.tr_success); + end; + + procedure test_be_between2 is + begin + + --failure when value out of range + exec_be_between2('date', 'sysdate', 'sysdate-2', 'sysdate-1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('number', '2.0', '1.99', '1.999', ut3.ut_utils.tr_failure, ''); + exec_be_between2('varchar2(1)', '''c''', '''a''', '''b''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp', 'systimestamp+1', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp with local time zone', 'systimestamp+1', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp with time zone', 'systimestamp+1', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_failure, ''); + exec_be_between2('interval year to month', '''2-2''', '''2-0''', '''2-1''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('interval day to second', '''2 01:00:00''', '''2 00:59:58''', '''2 00:59:59''', ut3.ut_utils.tr_failure, ''); + + --success when value in range + exec_be_between2('date', 'sysdate', 'sysdate-1', 'sysdate+1', ut3.ut_utils.tr_success, ''); + exec_be_between2('number', '2.0', '1.99', '2.01', ut3.ut_utils.tr_success, ''); + exec_be_between2('varchar2(1)', '''b''', '''a''', '''c''', ut3.ut_utils.tr_success, ''); + exec_be_between2('timestamp', 'systimestamp', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_success, ''); + exec_be_between2('timestamp with local time zone', 'systimestamp', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_success, ''); + exec_be_between2('timestamp with time zone', 'systimestamp', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_success, ''); + exec_be_between2('interval year to month', '''2-1''', '''2-0''', '''2-2''', ut3.ut_utils.tr_success, ''); + exec_be_between2('interval day to second', '''2 01:00:00''', '''2 00:59:58''', '''2 01:00:01''', ut3.ut_utils.tr_success, ''); + + --success when value not in range + exec_be_between2('date', 'sysdate', 'sysdate-2', 'sysdate-1', ut3.ut_utils.tr_success, 'not_'); + exec_be_between2('number', '2.0', '1.99', '1.999', ut3.ut_utils.tr_success, 'not_'); + exec_be_between2('varchar2(1)', '''c''', '''a''', '''b''', ut3.ut_utils.tr_success, 'not_'); + exec_be_between2('timestamp', 'systimestamp+1', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_success, 'not_'); + exec_be_between2('timestamp with local time zone', 'systimestamp+1', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_success, 'not_'); + exec_be_between2('timestamp with time zone', 'systimestamp+1', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_success, 'not_'); + exec_be_between2('interval year to month', '''2-2''', '''2-0''', '''2-1''', ut3.ut_utils.tr_success, 'not_'); + exec_be_between2('interval day to second', '''2 01:00:00''', '''2 00:59:58''', '''2 00:59:59''', ut3.ut_utils.tr_success, 'not_'); + + --failure when value not out of range + exec_be_between2('date', 'sysdate', 'sysdate-1', 'sysdate+1', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('number', '2.0', '1.99', '2.01', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('varchar2(1)', '''b''', '''a''', '''c''', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp', 'systimestamp', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp with local time zone', 'systimestamp', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp with time zone', 'systimestamp', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('interval year to month', '''2-1''', '''2-0''', '''2-2''', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('interval day to second', '''2 01:00:00''', '''2 00:59:58''', '''2 01:00:01''', ut3.ut_utils.tr_failure, 'not_'); + + --failure when value is null + exec_be_between2('date', 'null', 'sysdate-1', 'sysdate+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('number', 'null', '1.99', '2.01', ut3.ut_utils.tr_failure, ''); + exec_be_between2('varchar2(1)', 'null', '''a''', '''c''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp', 'null', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp with local time zone', 'null', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp with time zone', 'null', 'systimestamp-1', 'systimestamp+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('interval year to month', 'null', '''2-0''', '''2-2''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('interval day to second', 'null', '''2 00:59:58''', '''2 01:00:01''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('date', 'null', 'sysdate-2', 'sysdate-1', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('number', 'null', '1.99', '1.999', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('varchar2(1)', 'null', '''a''', '''b''', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp', 'null', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp with local time zone', 'null', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp with time zone', 'null', 'systimestamp-1', 'systimestamp', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('interval year to month', 'null', '''2-0''', '''2-1''', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('interval day to second', 'null', '''2 00:59:58''', '''2 00:59:59''', ut3.ut_utils.tr_failure, 'not_'); + + --failure when lower bound is null + exec_be_between2('date', 'sysdate', 'null', 'sysdate+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('number', '2.0', 'null', '2.01', ut3.ut_utils.tr_failure, ''); + exec_be_between2('varchar2(1)', '''b''', 'null', '''c''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp', 'systimestamp', 'null', 'systimestamp+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp with local time zone', 'systimestamp', 'null', 'systimestamp+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('timestamp with time zone', 'systimestamp', 'null', 'systimestamp+1', ut3.ut_utils.tr_failure, ''); + exec_be_between2('interval year to month', '''2-1''', 'null', '''2-2''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('interval day to second', '''2 01:00:00''', 'null', '''2 01:00:01''', ut3.ut_utils.tr_failure, ''); + exec_be_between2('date', 'sysdate', 'null', 'sysdate-1', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('number', '2.0', 'null', '1.999', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('varchar2(1)', '''b''', 'null', '''b''', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp', 'systimestamp+1', 'null', 'systimestamp', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp with local time zone', 'systimestamp+1', 'null', 'systimestamp', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('timestamp with time zone', 'systimestamp+1', 'null', 'systimestamp', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('interval year to month', '''2-2''', 'null', '''2-1''', ut3.ut_utils.tr_failure, 'not_'); + exec_be_between2('interval day to second', '''2 01:00:00''', 'null', '''2 00:59:59''', ut3.ut_utils.tr_failure, 'not_'); + end; + + procedure test_match is + begin + exec_match('varchar2(100)', '''Stephen''', '^Ste(v|ph)en$', '', ut3.ut_utils.tr_success, ''); + exec_match('varchar2(100)', '''sTEPHEN''', '^Ste(v|ph)en$', 'i', ut3.ut_utils.tr_success, ''); + exec_match('clob', 'rpad('', '',32767)||''Stephen''', 'Ste(v|ph)en$', '', ut3.ut_utils.tr_success, ''); + exec_match('clob', 'rpad('', '',32767)||''sTEPHEN''', 'Ste(v|ph)en$', 'i', ut3.ut_utils.tr_success, ''); + + exec_match('varchar2(100)', '''Stephen''', '^Steven$', '', ut3.ut_utils.tr_failure, ''); + exec_match('varchar2(100)', '''sTEPHEN''', '^Steven$', 'i', ut3.ut_utils.tr_failure, ''); + exec_match('clob', 'to_clob(rpad('', '',32767)||''Stephen'')', '^Stephen', '', ut3.ut_utils.tr_failure, ''); + exec_match('clob', 'to_clob(rpad('', '',32767)||''sTEPHEN'')', '^Stephen', 'i', ut3.ut_utils.tr_failure, ''); + + exec_match('varchar2(100)', '''Stephen''', '^Ste(v|ph)en$', '', ut3.ut_utils.tr_failure, 'not_'); + exec_match('varchar2(100)', '''sTEPHEN''', '^Ste(v|ph)en$', 'i', ut3.ut_utils.tr_failure, 'not_'); + exec_match('clob', 'rpad('', '',32767)||''Stephen''', 'Ste(v|ph)en$', '', ut3.ut_utils.tr_failure, 'not_'); + exec_match('clob', 'rpad('', '',32767)||''sTEPHEN''', 'Ste(v|ph)en$', 'i', ut3.ut_utils.tr_failure, 'not_'); + + exec_match('varchar2(100)', '''Stephen''', '^Steven$', '', ut3.ut_utils.tr_success, 'not_'); + exec_match('varchar2(100)', '''sTEPHEN''', '^Steven$', 'i', ut3.ut_utils.tr_success, 'not_'); + exec_match('clob', 'to_clob(rpad('', '',32767)||''Stephen'')', '^Stephen', '', ut3.ut_utils.tr_success, 'not_'); + exec_match('clob', 'to_clob(rpad('', '',32767)||''sTEPHEN'')', '^Stephen', 'i', ut3.ut_utils.tr_success, 'not_'); + end; + + procedure test_be_empty_cursor is + l_cursor sys_refcursor; + l_result integer; + l_assert_results ut3.ut_expectation_results; + begin + open l_cursor for select * from dual where 1 = 2; + ut3.ut.expect(l_cursor).to_be_empty; + + transfer_results; + + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + open l_cursor for select * from dual where 1 = 1; + ut3.ut.expect(l_cursor).to_be_empty; + + l_result := ut3.ut_expectation_processor.get_status; + restore_asserts(l_assert_results); + + ut.expect(l_result,'Expect cursor to be not empty').to_equal(ut3.ut_utils.tr_failure); + end; + + procedure test_be_nonempty_cursor is + l_cursor sys_refcursor; + l_result integer; + l_assert_results ut3.ut_expectation_results; + begin + open l_cursor for select * from dual where 1 = 1; + ut3.ut.expect(l_cursor).not_to_be_empty; + + transfer_results; + + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + open l_cursor for select * from dual where 1 = 2; + ut3.ut.expect(l_cursor).not_to_be_empty; + + l_result := ut3.ut_expectation_processor.get_status; + restore_asserts(l_assert_results); + + ut.expect(l_result,'Expect cursor to be empty').to_equal(ut3.ut_utils.tr_failure); + end; + + procedure test_be_empty_collection is + l_result integer; + l_assert_results ut3.ut_expectation_results; + begin + ut3.ut.expect(anydata.convertcollection(ora_mining_varchar2_nt())).to_be_empty; + + transfer_results; + + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + + ut3.ut.expect(anydata.convertcollection(ora_mining_varchar2_nt('a'))).to_be_empty; + l_result := ut3.ut_expectation_processor.get_status; + restore_asserts(l_assert_results); + + ut.expect(l_result,'Expect collection to be not empty').to_equal(ut3.ut_utils.tr_failure); + end; + + procedure test_be_nonempty_collection is + l_result integer; + l_assert_results ut3.ut_expectation_results; + begin + ut3.ut.expect(anydata.convertcollection(ora_mining_varchar2_nt('a'))).not_to_be_empty; + + transfer_results; + + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + + ut3.ut.expect(anydata.convertcollection(ora_mining_varchar2_nt())).not_to_be_empty; + l_result := ut3.ut_expectation_processor.get_status; + restore_asserts(l_assert_results); + + ut.expect(l_result,'Expect collection to be empty').to_equal(ut3.ut_utils.tr_failure); + end; + + procedure test_be_empty_others is + l_var1 ut3.ut_data_value_number; + l_var2 ut3.ut_data_value_number; + l_assert_results ut3.ut_expectation_results; + l_new_result ut3_latest_release.ut_expectation_result; + begin + l_var1 := ut3.ut_data_value_number(1); + ut3.ut.expect(anydata.ConvertObject(l_var1)).not_to_be_empty; + ut3.ut.expect(anydata.ConvertObject(l_var2)).to_be_empty; + + transfer_results; + end; + + procedure test_be_like is + procedure exec_be_like(a_type varchar2, a_value varchar2, a_pattern varchar2, a_escape varchar2, a_result integer, a_prefix varchar2) is + l_result integer; + l_assert_results ut3.ut_expectation_results; + begin + l_assert_results := ut3.ut_expectation_processor.get_expectations_results; + execute immediate 'declare + l_actual ' || a_type || ' := '||a_value||'; + l_pattern varchar2(32767) := :pattern; + l_escape_char varchar2(32767) := :a_escape; + l_result integer; + begin ut3.ut.expect( l_actual ).' || a_prefix || + q'[to_be_like(l_pattern, l_escape_char); + :l_result := ut3.ut_expectation_processor.get_status(); end;]' + using a_pattern, a_escape, out l_result; + restore_asserts(l_assert_results); + ut.expect(l_result + ,'expected: ''' || a_value || ''', to be like ''' || a_pattern || ''' escape ''' || a_escape || '''').to_equal(a_result); + + end; + begin + exec_be_like('varchar2(100)', '''Stephen_King''', 'Ste__en%', '', ut3.ut_utils.tr_success, ''); + exec_be_like('varchar2(100)', '''Stephen_King''', 'Ste__en\_K%', '\', ut3.ut_utils.tr_success, ''); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Ste__en%', '', ut3.ut_utils.tr_success, ''); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Ste__en\_K%', '\', ut3.ut_utils.tr_success, ''); + + exec_be_like('varchar2(100)', '''Stephen_King''', 'Ste_en%', '', ut3.ut_utils.tr_failure, ''); + exec_be_like('varchar2(100)', '''Stephen_King''', 'Stephe\__%', '\', ut3.ut_utils.tr_failure, ''); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Ste_en%', '', ut3.ut_utils.tr_failure, ''); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Stephe\__%', '\', ut3.ut_utils.tr_failure, ''); + + exec_be_like('varchar2(100)', '''Stephen_King''', 'Ste__en%', '', ut3.ut_utils.tr_failure, 'not_'); + exec_be_like('varchar2(100)', '''Stephen_King''', 'Ste__en\_K%', '\', ut3.ut_utils.tr_failure, 'not_'); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Ste__en%', '', ut3.ut_utils.tr_failure, 'not_'); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Ste__en\_K%', '\', ut3.ut_utils.tr_failure, 'not_'); + + exec_be_like('varchar2(100)', '''Stephen_King''', 'Ste_en%', '', ut3.ut_utils.tr_success, 'not_'); + exec_be_like('varchar2(100)', '''Stephen_King''', 'Stephe\__%', '\', ut3.ut_utils.tr_success, 'not_'); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Ste_en%', '', ut3.ut_utils.tr_success, 'not_'); + exec_be_like('clob', 'rpad(''a'',32767,''a'')||''Stephen_King''', 'a%Stephe\__%', '\', ut3.ut_utils.tr_success, 'not_'); + end; + + procedure test_timestamp_between is + l_value timestamp := to_timestamp('1997-01-31 09:26:50.13','YYYY-MM-DD HH24.MI.SS.FF'); + l_value_lower timestamp := to_timestamp('1997-01-31 09:26:50.11','YYYY-MM-DD HH24.MI.SS.FF'); + l_value_upper timestamp := to_timestamp('1997-01-31 09:26:50.14','YYYY-MM-DD HH24.MI.SS.FF'); + begin + ut3.ut.expect(l_value).to_be_between(l_value_lower, l_value_upper); + ut3.ut.expect(l_value).not_to_be_between(l_value_upper, l_value_lower); + + transfer_results; + end; + + procedure test_timestamp_ltz_between is + l_value timestamp with local time zone := to_timestamp_tz('1997-01-31 09:26:50.12 +02:00','YYYY-MM-DD HH24.MI.SS.FF TZR'); + l_value_lower timestamp with local time zone := to_timestamp_tz('1997-01-31 09:26:50.12 +03:00','YYYY-MM-DD HH24.MI.SS.FF TZR'); + l_value_upper timestamp with local time zone := to_timestamp_tz('1997-01-31 09:26:50.12 +01:00','YYYY-MM-DD HH24.MI.SS.FF TZR'); + begin + ut3.ut.expect(l_value).to_be_between(l_value_lower, l_value_upper); + ut3.ut.expect(l_value).not_to_be_between(l_value_upper, l_value_lower); + + transfer_results; + end; + + procedure test_timestamp_tz_between is + l_value timestamp with time zone := to_timestamp_tz('1997-01-31 09:26:50.12 +02:00','YYYY-MM-DD HH24.MI.SS.FF TZR'); + l_value_lower timestamp with time zone := to_timestamp_tz('1997-01-31 09:26:50.12 +03:00','YYYY-MM-DD HH24.MI.SS.FF TZR'); + l_value_upper timestamp with time zone := to_timestamp_tz('1997-01-31 09:26:50.12 +01:00','YYYY-MM-DD HH24.MI.SS.FF TZR'); + begin + ut3.ut.expect(l_value).to_be_between(l_value_lower, l_value_upper); + ut3.ut.expect(l_value).not_to_be_between(l_value_upper, l_value_lower); + + transfer_results; + end; + +end test_matchers; +/ diff --git a/test/ut_matchers/test_matchers.pks b/test/ut_matchers/test_matchers.pks new file mode 100644 index 000000000..d993938ee --- /dev/null +++ b/test/ut_matchers/test_matchers.pks @@ -0,0 +1,45 @@ +create or replace package test_matchers is + + --%suite(matchers) + --%suitepath(utplsql.core) + + --%test + procedure test_be_less_than; + --%test + procedure test_be_greater_or_equal; + --%test + procedure test_be_greater_than; + --%test + procedure test_be_less_or_equal; + --%test + procedure test_be_between; + --%test + procedure test_be_between2; + --%test + procedure test_match; + --%test + procedure test_be_empty_cursor; + --%test + procedure test_be_nonempty_cursor; + --%test + procedure test_be_empty_collection; + --%test + procedure test_be_nonempty_collection; + --%test + --%disabled + procedure test_be_empty_others; + + --%test + procedure test_be_like; + + --%test + procedure test_timestamp_between; + + --%test + procedure test_timestamp_ltz_between; + + --%test + procedure test_timestamp_tz_between; + +end test_matchers; +/ From 74f6bc99fd792ea3a75e6da0fd9edf364a13dfe8 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sun, 30 Jul 2017 12:41:20 +0300 Subject: [PATCH 08/42] splitted old and new tests rearranged installation procedure, splitted into two phases --- .travis.yml | 4 +++- .../create_additional_grants_for_old_tests.sh | 23 +++++++++++++++++++ .travis/install.sh | 6 +---- ..._examples_and_tests.sh => run_examples.sh} | 8 +------ .travis/run_old_tests.sh | 9 ++++++++ 5 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 .travis/create_additional_grants_for_old_tests.sh rename .travis/{run_examples_and_tests.sh => run_examples.sh} (74%) create mode 100644 .travis/run_old_tests.sh diff --git a/.travis.yml b/.travis.yml index 0d455e422..428f67d5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,8 +85,10 @@ before_script: script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi - - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples_and_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/create_additional_grants_for_old_tests.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_old_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then sonar-scanner; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi - bash .travis/build_docs.sh diff --git a/.travis/create_additional_grants_for_old_tests.sh b/.travis/create_additional_grants_for_old_tests.sh new file mode 100644 index 000000000..c07bfc4a7 --- /dev/null +++ b/.travis/create_additional_grants_for_old_tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +cd source +set -ev + +#additional privileges to run scripted tests +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL +set feedback on +--needed for Mystats script to work +grant select any dictionary to $UT3_OWNER; +--Needed for testing a coverage outside ut3_owner. +grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER; + +exit +SQL + +#Create additional users +"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL +set feedback off +@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE + +exit +SQL \ No newline at end of file diff --git a/.travis/install.sh b/.travis/install.sh index 765dd0abb..edbaf89ce 100644 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -26,14 +26,10 @@ SQL #Create additional users "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL set feedback off -@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE @create_utplsql_owner.sql $UT3_TESTER $UT3_TESTER_PASSWORD $UT3_TABLESPACE -exit -SQL -"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL set feedback on --Needed for testing coverage outside of main UT3 schema. -grant create any procedure, drop any procedure, execute any procedure to $UT3_TESTER; +grant create any procedure, drop any procedure, execute any procedure, execute any type to $UT3_TESTER; exit SQL diff --git a/.travis/run_examples_and_tests.sh b/.travis/run_examples.sh similarity index 74% rename from .travis/run_examples_and_tests.sh rename to .travis/run_examples.sh index bd15b4059..60ef6dbc6 100644 --- a/.travis/run_examples_and_tests.sh +++ b/.travis/run_examples.sh @@ -14,10 +14,4 @@ conn $UT3_USER/$UT3_USER_PASSWORD@//$CONNECTION_STR exit -SQL - -"$SQLCLI" $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR < Date: Sun, 30 Jul 2017 13:21:12 +0300 Subject: [PATCH 09/42] added test_output_buffer tests added additional grants to ut3_tester --- .travis/install.sh | 2 +- test/install_tests.sql | 2 + test/ut_output_buffer/test_output_buffer.pkb | 80 ++++++++++++++++++++ test/ut_output_buffer/test_output_buffer.pks | 22 ++++++ 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 test/ut_output_buffer/test_output_buffer.pkb create mode 100644 test/ut_output_buffer/test_output_buffer.pks diff --git a/.travis/install.sh b/.travis/install.sh index edbaf89ce..302675c29 100644 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -30,6 +30,6 @@ set feedback off set feedback on --Needed for testing coverage outside of main UT3 schema. -grant create any procedure, drop any procedure, execute any procedure, execute any type to $UT3_TESTER; +grant create any procedure, drop any procedure, execute any procedure, execute any type, select any table, delete any table to $UT3_TESTER; exit SQL diff --git a/test/install_tests.sql b/test/install_tests.sql index 605c043f0..ce1ea5bb4 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -2,10 +2,12 @@ @ut_utils/test_ut_utils.pks @ut_annotations/test_annotations.pks @ut_matchers/test_matchers.pks +@ut_output_buffer/test_output_buffer.pks @ut_utils/test_ut_utils.pkb @ut_annotations/test_annotations.pkb @ut_matchers/test_matchers.pkb +@ut_output_buffer/test_output_buffer.pkb show errors diff --git a/test/ut_output_buffer/test_output_buffer.pkb b/test/ut_output_buffer/test_output_buffer.pkb new file mode 100644 index 000000000..f79dc25a4 --- /dev/null +++ b/test/ut_output_buffer/test_output_buffer.pkb @@ -0,0 +1,80 @@ +create or replace package body test_output_buffer is + + procedure test_recieve is + l_result varchar2(4000); + l_remaining integer; + l_expected varchar2(4000); + l_reporter ut3.ut_reporter_base :=ut3. ut_documentation_reporter(); + begin + --Act + l_expected := lpad('a text',4000,',a text'); + ut3.ut_output_buffer.send_line(l_reporter, l_expected); + + select * into l_result from table(ut3.ut_output_buffer.get_lines(l_reporter.reporter_id,0)); + + ut.expect(l_result).to_equal(l_expected); + + select count(1) into l_remaining from ut3.ut_output_buffer_tmp where reporter_id = l_reporter.reporter_id; + + ut.expect(l_remaining).to_equal(0); + end; + + procedure test_doesnt_send_on_null_id is + l_cur sys_refcursor; + begin + delete from ut3.ut_output_buffer_tmp; + --Act + ut3.ut_output_buffer.send_line(null,'a text to send'); + + open l_cur for select * from ut3.ut_output_buffer_tmp; + + ut.expect(l_cur).to_be_empty; + end; + + procedure test_doesnt_send_on_null_text is + l_cur sys_refcursor; + l_result integer; + l_reporter ut3.ut_reporter_base := ut3.ut_documentation_reporter(); + begin + delete from ut3.ut_output_buffer_tmp; + --Act + ut3.ut_output_buffer.send_line(l_reporter,null); + + open l_cur for select * from ut3.ut_output_buffer_tmp; + ut.expect(l_cur).to_be_empty; + end; + + procedure test_send_line is + l_result varchar2(4000); + c_expected constant varchar2(4000) := lpad('a text',4000,',a text'); + l_reporter ut3.ut_reporter_base := ut3.ut_documentation_reporter(); + begin + ut3.ut_output_buffer.send_line(l_reporter, c_expected); + + select text into l_result from ut3.ut_output_buffer_tmp where reporter_id = l_reporter.reporter_id; + + ut.expect(l_result).to_equal(c_expected); + end; + + procedure test_waiting_for_data is + l_result varchar2(4000); + l_remaining integer; + l_expected varchar2(4000); + l_reporter ut3.ut_reporter_base := ut3.ut_documentation_reporter(); + begin + --Act + l_expected := lpad('a text',4000,',a text'); + ut3.ut_output_buffer.send_line(l_reporter, l_expected); + + select * into l_result from table(ut3.ut_output_buffer.get_lines(l_reporter.reporter_id,0)); + + ut.expect(l_result).to_equal(l_expected); + + select count(1) into l_remaining from ut3.ut_output_buffer_tmp where reporter_id = l_reporter.reporter_id; + + ut.expect(l_remaining).to_equal(0); + + end; + +end test_output_buffer; +/ diff --git a/test/ut_output_buffer/test_output_buffer.pks b/test/ut_output_buffer/test_output_buffer.pks new file mode 100644 index 000000000..b17017134 --- /dev/null +++ b/test/ut_output_buffer/test_output_buffer.pks @@ -0,0 +1,22 @@ +create or replace package test_output_buffer is + + --%suite(output_buffer) + --%suitepath(utplsql.core) + + --%test(Recieves a line from buffer table and deletes) + procedure test_recieve; + + --%test(Does not send line if null reporter id given) + procedure test_doesnt_send_on_null_id; + + --%test(Does not send line if null text given) + procedure test_doesnt_send_on_null_text; + + --%test(Sends a line into buffer table) + procedure test_send_line; + + --%test(Waits For The Data To Appear For Specified Time) + procedure test_waiting_for_data; + +end test_output_buffer; +/ From d34c9a69c5010ecbaaf9ac1532fcdb23b188855d Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 3 Aug 2017 00:55:55 +0100 Subject: [PATCH 10/42] Updated test script to capture failed tests and return non-zero exit code. Fixed sonar properties. Moved new tests to the end of the build process. --- .travis.yml | 2 +- sonar-project.properties | 4 ++-- test/install_and_run_tests.sh | 22 ++++++++++++++-------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 428f67d5d..0f00b0b81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,10 +85,10 @@ before_script: script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi - - if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/create_additional_grants_for_old_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_old_tests.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then sonar-scanner; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi - bash .travis/build_docs.sh diff --git a/sonar-project.properties b/sonar-project.properties index 356f9b818..d8def2b1b 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,9 +9,9 @@ sonar.projectVersion=v3.0.2 # If not set, SonarQube starts looking for source code from the directory containing # the sonar-project.properties file. sonar.sources=./source -sonar.coverageReportPaths=./tests/coverage.xml,coverage.xml +sonar.coverageReportPaths=./test/coverage.xml,coverage.xml sonar.tests=./test -sonar.testExecutionReportPaths=test_results.xml +sonar.testExecutionReportPaths=./test/test_results.xml sonar.links.issue=https://github.com/utPLSQL/utPLSQL/issues sonar.links.ci=https://travis-ci.org/utPLSQL/utPLSQL sonar.links.homepage=https://github.com/utPLSQL/utPLSQL diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 76a6cb298..6e9949a94 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -1,14 +1,20 @@ #!/bin/bash set -ev -cd test +#cd test +# +#"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql +# +#cd .. +# +#utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ +#-source_path=source -test_path=tests \ +#-f=ut_documentation_reporter -c -o=test_results.log -s \ +#-f=ut_coverage_sonar_reporter -o=coverage.xml \ +#-f=ut_sonar_test_reporter -o=test_results.xml -"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql +status_line_regex="^[0-9]+ tests, ([0-9]+) failed, ([0-9]+) errored.*" -cd .. +RC=$(cat test_results.log | grep -E "${status_line_regex}" | sed -re "s/${status_line_regex}/\1\2/") -utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=source -test_path=tests \ --f=ut_documentation_reporter -c \ --f=ut_coverage_sonar_reporter -o=coverage.xml \ --f=ut_sonar_test_reporter -o=test_results.xml +exit $RC From 1b2dd8c95d0150b4355bbc82d93e6ceba94b882b Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 3 Aug 2017 01:20:26 +0100 Subject: [PATCH 11/42] Enabling tests. --- test/install_and_run_tests.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 6e9949a94..01833998c 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -1,17 +1,17 @@ #!/bin/bash set -ev -#cd test -# -#"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql -# -#cd .. -# -#utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ -#-source_path=source -test_path=tests \ -#-f=ut_documentation_reporter -c -o=test_results.log -s \ -#-f=ut_coverage_sonar_reporter -o=coverage.xml \ -#-f=ut_sonar_test_reporter -o=test_results.xml +cd test + +"$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql + +cd .. + +utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ +-source_path=source -test_path=tests \ +-f=ut_documentation_reporter -c -o=test_results.log -s \ +-f=ut_coverage_sonar_reporter -o=coverage.xml \ +-f=ut_sonar_test_reporter -o=test_results.xml status_line_regex="^[0-9]+ tests, ([0-9]+) failed, ([0-9]+) errored.*" From cc400cbf36e4179afc5cf12a2c6775303f183f23 Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 3 Aug 2017 01:42:09 +0100 Subject: [PATCH 12/42] Fixing utplsql-cli run invocation. --- sonar-project.properties | 4 ++-- test/install_and_run_tests.sh | 5 ++++- test/install_tests.sql | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index d8def2b1b..a2f7ec05b 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -9,9 +9,9 @@ sonar.projectVersion=v3.0.2 # If not set, SonarQube starts looking for source code from the directory containing # the sonar-project.properties file. sonar.sources=./source -sonar.coverageReportPaths=./test/coverage.xml,coverage.xml +sonar.coverageReportPaths=./tests/coverage.xml,coverage.xml sonar.tests=./test -sonar.testExecutionReportPaths=./test/test_results.xml +sonar.testExecutionReportPaths=./test_results.xml sonar.links.issue=https://github.com/utPLSQL/utPLSQL/issues sonar.links.ci=https://travis-ci.org/utPLSQL/utPLSQL sonar.links.homepage=https://github.com/utPLSQL/utPLSQL diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 01833998c..2174de779 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -9,12 +9,15 @@ cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ -source_path=source -test_path=tests \ --f=ut_documentation_reporter -c -o=test_results.log -s \ +-f=ut_documentation_reporter -c \ +-f=ut_documentation_reporter -o=test_results.log \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ -f=ut_sonar_test_reporter -o=test_results.xml status_line_regex="^[0-9]+ tests, ([0-9]+) failed, ([0-9]+) errored.*" +cat coverage.xml + RC=$(cat test_results.log | grep -E "${status_line_regex}" | sed -re "s/${status_line_regex}/\1\2/") exit $RC diff --git a/test/install_tests.sql b/test/install_tests.sql index ce1ea5bb4..ad048a200 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -5,6 +5,7 @@ @ut_output_buffer/test_output_buffer.pks @ut_utils/test_ut_utils.pkb +show errors @ut_annotations/test_annotations.pkb @ut_matchers/test_matchers.pkb @ut_output_buffer/test_output_buffer.pkb From 34b94dea2001669fb677e9d3e863592572303332 Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 3 Aug 2017 02:46:32 +0100 Subject: [PATCH 13/42] Enabling coverage for the framework. --- test/core.pkb | 9 +++++++++ test/core.pks | 10 ++++++++++ test/install_and_run_tests.sh | 3 ++- test/install_tests.sql | 3 ++- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 test/core.pkb create mode 100644 test/core.pks diff --git a/test/core.pkb b/test/core.pkb new file mode 100644 index 000000000..72f069410 --- /dev/null +++ b/test/core.pkb @@ -0,0 +1,9 @@ +create or replace package body core is + + procedure enable_develop_coverage is + begin + ut3.ut_coverage.coverage_start_develop(); + end; + +end; +/ diff --git a/test/core.pks b/test/core.pks new file mode 100644 index 000000000..c43de5e12 --- /dev/null +++ b/test/core.pks @@ -0,0 +1,10 @@ +create or replace package core is + + --%suite + --%suitepath(utplsql) + + --%beforeall + procedure enable_develop_coverage; + +end; +/ diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 2174de779..69e183312 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -8,7 +8,7 @@ cd test cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=source -test_path=tests \ +-source_path=source -test_path=test \ -f=ut_documentation_reporter -c \ -f=ut_documentation_reporter -o=test_results.log \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ @@ -17,6 +17,7 @@ utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_ST status_line_regex="^[0-9]+ tests, ([0-9]+) failed, ([0-9]+) errored.*" cat coverage.xml +cat test_results.xml RC=$(cat test_results.log | grep -E "${status_line_regex}" | sed -re "s/${status_line_regex}/\1\2/") diff --git a/test/install_tests.sql b/test/install_tests.sql index ad048a200..c4dcbce0a 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -1,11 +1,12 @@ +@core.pks @ut_utils/test_ut_utils.pks @ut_annotations/test_annotations.pks @ut_matchers/test_matchers.pks @ut_output_buffer/test_output_buffer.pks +@core.pkb @ut_utils/test_ut_utils.pkb -show errors @ut_annotations/test_annotations.pkb @ut_matchers/test_matchers.pkb @ut_output_buffer/test_output_buffer.pkb From 61553577dc08973d620cb949b4cde9b63288651b Mon Sep 17 00:00:00 2001 From: Jacek Date: Sat, 5 Aug 2017 01:28:19 +0100 Subject: [PATCH 14/42] Changed the cli call to use doc reporter only once --- test/install_and_run_tests.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 69e183312..d8d75ad53 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -8,9 +8,8 @@ cd test cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=source -test_path=test \ --f=ut_documentation_reporter -c \ --f=ut_documentation_reporter -o=test_results.log \ +-source_path=source -test_path=test -c \ +-f=ut_documentation_reporter -o=test_results.log -s \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ -f=ut_sonar_test_reporter -o=test_results.xml From d5abea92c3863f58a16463b667ec9ea2e5f58790 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sat, 5 Aug 2017 10:38:23 +0300 Subject: [PATCH 15/42] enabled test --- test/ut_matchers/test_matchers.pks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ut_matchers/test_matchers.pks b/test/ut_matchers/test_matchers.pks index d993938ee..429b39760 100644 --- a/test/ut_matchers/test_matchers.pks +++ b/test/ut_matchers/test_matchers.pks @@ -26,7 +26,7 @@ create or replace package test_matchers is --%test procedure test_be_nonempty_collection; --%test - --%disabled + procedure test_be_empty_others; --%test From 2155b991e58477bc8738c85e292069b4f093d455 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sat, 5 Aug 2017 11:10:23 +0300 Subject: [PATCH 16/42] added ut_suite_manager tests --- test/install_tests.sql | 2 + test/ut_suite_manager/test_suite_manager.pkb | 1225 ++++++++++++++++++ test/ut_suite_manager/test_suite_manager.pks | 137 ++ 3 files changed, 1364 insertions(+) create mode 100644 test/ut_suite_manager/test_suite_manager.pkb create mode 100644 test/ut_suite_manager/test_suite_manager.pks diff --git a/test/install_tests.sql b/test/install_tests.sql index c4dcbce0a..2bb36072a 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -4,12 +4,14 @@ @ut_annotations/test_annotations.pks @ut_matchers/test_matchers.pks @ut_output_buffer/test_output_buffer.pks +@ut_suite_manager/test_suite_manager.pks @core.pkb @ut_utils/test_ut_utils.pkb @ut_annotations/test_annotations.pkb @ut_matchers/test_matchers.pkb @ut_output_buffer/test_output_buffer.pkb +@ut_suite_manager/test_suite_manager.pkb show errors diff --git a/test/ut_suite_manager/test_suite_manager.pkb b/test/ut_suite_manager/test_suite_manager.pkb new file mode 100644 index 000000000..b67b54f09 --- /dev/null +++ b/test/ut_suite_manager/test_suite_manager.pkb @@ -0,0 +1,1225 @@ +create or replace package body test_suite_manager is + + ex_obj_doesnt_exist exception; + pragma exception_init(ex_obj_doesnt_exist, -04043); + + procedure test_schema_run is + c_path constant varchar2(100) := USER; + l_objects_to_run ut_suite_items := ut_suite_items(); + l_all_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + begin + --Act + l_all_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + for i in 1..l_all_objects_to_run.count loop + if l_all_objects_to_run(i).name in ('tests', 'tests2') then + l_objects_to_run.extend; + l_objects_to_run(l_objects_to_run.last) := l_all_objects_to_run(i); + end if; + end loop; + + --Assert + ut.expect(l_objects_to_run.count).to_equal(2); + + for i in 1 .. 2 loop + l_test0_suite := treat(l_objects_to_run(i) as ut_logical_suite); + ut.expect(l_test0_suite.name in ('tests', 'tests2')).to_be_true; + + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + case l_test0_suite.name + when 'tests' then + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(3); + l_test2_suite := treat(l_test1_suite.items(3) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + when 'tests2' then + ut.expect(l_test1_suite.name).to_equal('test_package_3'); + ut.expect(l_test1_suite.items.count).to_equal(3); + end case; + + end loop; + + end; + + procedure test_top2_by_name is + c_path varchar2(100) := USER||'.test_package_2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_top2_bt_name_cur_user is + c_path varchar2(100) := 'test_package_2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_by_path_to_subsuite is + c_path varchar2(100) := USER||':tests.test_package_1.test_package_2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_by_path_to_subsuite_cu is + c_path varchar2(100) := ':tests.test_package_1.test_package_2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_subsute_proc_by_path is + c_path varchar2(100) := USER||':tests.test_package_1.test_package_2.test2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + l_test_proc ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(1); + + l_test_proc := treat(l_test2_suite.items(1) as ut_test); + ut.expect(l_test_proc.name).to_equal('test2'); + ut.expect(l_test_proc.before_test is not null).to_be_true; + ut.expect(l_test_proc.after_test is not null).to_be_true; + + end; + + procedure test_subsute_proc_by_path_cu is + c_path varchar2(100) := ':tests.test_package_1.test_package_2.test2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + l_test_proc ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(1); + + l_test_proc := treat(l_test2_suite.items(1) as ut_test); + ut.expect(l_test_proc.name).to_equal('test2'); + ut.expect(l_test_proc.before_test is not null).to_be_true; + ut.expect(l_test_proc.after_test is not null).to_be_true; + end; + + procedure test_top_pack_by_name is + c_path varchar2(100) := USER||'.test_package_1'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_suite; + l_test2_suite ut_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(3); + + ut.expect(l_test1_suite.items(1).name).to_equal('test1'); + ut.expect(l_test1_suite.items(1).description).to_equal('Test1 from test package 1'); + ut.expect(treat(l_test1_suite.items(1) as ut_test).before_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut_test).after_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(1) as ut_test).DISABLED_FLAG).to_equal(0); + + ut.expect(l_test1_suite.items(2).name).to_equal('test2'); + ut.expect(l_test1_suite.items(2).description).to_equal('Test2 from test package 1'); + ut.expect(treat(l_test1_suite.items(2) as ut_test).before_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut_test).after_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut_test).DISABLED_FLAG).to_equal(0); + + -- temporary behavior. + -- decided that when executed by package, not path, only that package has to execute + l_test2_suite := treat(l_test1_suite.items(3) as ut_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_top_pack_by_name_cu is + c_path varchar2(100) := 'test_package_1'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_suite; + l_test2_suite ut_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(3); + + ut.expect(l_test1_suite.items(1).name).to_equal('test1'); + ut.expect(l_test1_suite.items(1).description).to_equal('Test1 from test package 1'); + ut.expect(treat(l_test1_suite.items(1) as ut_test).before_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut_test).after_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(1) as ut_test).DISABLED_FLAG).to_equal(0); + + ut.expect(l_test1_suite.items(2).name).to_equal('test2'); + ut.expect(l_test1_suite.items(2).description).to_equal('Test2 from test package 1'); + ut.expect(treat(l_test1_suite.items(2) as ut_test).before_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut_test).after_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut_test).DISABLED_FLAG).to_equal(0); + + -- temporary behavior. + -- decided that when executed by package, not path, only that package has to execute + l_test2_suite := treat(l_test1_suite.items(3) as ut_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_top_pack_by_path is + c_path varchar2(100) := USER||':tests'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(3); + l_test2_suite := treat(l_test1_suite.items(3) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_top_pack_by_path_cu is + c_path varchar2(100) := ':tests'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(3); + l_test2_suite := treat(l_test1_suite.items(3) as ut_logical_suite); + + ut.expect(l_test2_suite.name).to_equal('test_package_2'); + ut.expect(l_test2_suite.items.count).to_equal(2); + end; + + procedure test_top_pck_proc_by_path is + c_path varchar2(100) := USER||':tests.test_package_1.test2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + l_test_proc ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test_proc := treat(l_test1_suite.items(1) as ut_test); + + ut.expect(l_test_proc.name).to_equal('test2'); + ut.expect(l_test_proc.description).to_equal('Test2 from test package 1'); + ut.expect(l_test_proc.before_test is not null).to_be_true; + ut.expect(l_test_proc.after_test is not null).to_be_true; + end; + + procedure test_top_pck_proc_by_path_cu is + c_path varchar2(100) := ':tests.test_package_1.test2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test2_suite ut_logical_suite; + l_test_proc ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + l_test_proc := treat(l_test1_suite.items(1) as ut_test); + + ut.expect(l_test_proc.name).to_equal('test2'); + ut.expect(l_test_proc.description).to_equal('Test2 from test package 1'); + ut.expect(l_test_proc.before_test is not null).to_be_true; + ut.expect(l_test_proc.after_test is not null).to_be_true; + end; + + procedure test_top_pkc_proc_by_name is + c_path varchar2(100) := USER||'.test_package_1.test2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test_proc ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + + l_test_proc := treat(l_test1_suite.items(1) as ut_test); + ut.expect(l_test_proc.name).to_equal('test2'); + ut.expect(l_test_proc.before_test is not null).to_be_true; + ut.expect(l_test_proc.after_test is not null).to_be_true; + end; + + procedure test_top_pkc_proc_by_name_cu is + c_path varchar2(100) := 'test_package_1.test2'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test_proc ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_1'); + ut.expect(l_test1_suite.items.count).to_equal(1); + + l_test_proc := treat(l_test1_suite.items(1) as ut_test); + ut.expect(l_test_proc.name).to_equal('test2'); + ut.expect(l_test_proc.before_test is not null).to_be_true; + ut.expect(l_test_proc.after_test is not null).to_be_true; + end; + + procedure test_top_pkc_nosub_by_name is + c_path varchar2(100) := USER||'.test_package_3'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test1 ut_test; + l_test3 ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests2'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_3'); + ut.expect(l_test1_suite.items.count).to_equal(3); + + l_test1 := treat(l_test1_suite.items(1) as ut_test); + ut.expect(l_test1.name).to_equal('test1'); + ut.expect(l_test1.DISABLED_FLAG).to_equal(0); + + l_test3 := treat(l_test1_suite.items(3) as ut_test); + ut.expect(l_test3.name).to_equal('disabled_test'); + ut.expect(l_test3.DISABLED_FLAG).to_equal(1); + end; + + procedure test_top_pkc_nosub_by_name_cu is + c_path varchar2(100) := 'test_package_3'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test1 ut_test; + l_test3 ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests2'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_3'); + ut.expect(l_test1_suite.items.count).to_equal(3); + + l_test1 := treat(l_test1_suite.items(1) as ut_test); + ut.expect(l_test1.name).to_equal('test1'); + ut.expect(l_test1.DISABLED_FLAG).to_equal(0); + + l_test3 := treat(l_test1_suite.items(3) as ut_test); + ut.expect(l_test3.name).to_equal('disabled_test'); + ut.expect(l_test3.DISABLED_FLAG).to_equal(1); + end; + + procedure test_top_subpck_by_path is + c_path varchar2(100) := USER||':tests2.test_package_3'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test1 ut_test; + l_test3 ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests2'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_3'); + ut.expect(l_test1_suite.items.count).to_equal(3); + + l_test1 := treat(l_test1_suite.items(1) as ut_test); + ut.expect(l_test1.name).to_equal('test1'); + ut.expect(l_test1.DISABLED_FLAG).to_equal(0); + + l_test3 := treat(l_test1_suite.items(3) as ut_test); + ut.expect(l_test3.name).to_equal('disabled_test'); + ut.expect(l_test3.DISABLED_FLAG).to_equal(1); + end; + + procedure test_top_subpck_by_path_cu is + c_path varchar2(100) := ':tests2.test_package_3'; + l_objects_to_run ut_suite_items; + + l_test0_suite ut_logical_suite; + l_test1_suite ut_logical_suite; + l_test1 ut_test; + l_test3 ut_test; + begin + --Act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + + ut.expect(l_test0_suite.name).to_equal('tests2'); + ut.expect(l_test0_suite.items.count).to_equal(1); + l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + + ut.expect(l_test1_suite.name).to_equal('test_package_3'); + ut.expect(l_test1_suite.items.count).to_equal(3); + + l_test1 := treat(l_test1_suite.items(1) as ut_test); + ut.expect(l_test1.name).to_equal('test1'); + ut.expect(l_test1.DISABLED_FLAG).to_equal(0); + + l_test3 := treat(l_test1_suite.items(3) as ut_test); + ut.expect(l_test3.name).to_equal('disabled_test'); + ut.expect(l_test3.DISABLED_FLAG).to_equal(1); + end; + + procedure test_search_invalid_pck is + l_objects_to_run ut_suite_items; + begin + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('failing_invalid_spec')); + ut.fail('Invalid package didnt raised exception'); + exception + when others then + ut.expect(sqlerrm).to_be_like('%failing_invalid_spec%'); + end; + + procedure compile_invalid_package is + ex_compilation_error exception; + pragma exception_init(ex_compilation_error,-24344); + pragma autonomous_transaction; + begin + begin + execute immediate q'[create or replace package failing_invalid_spec as + --%suite + gv_glob_val non_existing_table.id%type := 0; + + --%beforeall + procedure before_all; + --%test + procedure test1; + --%test + procedure test2; +end;]'; + exception when ex_compilation_error then null; + end; + begin + execute immediate q'[create or replace package body failing_invalid_spec as + procedure before_all is begin gv_glob_val := 1; end; + procedure test1 is begin ut.expect(1).to_equal(1); end; + procedure test2 is begin ut.expect(1).to_equal(1); end; +end;]'; + exception when ex_compilation_error then null; + end; + end; + procedure drop_invalid_package is + pragma autonomous_transaction; + begin + execute immediate 'drop package failing_invalid_spec'; + end; + + procedure test_desc_with_comma is + l_objects_to_run ut_suite_items; + l_suite ut_suite; + l_test ut_test; + begin + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_to_be_dropped')); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + + l_suite := treat(l_objects_to_run(1) as ut_suite); + + ut.expect(l_suite.name).to_equal('tst_package_to_be_dropped'); + ut.expect(l_suite.description).to_equal('A suite description, though with comma, is assigned by suite_manager'); + ut.expect(l_suite.items.count).to_equal(2); + + l_test := treat(l_suite.items(1) as ut_test); + + ut.expect(l_test.name).to_equal('test1'); + ut.expect(l_test.description).to_equal('A test description, though with comma, is assigned by suite_manager'); + + l_test := treat(l_suite.items(2) as ut_test); + + ut.expect(l_test.name).to_equal('test2'); + ut.expect(l_test.description).to_equal('A test description, though with comma, is assigned by suite_manager'); + + end; + procedure setup_desc_with_comma is + pragma autonomous_transaction; + begin + execute immediate 'create or replace package tst_package_to_be_dropped as + --%suite(A suite description, though with comma, is assigned by suite_manager) + + --%test(A test description, though with comma, is assigned by suite_manager) + procedure test1; + + --%test + --%displayname(A test description, though with comma, is assigned by suite_manager) + procedure test2; +end;'; + + execute immediate 'create or replace package body tst_package_to_be_dropped as + procedure test1 is begin ut.expect(1).to_equal(1); end; + procedure test2 is begin ut.expect(1).to_equal(1); end; +end;'; + end; + procedure clean_desc_with_comma is + pragma autonomous_transaction; + begin + begin + execute immediate 'drop package tst_package_to_be_dropped'; + exception + when ex_obj_doesnt_exist then + null; + end; + end; + + procedure test_inv_cache_on_drop is + l_test_report ut_varchar2_list; + begin + + select * bulk collect into l_test_report from table(ut.run(USER||'.tst_package_to_be_dropped')); + + -- drop package + clean_inv_cache_on_drop; + + begin + select * bulk collect into l_test_report from table(ut.run(user || '.tst_package_to_be_dropped')); + ut.fail('Cache not invalidated on package drop'); + exception + when others then + ut.expect(sqlerrm).to_be_like('%tst_package_to_be_dropped%does not exist%'); + end; + + end; + procedure setup_inv_cache_on_drop is + pragma autonomous_transaction; + begin + execute immediate 'create or replace package tst_package_to_be_dropped as + --%suite + + --%test + procedure test1; +end;'; + + execute immediate 'create or replace package body tst_package_to_be_dropped as + procedure test1 is begin ut.expect(1).to_equal(1); end; + procedure test2 is begin ut.expect(1).to_equal(1); end; +end;'; + end; + + procedure clean_inv_cache_on_drop is + pragma autonomous_transaction; + begin + execute immediate 'drop package tst_package_to_be_dropped'; + exception + when ex_obj_doesnt_exist then + null; + end; + + procedure test_inv_pck_bodies is + l_result integer; + begin + execute immediate 'select * from table(ut.run(''test_dependencies'', utplsql_test_reporter()))' into l_result; + + ut.expect(l_result).to_equal(ut_utils.tr_success); + end; + procedure setup_inv_pck_bodies is + pragma autonomous_transaction; + begin + execute immediate 'create table test_dependency_table (id integer)'; + execute immediate 'create or replace package test_dependencies as + -- %suite + + -- %test + procedure dependant; +end;'; + execute immediate 'create or replace package body test_dependencies as + gc_dependant_variable test_dependency_table.id%type; + procedure dependant is begin null; end; +end;'; + + execute immediate 'alter table test_dependency_table modify id number'; + + execute immediate 'create or replace type utplsql_test_reporter under ut_reporter_base( + constructor function utplsql_test_reporter(self in out nocopy utplsql_test_reporter) return self as result, + overriding member procedure after_calling_run(self in out nocopy utplsql_test_reporter, a_run in ut_run))'; + execute immediate 'create or replace type body utplsql_test_reporter is + constructor function utplsql_test_reporter(self in out nocopy utplsql_test_reporter) return self as result is + begin + self.init($$plsql_unit); + return; + end; + + overriding member procedure after_calling_run(self in out nocopy utplsql_test_reporter, a_run in ut_run) is + begin + self.print_text(a_run.result); + end; +end;'; + + end; + procedure clean_inv_pck_bodies is + pragma autonomous_transaction; + begin + execute immediate 'drop type utplsql_test_reporter'; + execute immediate 'drop table test_dependency_table'; + execute immediate 'drop package test_dependencies'; + end; + + procedure test_pck_with_dollar is + l_objects_to_run ut_suite_items; + l_suite ut_suite; + begin + --act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with$dollar')); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + + l_suite := treat(l_objects_to_run(1) as ut_suite); + ut.expect(l_suite.name).to_equal('tst_package_with$dollar'); + end; + procedure setup_pck_with_dollar is + pragma autonomous_transaction; + begin + execute immediate 'create or replace package tst_package_with$dollar as + --%suite + + --%test + procedure test1; +end;'; + + execute immediate 'create or replace package body tst_package_with$dollar as + procedure test1 is begin ut.expect(1).to_equal(1); end; + procedure test2 is begin ut.expect(1).to_equal(1); end; +end;'; + end; + procedure clean_pck_with_dollar is + pragma autonomous_transaction; + begin + execute immediate 'drop package tst_package_with$dollar'; + end; + + + procedure test_pck_with_hash is + l_objects_to_run ut_suite_items; + l_suite ut_suite; + begin + --act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with#hash')); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + + l_suite := treat(l_objects_to_run(1) as ut_suite); + ut.expect(l_suite.name).to_equal('tst_package_with#hash'); + end; + procedure setup_pck_with_hash is + pragma autonomous_transaction; + begin + execute immediate 'create or replace package tst_package_with#hash as + --%suite + + --%test + procedure test1; +end;'; + + execute immediate 'create or replace package body tst_package_with#hash as + procedure test1 is begin ut.expect(1).to_equal(1); end; + procedure test2 is begin ut.expect(1).to_equal(1); end; +end;'; + end; + procedure clean_pck_with_hash is + pragma autonomous_transaction; + begin + execute immediate 'drop package tst_package_with#hash'; + end; + + + procedure test_test_with_dollar is + l_objects_to_run ut_suite_items; + l_suite ut_suite; + l_test ut_test; + begin + --act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_dollar_test.test$1')); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + + l_suite := treat(l_objects_to_run(1) as ut_suite); + + ut.expect(l_suite.name).to_equal('tst_package_with_dollar_test'); + ut.expect(l_suite.items.count).to_equal(1); + + l_test := treat(l_suite.items(1) as ut_test); + + ut.expect(l_test.name).to_equal('test$1'); + + end; + procedure setup_test_with_dollar is + pragma autonomous_transaction; + begin + execute immediate 'create or replace package tst_package_with_dollar_test as + --%suite + + --%test + procedure test$1; +end;'; + + execute immediate 'create or replace package body tst_package_with_dollar_test as + procedure test$1 is begin ut.expect(1).to_equal(1); end; +end;'; + end; + procedure clean_test_with_dollar is + pragma autonomous_transaction; + begin + execute immediate 'drop package tst_package_with_dollar_test'; + end; + + procedure test_test_with_hash is + l_objects_to_run ut_suite_items; + l_suite ut_suite; + l_test ut_test; + begin + --act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_hash_test.test#1')); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + + l_suite := treat(l_objects_to_run(1) as ut_suite); + + ut.expect(l_suite.name).to_equal('tst_package_with_hash_test'); + ut.expect(l_suite.items.count).to_equal(1); + + l_test := treat(l_suite.items(1) as ut_test); + + ut.expect(l_test.name).to_equal('test#1'); + + end; + procedure setup_test_with_hash is + pragma autonomous_transaction; + begin + execute immediate 'create or replace package tst_package_with_hash_test as + --%suite + + --%test + procedure test#1; +end;'; + + execute immediate 'create or replace package body tst_package_with_hash_test as + procedure test#1 is begin ut.expect(1).to_equal(1); end; +end;'; + end; + procedure clean_test_with_hash is + pragma autonomous_transaction; + begin + execute immediate 'drop package tst_package_with_hash_test'; + end; + + procedure test_empty_suite_path is + l_objects_to_run ut_suite_items; + l_suite ut_suite; + begin + + --act + l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_empty_suite_path')); + + --Assert + ut.expect(l_objects_to_run.count).to_equal(1); + + l_suite := treat(l_objects_to_run(1) as ut_suite); + + ut.expect(l_suite.name).to_equal('tst_empty_suite_path'); + end; + + procedure setup_empty_suite_path is + pragma autonomous_transaction; + begin + execute immediate 'create or replace package tst_empty_suite_path as + --%suite + --%suitepath + + --%test + procedure test1; +end;'; + execute immediate 'create or replace package body tst_empty_suite_path as + procedure test1 is begin ut.expect(1).to_equal(1); end; +end;'; + end; + + procedure clean_empty_suite_path is + pragma autonomous_transaction; + begin + execute immediate 'drop package tst_empty_suite_path'; + end; + + procedure compile_dummy_packages is + pragma autonomous_transaction; + begin + execute immediate q'[create or replace package test_package_1 is + + --%suite + --%displayname(test_package_1) + --%suitepath(tests) + + gv_glob_val number; + + --%beforeeach + procedure global_setup; + + --%aftereach + procedure global_teardown; + + --%test + --%displayname(Test1 from test package 1) + procedure test1; + + --%test(Test2 from test package 1) + --%beforetest(test2_setup) + --%aftertest(test2_teardown) + procedure test2; + + procedure test2_setup; + + procedure test2_teardown; + +end test_package_1;]'; + + execute immediate q'[create or replace package body test_package_1 is + + gv_var_1 number; + + gv_var_1_temp number; + + procedure global_setup is + begin + gv_var_1 := 1; + gv_glob_val := 1; + end; + + procedure global_teardown is + begin + gv_var_1 := 0; + gv_glob_val := 0; + end; + + procedure test1 is + begin + ut.expect(gv_var_1, 'Some expectation').to_equal(1); + end; + + procedure test2 is + begin + ut.expect(gv_var_1, 'Some expectation').to_equal(2); + end; + + procedure test2_setup is + begin + gv_var_1_temp := gv_var_1; + gv_var_1 := 2; + end; + + procedure test2_teardown is + begin + gv_var_1 := gv_var_1_temp; + gv_var_1_temp := null; + end; + +end test_package_1;]'; + + execute immediate q'[create or replace package test_package_2 is + + --%suite + --%suitepath(tests.test_package_1) + + gv_glob_val varchar2(1); + + --%beforeeach + procedure global_setup; + + --%aftereach + procedure global_teardown; + + --%test + procedure test1; + + --%test + --%beforetest(test2_setup) + --%aftertest(test2_teardown) + procedure test2; + + procedure test2_setup; + + procedure test2_teardown; + +end test_package_2;]'; +execute immediate q'[create or replace package body test_package_2 is + + gv_var_1 varchar2(1); + + gv_var_1_temp varchar2(1); + + procedure global_setup is + begin + gv_var_1 := 'a'; + gv_glob_val := 'z'; + end; + + procedure global_teardown is + begin + gv_var_1 := 'n'; + gv_glob_val := 'n'; + end; + + procedure test1 is + begin + ut.expect(gv_var_1).to_equal('a'); + end; + + procedure test2 is + begin + ut.expect(gv_var_1).to_equal('b'); + end; + + procedure test2_setup is + begin + gv_var_1_temp := gv_var_1; + gv_var_1 := 'b'; + end; + + procedure test2_teardown is + begin + gv_var_1 := gv_var_1_temp; + gv_var_1_temp := null; + end; + +end test_package_2;]'; + + execute immediate q'[create or replace package test_package_3 is + + --%suite + --%suitepath(tests2) + --%rollback(auto) + + gv_glob_val number; + + --%beforeeach + procedure global_setup; + + --%aftereach + procedure global_teardown; + + --%test + --%rollback(auto) + procedure test1; + + --%test + --%beforetest(test2_setup) + --%aftertest(test2_teardown) + procedure test2; + + procedure test2_setup; + + procedure test2_teardown; + + --%test + --%disabled + procedure disabled_test; + +end test_package_3;]'; + execute immediate q'[create or replace package body test_package_3 is + + gv_var_1 number; + + gv_var_1_temp number; + + procedure global_setup is + begin + gv_var_1 := 1; + gv_glob_val := 1; + end; + + procedure global_teardown is + begin + gv_var_1 := 0; + gv_glob_val := 0; + end; + + procedure test1 is + begin + ut.expect(gv_var_1).to_equal(1); + end; + + procedure test2 is + begin + ut.expect(gv_var_1).to_equal(2); + end; + + procedure test2_setup is + begin + gv_var_1_temp := gv_var_1; + gv_var_1 := 2; + end; + + procedure test2_teardown is + begin + gv_var_1 := gv_var_1_temp; + gv_var_1_temp := null; + end; + + procedure disabled_test is + begin + null; + end; + +end test_package_3;]'; + end; + + procedure drop_dummy_packages is + pragma autonomous_transaction; + begin + execute immediate 'drop package test_package_1'; + execute immediate 'drop package test_package_2'; + execute immediate 'drop package test_package_3'; + end; + +end test_suite_manager; +/ diff --git a/test/ut_suite_manager/test_suite_manager.pks b/test/ut_suite_manager/test_suite_manager.pks new file mode 100644 index 000000000..b2114c9da --- /dev/null +++ b/test/ut_suite_manager/test_suite_manager.pks @@ -0,0 +1,137 @@ +create or replace package test_suite_manager is + + --%suite(suite_manager) + --%suitepath(ut_plsql.core) + + --%beforeall + procedure compile_dummy_packages; + --%afterall + procedure drop_dummy_packages; + + --%test(Prepare Runner For The Schema) + procedure test_schema_run; + + --%test(Prepare runner for the top 2 package by package user.package_name) + procedure test_top2_by_name; + + --%test(Prepare runner for the top2 package by name cur user) + procedure test_top2_bt_name_cur_user; + + --%test(Prepare runner for the subsuite by path) + procedure test_by_path_to_subsuite; + + --%test(Prepare runner for the subsuite by path for current user) + procedure test_by_path_to_subsuite_cu; + + --%test(Prepare runner for the subsuite proc only by path) + procedure test_subsute_proc_by_path; + + --%test(Prepare runner for the subsuite proc only by path for current user) + procedure test_subsute_proc_by_path_cu; + + --%test(Prepare runner for the top package by package name) + procedure test_top_pack_by_name; + + --%test(Prepare runner for the top package by package name for current user) + procedure test_top_pack_by_name_cu; + + --%test(Prepare runner for the top package by path) + procedure test_top_pack_by_path; + + --%test(Prepare runner for the top package by path for current user) + procedure test_top_pack_by_path_cu; + + --%test(Prepare runner for the top package procedure by path) + procedure test_top_pck_proc_by_path; + + --%test(Prepare runner for the top package procedure by path for current user) + procedure test_top_pck_proc_by_path_cu; + + --%test(Prepare runner for the top package procedure without sub-suites by package name) + procedure test_top_pkc_proc_by_name; + + --%test(Prepare runner for the top package procedure without sub-suites by package name for current user) + procedure test_top_pkc_proc_by_name_cu; + + --%test(Prepare runner for the top package without sub-suites by package name) + procedure test_top_pkc_nosub_by_name; + + --%test(Prepare runner for the top package without sub-suites by package name for current user) + procedure test_top_pkc_nosub_by_name_cu; + + --%test(Prepare runner for the suites package by path) + procedure test_top_subpck_by_path; + + --%test(Prepare runner for the suites package by path for current user) + procedure test_top_subpck_by_path_cu; + + --%test(Prepare runner for invalid package) + --%beforetest(compile_invalid_package) + --%aftertest(drop_invalid_package) + procedure test_search_invalid_pck; + procedure compile_invalid_package; + procedure drop_invalid_package; + + --%test(Test description with comma) + --%beforetest(setup_desc_with_comma) + --%aftertest(clean_desc_with_comma) + procedure test_desc_with_comma; + procedure setup_desc_with_comma; + procedure clean_desc_with_comma; + + --%test(Invalidate cache on package drop) + --%beforetest(setup_inv_cache_on_drop) + --%aftertest(clean_inv_cache_on_drop) + procedure test_inv_cache_on_drop; + procedure setup_inv_cache_on_drop; + procedure clean_inv_cache_on_drop; + + --%test(Includes Invalid Package Bodies In The Run) + --%beforetest(setup_inv_pck_bodies) + --%aftertest(clean_inv_pck_bodies) + procedure test_inv_pck_bodies; + procedure setup_inv_pck_bodies; + procedure clean_inv_pck_bodies; + + --%test(Package With Dollar Sign) + --%beforetest(setup_pck_with_dollar) + --%aftertest(clean_pck_with_dollar) + procedure test_pck_with_dollar; + procedure setup_pck_with_dollar; + procedure clean_pck_with_dollar; + + --%test(Package With Hash Sign) + --%beforetest(setup_pck_with_hash) + --%aftertest(clean_pck_with_hash) + procedure test_pck_with_hash; + procedure setup_pck_with_hash; + procedure clean_pck_with_hash; + + --%test(Package with test with dollar sign) + --%beforetest(setup_test_with_dollar) + --%aftertest(clean_test_with_dollar) + procedure test_test_with_dollar; + procedure setup_test_with_dollar; + procedure clean_test_with_dollar; + + --%test(Package with test with hash sign) + --%beforetest(setup_test_with_hash) + --%aftertest(clean_test_with_hash) + procedure test_test_with_hash; + procedure setup_test_with_hash; + procedure clean_test_with_hash; + + + --%test(Setup suite with empty suitepath) + --%beforetest(setup_empty_suite_path) + --%aftertest(clean_empty_suite_path) + procedure test_empty_suite_path; + procedure setup_empty_suite_path; + procedure clean_empty_suite_path; + + --%test + --%disabled + --procedure IncludesPackagesWithSutePath; + +end test_suite_manager; +/ From 37e5533545619a7ab2577e18eaad8391b78bd61d Mon Sep 17 00:00:00 2001 From: Pazus Date: Sat, 5 Aug 2017 12:12:24 +0300 Subject: [PATCH 17/42] fixed references in test_suite_manager.pkb Added additional grants to UT_TESTER user --- .travis/install.sh | 2 +- test/ut_suite_manager/test_suite_manager.pkb | 465 +++++++++---------- 2 files changed, 227 insertions(+), 240 deletions(-) diff --git a/.travis/install.sh b/.travis/install.sh index 302675c29..8723abc1c 100644 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -30,6 +30,6 @@ set feedback off set feedback on --Needed for testing coverage outside of main UT3 schema. -grant create any procedure, drop any procedure, execute any procedure, execute any type, select any table, delete any table to $UT3_TESTER; +grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, delete any table, create any table, drop any table, alter any table, select any dictionary to $UT3_TESTER; exit SQL diff --git a/test/ut_suite_manager/test_suite_manager.pkb b/test/ut_suite_manager/test_suite_manager.pkb index b67b54f09..f20e0401b 100644 --- a/test/ut_suite_manager/test_suite_manager.pkb +++ b/test/ut_suite_manager/test_suite_manager.pkb @@ -5,15 +5,15 @@ create or replace package body test_suite_manager is procedure test_schema_run is c_path constant varchar2(100) := USER; - l_objects_to_run ut_suite_items := ut_suite_items(); - l_all_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items := ut3.ut_suite_items(); + l_all_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; begin --Act - l_all_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_all_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); for i in 1..l_all_objects_to_run.count loop if l_all_objects_to_run(i).name in ('tests', 'tests2') then @@ -26,16 +26,16 @@ create or replace package body test_suite_manager is ut.expect(l_objects_to_run.count).to_equal(2); for i in 1 .. 2 loop - l_test0_suite := treat(l_objects_to_run(i) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(i) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name in ('tests', 'tests2')).to_be_true; - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); case l_test0_suite.name when 'tests' then ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(3); - l_test2_suite := treat(l_test1_suite.items(3) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(3) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -50,26 +50,26 @@ create or replace package body test_suite_manager is procedure test_top2_by_name is c_path varchar2(100) := USER||'.test_package_2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -77,26 +77,26 @@ create or replace package body test_suite_manager is procedure test_top2_bt_name_cur_user is c_path varchar2(100) := 'test_package_2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -104,26 +104,26 @@ create or replace package body test_suite_manager is procedure test_by_path_to_subsuite is c_path varchar2(100) := USER||':tests.test_package_1.test_package_2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -131,26 +131,26 @@ create or replace package body test_suite_manager is procedure test_by_path_to_subsuite_cu is c_path varchar2(100) := ':tests.test_package_1.test_package_2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -158,32 +158,32 @@ create or replace package body test_suite_manager is procedure test_subsute_proc_by_path is c_path varchar2(100) := USER||':tests.test_package_1.test_package_2.test2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; - l_test_proc ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; + l_test_proc ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(1); - l_test_proc := treat(l_test2_suite.items(1) as ut_test); + l_test_proc := treat(l_test2_suite.items(1) as ut3.ut_test); ut.expect(l_test_proc.name).to_equal('test2'); ut.expect(l_test_proc.before_test is not null).to_be_true; ut.expect(l_test_proc.after_test is not null).to_be_true; @@ -192,32 +192,32 @@ create or replace package body test_suite_manager is procedure test_subsute_proc_by_path_cu is c_path varchar2(100) := ':tests.test_package_1.test_package_2.test2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; - l_test_proc ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; + l_test_proc ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test2_suite := treat(l_test1_suite.items(1) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(1); - l_test_proc := treat(l_test2_suite.items(1) as ut_test); + l_test_proc := treat(l_test2_suite.items(1) as ut3.ut_test); ut.expect(l_test_proc.name).to_equal('test2'); ut.expect(l_test_proc.before_test is not null).to_be_true; ut.expect(l_test_proc.after_test is not null).to_be_true; @@ -225,43 +225,43 @@ create or replace package body test_suite_manager is procedure test_top_pack_by_name is c_path varchar2(100) := USER||'.test_package_1'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_suite; - l_test2_suite ut_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_suite; + l_test2_suite ut3.ut_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(3); ut.expect(l_test1_suite.items(1).name).to_equal('test1'); ut.expect(l_test1_suite.items(1).description).to_equal('Test1 from test package 1'); - ut.expect(treat(l_test1_suite.items(1) as ut_test).before_test.is_defined).to_be_false; - ut.expect(treat(l_test1_suite.items(1) as ut_test).after_test.is_defined).to_be_false; - ut.expect(treat(l_test1_suite.items(1) as ut_test).before_each.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(1) as ut_test).DISABLED_FLAG).to_equal(0); + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).before_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).after_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).DISABLED_FLAG).to_equal(0); ut.expect(l_test1_suite.items(2).name).to_equal('test2'); ut.expect(l_test1_suite.items(2).description).to_equal('Test2 from test package 1'); - ut.expect(treat(l_test1_suite.items(2) as ut_test).before_test.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(2) as ut_test).after_test.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(2) as ut_test).before_each.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(2) as ut_test).DISABLED_FLAG).to_equal(0); + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).before_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).after_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).DISABLED_FLAG).to_equal(0); -- temporary behavior. -- decided that when executed by package, not path, only that package has to execute - l_test2_suite := treat(l_test1_suite.items(3) as ut_suite); + l_test2_suite := treat(l_test1_suite.items(3) as ut3.ut_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -269,43 +269,43 @@ create or replace package body test_suite_manager is procedure test_top_pack_by_name_cu is c_path varchar2(100) := 'test_package_1'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_suite; - l_test2_suite ut_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_suite; + l_test2_suite ut3.ut_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(3); ut.expect(l_test1_suite.items(1).name).to_equal('test1'); ut.expect(l_test1_suite.items(1).description).to_equal('Test1 from test package 1'); - ut.expect(treat(l_test1_suite.items(1) as ut_test).before_test.is_defined).to_be_false; - ut.expect(treat(l_test1_suite.items(1) as ut_test).after_test.is_defined).to_be_false; - ut.expect(treat(l_test1_suite.items(1) as ut_test).before_each.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(1) as ut_test).DISABLED_FLAG).to_equal(0); + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).before_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).after_test.is_defined).to_be_false; + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(1) as ut3.ut_test).DISABLED_FLAG).to_equal(0); ut.expect(l_test1_suite.items(2).name).to_equal('test2'); ut.expect(l_test1_suite.items(2).description).to_equal('Test2 from test package 1'); - ut.expect(treat(l_test1_suite.items(2) as ut_test).before_test.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(2) as ut_test).after_test.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(2) as ut_test).before_each.is_defined).to_be_true; - ut.expect(treat(l_test1_suite.items(2) as ut_test).DISABLED_FLAG).to_equal(0); + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).before_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).after_test.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).before_each.is_defined).to_be_true; + ut.expect(treat(l_test1_suite.items(2) as ut3.ut_test).DISABLED_FLAG).to_equal(0); -- temporary behavior. -- decided that when executed by package, not path, only that package has to execute - l_test2_suite := treat(l_test1_suite.items(3) as ut_suite); + l_test2_suite := treat(l_test1_suite.items(3) as ut3.ut_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -313,26 +313,26 @@ create or replace package body test_suite_manager is procedure test_top_pack_by_path is c_path varchar2(100) := USER||':tests'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(3); - l_test2_suite := treat(l_test1_suite.items(3) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(3) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -340,26 +340,26 @@ create or replace package body test_suite_manager is procedure test_top_pack_by_path_cu is c_path varchar2(100) := ':tests'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(3); - l_test2_suite := treat(l_test1_suite.items(3) as ut_logical_suite); + l_test2_suite := treat(l_test1_suite.items(3) as ut3.ut_logical_suite); ut.expect(l_test2_suite.name).to_equal('test_package_2'); ut.expect(l_test2_suite.items.count).to_equal(2); @@ -367,27 +367,27 @@ create or replace package body test_suite_manager is procedure test_top_pck_proc_by_path is c_path varchar2(100) := USER||':tests.test_package_1.test2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; - l_test_proc ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; + l_test_proc ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test_proc := treat(l_test1_suite.items(1) as ut_test); + l_test_proc := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test_proc.name).to_equal('test2'); ut.expect(l_test_proc.description).to_equal('Test2 from test package 1'); @@ -397,27 +397,27 @@ create or replace package body test_suite_manager is procedure test_top_pck_proc_by_path_cu is c_path varchar2(100) := ':tests.test_package_1.test2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test2_suite ut_logical_suite; - l_test_proc ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test2_suite ut3.ut_logical_suite; + l_test_proc ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test_proc := treat(l_test1_suite.items(1) as ut_test); + l_test_proc := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test_proc.name).to_equal('test2'); ut.expect(l_test_proc.description).to_equal('Test2 from test package 1'); @@ -427,27 +427,27 @@ create or replace package body test_suite_manager is procedure test_top_pkc_proc_by_name is c_path varchar2(100) := USER||'.test_package_1.test2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test_proc ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test_proc ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test_proc := treat(l_test1_suite.items(1) as ut_test); + l_test_proc := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test_proc.name).to_equal('test2'); ut.expect(l_test_proc.before_test is not null).to_be_true; ut.expect(l_test_proc.after_test is not null).to_be_true; @@ -455,27 +455,27 @@ create or replace package body test_suite_manager is procedure test_top_pkc_proc_by_name_cu is c_path varchar2(100) := 'test_package_1.test2'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test_proc ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test_proc ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_1'); ut.expect(l_test1_suite.items.count).to_equal(1); - l_test_proc := treat(l_test1_suite.items(1) as ut_test); + l_test_proc := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test_proc.name).to_equal('test2'); ut.expect(l_test_proc.before_test is not null).to_be_true; ut.expect(l_test_proc.after_test is not null).to_be_true; @@ -483,136 +483,136 @@ create or replace package body test_suite_manager is procedure test_top_pkc_nosub_by_name is c_path varchar2(100) := USER||'.test_package_3'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test1 ut_test; - l_test3 ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test1 ut3.ut_test; + l_test3 ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests2'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_3'); ut.expect(l_test1_suite.items.count).to_equal(3); - l_test1 := treat(l_test1_suite.items(1) as ut_test); + l_test1 := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test1.name).to_equal('test1'); ut.expect(l_test1.DISABLED_FLAG).to_equal(0); - l_test3 := treat(l_test1_suite.items(3) as ut_test); + l_test3 := treat(l_test1_suite.items(3) as ut3.ut_test); ut.expect(l_test3.name).to_equal('disabled_test'); ut.expect(l_test3.DISABLED_FLAG).to_equal(1); end; procedure test_top_pkc_nosub_by_name_cu is c_path varchar2(100) := 'test_package_3'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test1 ut_test; - l_test3 ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test1 ut3.ut_test; + l_test3 ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests2'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_3'); ut.expect(l_test1_suite.items.count).to_equal(3); - l_test1 := treat(l_test1_suite.items(1) as ut_test); + l_test1 := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test1.name).to_equal('test1'); ut.expect(l_test1.DISABLED_FLAG).to_equal(0); - l_test3 := treat(l_test1_suite.items(3) as ut_test); + l_test3 := treat(l_test1_suite.items(3) as ut3.ut_test); ut.expect(l_test3.name).to_equal('disabled_test'); ut.expect(l_test3.DISABLED_FLAG).to_equal(1); end; procedure test_top_subpck_by_path is c_path varchar2(100) := USER||':tests2.test_package_3'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test1 ut_test; - l_test3 ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test1 ut3.ut_test; + l_test3 ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests2'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_3'); ut.expect(l_test1_suite.items.count).to_equal(3); - l_test1 := treat(l_test1_suite.items(1) as ut_test); + l_test1 := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test1.name).to_equal('test1'); ut.expect(l_test1.DISABLED_FLAG).to_equal(0); - l_test3 := treat(l_test1_suite.items(3) as ut_test); + l_test3 := treat(l_test1_suite.items(3) as ut3.ut_test); ut.expect(l_test3.name).to_equal('disabled_test'); ut.expect(l_test3.DISABLED_FLAG).to_equal(1); end; procedure test_top_subpck_by_path_cu is c_path varchar2(100) := ':tests2.test_package_3'; - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; - l_test0_suite ut_logical_suite; - l_test1_suite ut_logical_suite; - l_test1 ut_test; - l_test3 ut_test; + l_test0_suite ut3.ut_logical_suite; + l_test1_suite ut3.ut_logical_suite; + l_test1 ut3.ut_test; + l_test3 ut3.ut_test; begin --Act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list(c_path)); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list(c_path)); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_test0_suite := treat(l_objects_to_run(1) as ut_logical_suite); + l_test0_suite := treat(l_objects_to_run(1) as ut3.ut_logical_suite); ut.expect(l_test0_suite.name).to_equal('tests2'); ut.expect(l_test0_suite.items.count).to_equal(1); - l_test1_suite := treat(l_test0_suite.items(1) as ut_logical_suite); + l_test1_suite := treat(l_test0_suite.items(1) as ut3.ut_logical_suite); ut.expect(l_test1_suite.name).to_equal('test_package_3'); ut.expect(l_test1_suite.items.count).to_equal(3); - l_test1 := treat(l_test1_suite.items(1) as ut_test); + l_test1 := treat(l_test1_suite.items(1) as ut3.ut_test); ut.expect(l_test1.name).to_equal('test1'); ut.expect(l_test1.DISABLED_FLAG).to_equal(0); - l_test3 := treat(l_test1_suite.items(3) as ut_test); + l_test3 := treat(l_test1_suite.items(3) as ut3.ut_test); ut.expect(l_test3.name).to_equal('disabled_test'); ut.expect(l_test3.DISABLED_FLAG).to_equal(1); end; procedure test_search_invalid_pck is - l_objects_to_run ut_suite_items; + l_objects_to_run ut3.ut_suite_items; begin - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('failing_invalid_spec')); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list('failing_invalid_spec')); ut.fail('Invalid package didnt raised exception'); exception when others then @@ -654,27 +654,27 @@ end;]'; end; procedure test_desc_with_comma is - l_objects_to_run ut_suite_items; - l_suite ut_suite; - l_test ut_test; + l_objects_to_run ut3.ut_suite_items; + l_suite ut3.ut_suite; + l_test ut3.ut_test; begin - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_to_be_dropped')); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list('tst_package_to_be_dropped')); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_suite := treat(l_objects_to_run(1) as ut_suite); + l_suite := treat(l_objects_to_run(1) as ut3.ut_suite); ut.expect(l_suite.name).to_equal('tst_package_to_be_dropped'); ut.expect(l_suite.description).to_equal('A suite description, though with comma, is assigned by suite_manager'); ut.expect(l_suite.items.count).to_equal(2); - l_test := treat(l_suite.items(1) as ut_test); + l_test := treat(l_suite.items(1) as ut3.ut_test); ut.expect(l_test.name).to_equal('test1'); ut.expect(l_test.description).to_equal('A test description, though with comma, is assigned by suite_manager'); - l_test := treat(l_suite.items(2) as ut_test); + l_test := treat(l_suite.items(2) as ut3.ut_test); ut.expect(l_test.name).to_equal('test2'); ut.expect(l_test.description).to_equal('A test description, though with comma, is assigned by suite_manager'); @@ -711,16 +711,16 @@ end;'; end; procedure test_inv_cache_on_drop is - l_test_report ut_varchar2_list; + l_test_report ut3.ut_varchar2_list; begin - select * bulk collect into l_test_report from table(ut.run(USER||'.tst_package_to_be_dropped')); + select * bulk collect into l_test_report from table(ut3.ut.run(USER||'.tst_package_to_be_dropped')); -- drop package clean_inv_cache_on_drop; begin - select * bulk collect into l_test_report from table(ut.run(user || '.tst_package_to_be_dropped')); + select * bulk collect into l_test_report from table(ut3.ut.run(user || '.tst_package_to_be_dropped')); ut.fail('Cache not invalidated on package drop'); exception when others then @@ -754,11 +754,15 @@ end;'; end; procedure test_inv_pck_bodies is - l_result integer; + l_test_report ut3.ut_varchar2_list; begin - execute immediate 'select * from table(ut.run(''test_dependencies'', utplsql_test_reporter()))' into l_result; - ut.expect(l_result).to_equal(ut_utils.tr_success); + select * bulk collect into l_test_report from table(ut3.ut.run(USER||'.test_dependencies')); + + ut.expect(l_test_report(l_test_report.count-1)).to_be_like('1 test_, 0 failed, 0 errored, 0 disabled, 0 warning(s)'); + --execute immediate 'select * from table(ut3.ut.run(''UT3.test_dependencies'', ut3.utplsql_test_reporter()))' into l_result; + +-- ut.expect(l_result).to_equal(ut3.ut_utils.tr_success); end; procedure setup_inv_pck_bodies is pragma autonomous_transaction; @@ -776,43 +780,26 @@ end;'; end;'; execute immediate 'alter table test_dependency_table modify id number'; - - execute immediate 'create or replace type utplsql_test_reporter under ut_reporter_base( - constructor function utplsql_test_reporter(self in out nocopy utplsql_test_reporter) return self as result, - overriding member procedure after_calling_run(self in out nocopy utplsql_test_reporter, a_run in ut_run))'; - execute immediate 'create or replace type body utplsql_test_reporter is - constructor function utplsql_test_reporter(self in out nocopy utplsql_test_reporter) return self as result is - begin - self.init($$plsql_unit); - return; - end; - - overriding member procedure after_calling_run(self in out nocopy utplsql_test_reporter, a_run in ut_run) is - begin - self.print_text(a_run.result); - end; -end;'; end; procedure clean_inv_pck_bodies is pragma autonomous_transaction; begin - execute immediate 'drop type utplsql_test_reporter'; execute immediate 'drop table test_dependency_table'; execute immediate 'drop package test_dependencies'; end; procedure test_pck_with_dollar is - l_objects_to_run ut_suite_items; - l_suite ut_suite; + l_objects_to_run ut3.ut_suite_items; + l_suite ut3.ut_suite; begin --act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with$dollar')); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list('tst_package_with$dollar')); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_suite := treat(l_objects_to_run(1) as ut_suite); + l_suite := treat(l_objects_to_run(1) as ut3.ut_suite); ut.expect(l_suite.name).to_equal('tst_package_with$dollar'); end; procedure setup_pck_with_dollar is @@ -838,16 +825,16 @@ end;'; procedure test_pck_with_hash is - l_objects_to_run ut_suite_items; - l_suite ut_suite; + l_objects_to_run ut3.ut_suite_items; + l_suite ut3.ut_suite; begin --act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with#hash')); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list('tst_package_with#hash')); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_suite := treat(l_objects_to_run(1) as ut_suite); + l_suite := treat(l_objects_to_run(1) as ut3.ut_suite); ut.expect(l_suite.name).to_equal('tst_package_with#hash'); end; procedure setup_pck_with_hash is @@ -873,22 +860,22 @@ end;'; procedure test_test_with_dollar is - l_objects_to_run ut_suite_items; - l_suite ut_suite; - l_test ut_test; + l_objects_to_run ut3.ut_suite_items; + l_suite ut3.ut_suite; + l_test ut3.ut_test; begin --act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_dollar_test.test$1')); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list('tst_package_with_dollar_test.test$1')); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_suite := treat(l_objects_to_run(1) as ut_suite); + l_suite := treat(l_objects_to_run(1) as ut3.ut_suite); ut.expect(l_suite.name).to_equal('tst_package_with_dollar_test'); ut.expect(l_suite.items.count).to_equal(1); - l_test := treat(l_suite.items(1) as ut_test); + l_test := treat(l_suite.items(1) as ut3.ut_test); ut.expect(l_test.name).to_equal('test$1'); @@ -914,22 +901,22 @@ end;'; end; procedure test_test_with_hash is - l_objects_to_run ut_suite_items; - l_suite ut_suite; - l_test ut_test; + l_objects_to_run ut3.ut_suite_items; + l_suite ut3.ut_suite; + l_test ut3.ut_test; begin --act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_hash_test.test#1')); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list('tst_package_with_hash_test.test#1')); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_suite := treat(l_objects_to_run(1) as ut_suite); + l_suite := treat(l_objects_to_run(1) as ut3.ut_suite); ut.expect(l_suite.name).to_equal('tst_package_with_hash_test'); ut.expect(l_suite.items.count).to_equal(1); - l_test := treat(l_suite.items(1) as ut_test); + l_test := treat(l_suite.items(1) as ut3.ut_test); ut.expect(l_test.name).to_equal('test#1'); @@ -955,17 +942,17 @@ end;'; end; procedure test_empty_suite_path is - l_objects_to_run ut_suite_items; - l_suite ut_suite; + l_objects_to_run ut3.ut_suite_items; + l_suite ut3.ut_suite; begin --act - l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_empty_suite_path')); + l_objects_to_run := ut3.ut_suite_manager.configure_execution_by_path(ut3.ut_varchar2_list('tst_empty_suite_path')); --Assert ut.expect(l_objects_to_run.count).to_equal(1); - l_suite := treat(l_objects_to_run(1) as ut_suite); + l_suite := treat(l_objects_to_run(1) as ut3.ut_suite); ut.expect(l_suite.name).to_equal('tst_empty_suite_path'); end; From adb932089f66dad561daf0ea15a47a18c87111b2 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sat, 5 Aug 2017 21:56:54 +0300 Subject: [PATCH 18/42] implemented clone of develop branch --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0f00b0b81..e3b80eaf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,12 +60,13 @@ cache: before_install: # download latest utPLSQL release - - curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') + #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') + - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git utPLSQL/utPLSQL/$UTPLSQL_DIR # download utPLSQL-cli develop - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip install: - - unzip utPLSQL.zip + #- unzip utPLSQL.zip - unzip utPLSQL-cli.zip - pip install mkdocs - bash .travis/install_sqlcl.sh From c6d482c875543e34fa8961104b6a7c64291a58fa Mon Sep 17 00:00:00 2001 From: Pazus Date: Sat, 5 Aug 2017 22:06:43 +0300 Subject: [PATCH 19/42] simple structure --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e3b80eaf9..da3149b5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,7 @@ cache: before_install: # download latest utPLSQL release #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git utPLSQL/utPLSQL/$UTPLSQL_DIR + - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR # download utPLSQL-cli develop - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip From e678a4e6806ebe0aa7e353e2bc68ff5ca34f5af7 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sat, 5 Aug 2017 22:37:58 +0300 Subject: [PATCH 20/42] change to coverage be run for the main branch not the testing branch --- test/install_and_run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index d8d75ad53..53e3d8f80 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -8,7 +8,7 @@ cd test cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=source -test_path=test -c \ +-source_path=../source -test_path=test -c \ -f=ut_documentation_reporter -o=test_results.log -s \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ -f=ut_sonar_test_reporter -o=test_results.xml From 4121aaf1c97462bb035c55f827a0490053d7a167 Mon Sep 17 00:00:00 2001 From: Pazus Date: Sun, 6 Aug 2017 08:51:10 +0300 Subject: [PATCH 21/42] changed path to sources --- test/install_and_run_tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 53e3d8f80..6ab45fec1 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -5,10 +5,10 @@ cd test "$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql -cd .. +cd ../.. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=../source -test_path=test -c \ +-source_path=source -test_path=test -c \ -f=ut_documentation_reporter -o=test_results.log -s \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ -f=ut_sonar_test_reporter -o=test_results.xml From 33ddeccd20af7bf9ef9c0eeeb3eeae1ba8046e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 11:13:30 +0100 Subject: [PATCH 22/42] Update install_and_run_tests.sh --- test/install_and_run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 6ab45fec1..d8d75ad53 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -5,7 +5,7 @@ cd test "$SQLCLI" ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@//${CONNECTION_STR} @install_tests.sql -cd ../.. +cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ -source_path=source -test_path=test -c \ From 7ba703e95d63b1e6de1afa953c5caad8e5dc1be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 11:15:15 +0100 Subject: [PATCH 23/42] Update ut_sonar_test_reporter.tpb --- source/reporters/ut_sonar_test_reporter.tpb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/reporters/ut_sonar_test_reporter.tpb b/source/reporters/ut_sonar_test_reporter.tpb index b6010d118..c853515d8 100644 --- a/source/reporters/ut_sonar_test_reporter.tpb +++ b/source/reporters/ut_sonar_test_reporter.tpb @@ -32,7 +32,8 @@ create or replace type body ut_sonar_test_reporter is if a_file_mappings is not null then for i in 1 .. a_file_mappings.count loop if upper(a_file_mappings(i).object_name) = upper(a_suite.object_name) - and upper(a_file_mappings(i).object_owner) = upper(a_suite.object_owner) then + and upper(a_file_mappings(i).object_owner) = upper(a_suite.object_owner) + and a_file_mappings(i).object_type = 'PACKAGE BODY' then l_file_name := a_file_mappings(i).file_name; exit; end if; From ae9fd09ca3d117299579b49a7522672d738b9934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 11:17:34 +0100 Subject: [PATCH 24/42] Update .travis.yml Use most recent build of `utplsql-cli` --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e711ac3a7..068567e92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ before_install: #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR # download utPLSQL-cli develop - - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip + - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201708052039.zip install: #- unzip utPLSQL.zip From 97e408c4dcfe4b1e80ee61da7be5552efa0ac1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 11:19:51 +0100 Subject: [PATCH 25/42] Update install_and_run_tests.sh --- test/install_and_run_tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index d8d75ad53..96994af49 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -8,7 +8,8 @@ cd test cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=source -test_path=test -c \ +-source_path=source -owner="${UT3_OWNER}"\ +-test_path=test -owner="${UT3_TESTER}" -c \ -f=ut_documentation_reporter -o=test_results.log -s \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ -f=ut_sonar_test_reporter -o=test_results.xml From 067595f795820fc25ffaeb122741840e582fd3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 11:28:27 +0100 Subject: [PATCH 26/42] Update .travis.yml Reorganized `.travis.yml` script to limit the size of outputs showing by default in console. --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 068567e92..43ebfb890 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,12 @@ cache: - node_modules before_install: + #The update_project_version is done before deployment to validate that the change of project files does not break installation + - bash .travis/update_project_version.sh + - git config --global user.email "builds@travis-ci.com" + - git config --global user.name "${UTPLSQL_BUILD_USER_NAME}" + - git remote rm origin + - git remote add origin https://${github_api_token}@github.com/${UTPLSQL_REPO} # download latest utPLSQL release #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR @@ -76,18 +82,12 @@ install: - df -h before_script: - #The update_project_version is done before deployment to validate that the change of project files does not break installation - - bash .travis/update_project_version.sh - - git config --global user.email "builds@travis-ci.com" - - git config --global user.name "${UTPLSQL_BUILD_USER_NAME}" - - git remote rm origin - - git remote add origin https://${github_api_token}@github.com/${UTPLSQL_REPO} - -script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/create_additional_grants_for_old_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples.sh; fi + +script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_old_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sonar-scanner; fi From dcce789ed9c450e04d08266f961fe7d0b6213df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 11:51:15 +0100 Subject: [PATCH 27/42] Update .travis.yml Going back to older `utplsql-cli` version. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 43ebfb890..d710936ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ before_install: #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR # download utPLSQL-cli develop - - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201708052039.zip + - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip install: #- unzip utPLSQL.zip From 01691eb25367be37c29d9a8d38455c09e75de01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 12:21:05 +0100 Subject: [PATCH 28/42] Update install_and_run_tests.sh Removing `owner=...` call parameters to see if it has impact on the extensions of test files. --- test/install_and_run_tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 96994af49..503df6f62 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -8,8 +8,8 @@ cd test cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=source -owner="${UT3_OWNER}"\ --test_path=test -owner="${UT3_TESTER}" -c \ +-source_path=source \ +-test_path=test -c \ -f=ut_documentation_reporter -o=test_results.log -s \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ -f=ut_sonar_test_reporter -o=test_results.xml From 94cd8c67b9f51d398c4e7c2dc49b4ddb038b23f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 12:38:43 +0100 Subject: [PATCH 29/42] Switch to new `utplsql-cli` again Switching to new `utplsql-cli` again to validate that the new client is causing issues with missing extensions on files lists that are passed to the framework. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d710936ca..43ebfb890 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ before_install: #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR # download utPLSQL-cli develop - - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip + - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201708052039.zip install: #- unzip utPLSQL.zip From bf0bd31e5d6619d280a5e1d7dd85f8d660382463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20G=C4=99bal?= Date: Sun, 6 Aug 2017 13:01:41 +0100 Subject: [PATCH 30/42] Back to old utlplsq-cli --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 43ebfb890..d710936ca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ before_install: #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR # download utPLSQL-cli develop - - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201708052039.zip + - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip install: #- unzip utPLSQL.zip From d48645674f1c76d606aefa477704f83ebee281c2 Mon Sep 17 00:00:00 2001 From: Vinicius Avellar Date: Sun, 6 Aug 2017 23:51:49 -0300 Subject: [PATCH 31/42] Testing fix on utPLSQL-cli Fix file permissions --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d710936ca..5329796ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,11 +69,11 @@ before_install: #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR # download utPLSQL-cli develop - - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-201706191645.zip + - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-test1.zip install: #- unzip utPLSQL.zip - - unzip utPLSQL-cli.zip + - unzip utPLSQL-cli.zip && chmod -R u+x utPLSQL-cli - pip install mkdocs - bash .travis/install_sqlcl.sh - sudo mkdir -p /dev/pdbs From c0b1a5f5335decae23bccd74e7eb00b7e603d37c Mon Sep 17 00:00:00 2001 From: Vinicius Avellar Date: Mon, 7 Aug 2017 09:53:47 -0300 Subject: [PATCH 32/42] Testing new client build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5329796ad..e5d70ab41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ before_install: #- curl -LOk $(curl --silent https://api.github.com/repos/utPLSQL/utPLSQL/releases/latest | awk '/browser_download_url/ { print $2 }' | grep ".zip" | sed 's/"//g') - git clone --depth=1 --branch=develop https://github.com/utPLSQL/utPLSQL.git $UTPLSQL_DIR # download utPLSQL-cli develop - - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-test1.zip + - curl -Lk -o utPLSQL-cli.zip https://bintray.com/viniciusam/utPLSQL-cli/download_file?file_path=utPLSQL-cli-develop-test3.zip install: #- unzip utPLSQL.zip From 8e1ab7c2c1fd3b0eb31b04b9389d6288f0c979c7 Mon Sep 17 00:00:00 2001 From: Vinicius Avellar Date: Mon, 7 Aug 2017 12:12:39 -0300 Subject: [PATCH 33/42] Added source schema parameter --- test/install_and_run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 503df6f62..7fdcaef51 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -8,7 +8,7 @@ cd test cd .. utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_STR} \ --source_path=source \ +-source_path=source -owner=ut3 \ -test_path=test -c \ -f=ut_documentation_reporter -o=test_results.log -s \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ From c2af62a5f1c80411d9a73ebfba4944dc7959d106 Mon Sep 17 00:00:00 2001 From: Jacek Date: Mon, 7 Aug 2017 23:07:13 +0100 Subject: [PATCH 34/42] Adding coveralls reporter to check how coveralls handles multiple coverage reports with different lines reported differently. --- test/install_and_run_tests.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/install_and_run_tests.sh b/test/install_and_run_tests.sh index 7fdcaef51..1685a7ba6 100644 --- a/test/install_and_run_tests.sh +++ b/test/install_and_run_tests.sh @@ -12,12 +12,13 @@ utPLSQL-cli/bin/utplsql run ${UT3_TESTER}/${UT3_TESTER_PASSWORD}@${CONNECTION_ST -test_path=test -c \ -f=ut_documentation_reporter -o=test_results.log -s \ -f=ut_coverage_sonar_reporter -o=coverage.xml \ +-f=ut_coveralls_reporter -o=coverage.json \ -f=ut_sonar_test_reporter -o=test_results.xml status_line_regex="^[0-9]+ tests, ([0-9]+) failed, ([0-9]+) errored.*" -cat coverage.xml -cat test_results.xml +#cat coverage.xml +#cat test_results.xml RC=$(cat test_results.log | grep -E "${status_line_regex}" | sed -re "s/${status_line_regex}/\1\2/") From 7cf00f04d12b091299fc31369db21c48080582b3 Mon Sep 17 00:00:00 2001 From: Jacek Date: Wed, 9 Aug 2017 23:50:50 +0100 Subject: [PATCH 35/42] Renamed `tests` directory to `old_tests`. Moved `old_tests` to the `before_script` phase. --- .travis.yml | 2 +- .travis/coveralls_uploader.js | 8 ++++---- .travis/run_old_tests.sh | 3 ++- {tests => old_tests}/RunAll.cmd | 0 {tests => old_tests}/RunAll.sql | 0 {tests => old_tests}/helpers/check_annotation_parsing.prc | 0 {tests => old_tests}/helpers/department.tps | 0 {tests => old_tests}/helpers/department1.tps | 0 {tests => old_tests}/helpers/html_coverage_test.pck | 0 {tests => old_tests}/helpers/test_package_1.pck | 0 {tests => old_tests}/helpers/test_package_2.pck | 0 {tests => old_tests}/helpers/test_package_3.pck | 0 {tests => old_tests}/helpers/test_reporters.pkb | 0 {tests => old_tests}/helpers/test_reporters.pks | 0 {tests => old_tests}/helpers/test_reporters_1.pkb | 0 {tests => old_tests}/helpers/test_reporters_1.pks | 0 {tests => old_tests}/helpers/ut_example_tests.pkb | 0 {tests => old_tests}/helpers/ut_example_tests.pks | 0 {tests => old_tests}/helpers/ut_transaction_control.pck | 0 {tests => old_tests}/helpers/utplsql_test_reporter.typ | 0 {tests => old_tests}/lib/RunSummary.sql | 0 {tests => old_tests}/lib/RunTest.sql | 0 {tests => old_tests}/lib/RunVars.sql | 0 {tests => old_tests}/lib/mystats/README.md | 0 {tests => old_tests}/lib/mystats/mystats.sql | 0 {tests => old_tests}/lib/mystats/mystats_pkg.sql | 0 {tests => old_tests}/readme.md | 0 .../ut/ut.run.AcceptsCoverageFileList.sql | 0 .../ut/ut.run.AcceptsCoverageFileListWithSutePaths.sql | 0 {tests => old_tests}/ut/ut.run.AcceptsSutePaths.sql | 0 .../ut/ut.run.FailsToExecuteAnInvalidPackageBody.sql | 0 ...nReporter.ExectutesAllInCurrentSchemaUsingReporter.sql | 0 .../ut.run.WithNoParams.ExecutesAllFromCurrentSchema.sql | 0 ...ut.run.WithPackageName.ExecutesAllFromGivenPackage.sql | 0 ...un.WithPackageName.ExecutesAllFromGivenPackageOnly.sql | 0 .../ut.run.WithSchemaName.ExecutesAllFromGivenSchema.sql | 0 .../ut/ut.run.WithSuitePath.ExecutesAllFromGivenPath.sql | 0 .../ut/ut.run.function.AcceptsCoverageFileList.sql | 0 ....run.function.AcceptsCoverageFileListWithSutePaths.sql | 0 .../ut/ut.run.function.AcceptsSutePaths.sql | 0 ...nReporter.ExectutesAllInCurrentSchemaUsingReporter.sql | 0 ...function.WithNoParams.ExecutesAllFromCurrentSchema.sql | 0 ...nction.WithPackageName.ExecutesAllFromGivenPackage.sql | 0 ...on.WithPackageName.ExecutesAllFromGivenPackageOnly.sql | 0 ...function.WithSchemaName.ExecutesAllFromGivenSchema.sql | 0 ...un.function.WithSuitePath.ExecutesAllFromGivenPath.sql | 0 {tests => old_tests}/ut/ut.version.sql | 0 ...tions.IgnoreWrappedPackageAndDoesNotRaiseException.sql | 0 ...tions.ParseAnnotationMixedWithWrongBeforeProcedure.sql | 0 ...kage_annotations.ParseAnnotationNotBeforeProcedure.sql | 0 ...kage_annotations.ParseAnnotationParamsWithBrackets.sql | 0 ...kage_annotations.ParseAnnotationWithWindowsNewline.sql | 0 ...ions.parse_package_annotations.ParseComplexPackage.sql | 0 ...notations.ParsePackageAndProcedureLevelAnnotations.sql | 0 ...se_package_annotations.ParsePackageLevelAnnotation.sql | 0 ...nnotations.ParsePackageLevelAnnotationAccessibleBy.sql | 0 ...ations.ParsePackageLevelAnnotationMultilineDeclare.sql | 0 ...nnotations.ParsePackageLevelAnnotationWithKeyValue.sql | 0 ...ns.ParsePackageLevelAnnotationWithMultilineComment.sql | 0 ...se_package_annotations.spaceBeforeAnnotationParams.sql | 0 .../who_called_expectation.parseStackTrace.sql | 0 .../who_called_expectation.parseStackTraceWith0x.sql | 0 .../common/ut.expect.not_to_equal.scalar.common.sql | 0 .../ut.expect.to_equal.different_scalars.common.sql | 0 .../common/ut.expect.to_equal.scalar.common.sql | 0 .../ut.expect.to_equal.scalar.null_value_text.common.sql | 0 .../ut.expect.to_equal.scalar.with_message.common.sql | 0 .../ut.expect.to_equal.scalar.with_nulls_equal.common.sql | 0 .../common/ut.expect.unuary_comparator.scalar.common.sql | 0 .../ut_expectations/ut.expect.not_to_be_null.sql | 0 ...ect.not_to_equal.GivesFailureForDifferentDataTypes.sql | 0 .../ut.expect.not_to_equal.GivesFailureForEqualValues.sql | 0 ...expect.not_to_equal.GivesSuccessForDifferentValues.sql | 0 ....to_be_false.GivesFailureWhenExpessionIsNotBoolean.sql | 0 ...expect.to_be_false.GivesFailureWhenExpessionIsNull.sql | 0 ...expect.to_be_false.GivesFailureWhenExpessionIsTrue.sql | 0 ...xpect.to_be_false.GivesSuccessWhenExpessionIsFalse.sql | 0 .../ut.expect.to_be_like.FailsForUnsupportedDatatype.sql | 0 ...expect.to_be_not_null.GivesFailureWhenActualIsNull.sql | 0 ...ect.to_be_not_null.GivesSuccessWhenActualIsNotNull.sql | 0 ...t.to_be_null.anydata.GivesSuccessWhenAnydataIsNull.sql | 0 ...ull.anydata.GivesSuccessWhenCollectionPassedIsNull.sql | 0 ...be_null.anydata.GivesSuccessWhenObjectPassedIsNull.sql | 0 ....to_be_null.refcursor.GivesSuccessWhenCursorIsNull.sql | 0 .../ut_expectations/ut.expect.to_be_null.sql | 0 ...expect.to_be_true.GivesFailureWhenExpessionIsFalse.sql | 0 ...t.to_be_true.GivesFailureWhenExpessionIsNotBoolean.sql | 0 ....expect.to_be_true.GivesFailureWhenExpessionIsNull.sql | 0 ....expect.to_be_true.GivesSuccessWhenExpessionIsTrue.sql | 0 ....expect.to_equal.GivesFailureForDifferentDataTypes.sql | 0 .../ut.expect.to_equal.GivesFailureForDifferentValues.sql | 0 .../ut.expect.to_equal.GivesFailureWhenActualIsNull.sql | 0 ...henBothValuesAreNullAndArgumentAreNullEqualIsFalse.sql | 0 ...thValuesAreNullAndConfigurationAreNullEqualIsFalse.sql | 0 .../ut.expect.to_equal.GivesFailureWhenExpectedIsNull.sql | 0 .../ut.expect.to_equal.GivesSuccessForEqualValues.sql | 0 ....expect.to_equal.GivesSuccessWhenBothValuesAreNull.sql | 0 ...WhenBothValuesAreNullAndArgumentAreNullEqualIsTrue.sql | 0 ...t.to_equal.PutsNullIntoStringValueWhenActualIsNull.sql | 0 ...to_equal.PutsNullIntoStringValueWhenExpectedIsNull.sql | 0 ...ual.anydata.ExcludeColumnsXPathFailsOnInvalidXPath.sql | 0 ...GivesFailureWhenBothObjectsAreNullButDifferentType.sql | 0 ...ual.anydata.GivesFailureWhenComparingDifferentData.sql | 0 ....anydata.GivesFailureWhenComparingDifferentObjects.sql | 0 ...nydata.GivesFailureWhenComparingObejctToCollection.sql | 0 ...o_equal.anydata.GivesFailureWhenOneOfObjectsIsNull.sql | 0 ...o_equal.anydata.GivesSuccessWhenBothAnydataAreNull.sql | 0 ...o_equal.anydata.GivesSuccessWhenBothObjectsAreNull.sql | 0 ...nydata.GivesSuccessWhenComparingTheSameCollections.sql | 0 ...equal.anydata.GivesSuccessWhenComparingTheSameData.sql | 0 ...ydata.GivesSuccessWithExcludedCollectionAttributes.sql | 0 ....GivesSuccessWithExcludedCollectionAttributesXPath.sql | 0 ...l.anydata.GivesSuccessWithExcludedObjectAttributes.sql | 0 ...data.GivesSuccessWithExcludedObjectAttributesXPath.sql | 0 ...pect.to_equal.anydata.PutsObjectStrucureIntoResult.sql | 0 ...o_equal.cursor.ComparesDateAndTimeWhenSetNlsIsUsed.sql | 0 ..._equal.cursor.ExcludeColumnNameListIsCaseSensitive.sql | 0 ...to_equal.cursor.ExcludeColumnNamesAreCaseSensitive.sql | 0 ...qual.cursor.ExcludeColumnsXPathFailsOnInvalidXPath.sql | 0 ...to_equal.cursor.ExcludeColumnsXPathIsCaseSensitive.sql | 0 ...ect.to_equal.cursor.GivesFailureForDifferentValues.sql | 0 ....expect.to_equal.cursor.GivesSuccessForEqualValues.sql | 0 ...r.GivesSuccessForEqualValuesWithExcludedColumnList.sql | 0 ...rsor.GivesSuccessForEqualValuesWithExcludedColumns.sql | 0 ...ReportsTheExceptionWhenAnExceptionInCursorIsCaught.sql | 0 ...expect.to_equal.cursor.ReturnsCursorDataForFailure.sql | 0 ...xpect.to_equal.cursor.SupportsSQLandPLSQLdatatypes.sql | 0 ...al.cursor.UsesDefaultNLSSettingsForDatesFormatting.sql | 0 ...t.to_equal.with_text.GivesTheProvidedTextAsMessage.sql | 0 .../ut.expect.to_match.FailsForUnsupportedDatatype.sql | 0 ...object.compare.Gives0WhenComparingIdenticalObjects.sql | 0 ..._are_equal.raisesExceptionWhenTryingToSetNullValue.sql | 0 .../ut_expectation_processor.stackOnFailedTest.sql | 0 .../ut_expectation_processor.stackOnUtFail.sql | 0 {tests => old_tests}/ut_matchers/be_between.sql | 0 {tests => old_tests}/ut_matchers/be_empty.sql | 0 {tests => old_tests}/ut_matchers/be_like.sql | 0 .../ut_matchers/common/ut.expect.common.be_between.sql | 0 .../common/ut.expect.common.be_greater_or_equal.sql | 0 .../common/ut.expect.common.be_greater_than.sql | 0 .../common/ut.expect.common.be_less_or_equal.sql | 0 .../ut_matchers/common/ut.expect.common.be_less_than.sql | 0 .../common/ut.expect.common.collection.be_empty.sql | 0 .../common/ut.expect.common.collection.not_be_empty.sql | 0 .../common/ut.expect.common.other.be_empty.sql | 0 .../common/ut.expect.common.other.not_be_empty.sql | 0 .../common/ut.expect.common.refcursor.be_empty.sql | 0 .../common/ut.expect.common.refcursor.not_to_be_empty.sql | 0 .../ut_matchers/common/ut.expect.to_be_like.common.sql | 0 .../ut_matchers/common/ut.expect.to_match.common.sql | 0 {tests => old_tests}/ut_matchers/greater_or_equal.sql | 0 {tests => old_tests}/ut_matchers/greater_than.sql | 0 {tests => old_tests}/ut_matchers/less_or_equal.sql | 0 {tests => old_tests}/ut_matchers/less_than.sql | 0 {tests => old_tests}/ut_matchers/match.sql | 0 {tests => old_tests}/ut_matchers/timestamp_between.sql | 0 .../ut_matchers/timestamp_ltz_between.sql | 0 .../ut_matchers/timestamp_ltz_not_between.sql | 0 .../ut_matchers/timestamp_not_between.sql | 0 {tests => old_tests}/ut_matchers/timestamp_tz_between.sql | 0 .../ut_matchers/timestamp_tz_not_between.sql | 0 .../ut_metadata.form_name.TrimStandaloneProgramName.sql | 0 .../get_lines.RecievesALineFromBufferTableAndDeletes.sql | 0 .../get_lines.WaitsForTheDataToAppearForSpecifiedTime.sql | 0 .../send_line.DoesNotSendLineIfNullReporterIdGiven.sql | 0 .../send_line.DoesNotSendLineIfNullTextGiven.sql | 0 .../send_line.SendsALineIntoBufferTable.sql | 0 .../ut_coverage_sonar_reporter.AcceptsFileMapping.sql | 0 ..._coverage_sonar_reporter.BuildsSonarCoverageReport.sql | 0 ...ntation_reporter.providesCorrectLineFromStacktrace.sql | 0 .../ut_documentation_reporter.reportMultipleWarnings.sql | 0 .../ut_documentation_reporter.reportTestTiming.sql | 0 .../ut_html_reporter.DefaultSchemaCoverage.sql | 0 .../ut_html_reporter.UserOverrideSchemaCoverage.sql | 0 .../ut_sonar_test_reporter.AcceptsFileMapping.sql | 0 .../ut_sonar_test_reporter.ProducesExpectedOutputs.sql | 0 .../ut_teamcity_reporter.ProducesExpectedOutputs.sql | 0 .../ut_xunit_reporter.ProducesExpectedOutputs.sql | 0 .../ut_xunit_reporter.ReportOnSuiteWithoutDesc.sql | 0 .../ut_xunit_reporter.ReportOnTestWithoutDesc.sql | 0 .../ut_suite_manager.AllowsDescriptionsWithComma.sql | 0 .../ut_suite_manager.CacheInvalidaesOnPackageDrop.sql | 0 ...manager.DoesntFindTheSuiteWhenPackageSpecIsInvalid.sql | 0 ...suite_manager.IncludesInvalidPackageBodiesInTheRun.sql | 0 .../ut_suite_manager.PackageWithDollarSign.sql | 0 .../ut_suite_manager/ut_suite_manager.PackageWithHash.sql | 0 .../ut_suite_manager.TestWithDollarSign.sql | 0 .../ut_suite_manager.TestWithHashSign.sql | 0 ...figure_execution_by_path.PrepareRunnerForTheSchema.sql | 0 ...ution_by_path.PrepareRunnerForTheTop2PackageByName.sql | 0 ...y_path.PrepareRunnerForTheTop2PackageByNameCurUser.sql | 0 ...ution_by_path.PrepareRunnerForTheTop2PackageByPath.sql | 0 ...y_path.PrepareRunnerForTheTop2PackageByPathCurUser.sql | 0 ...path.PrepareRunnerForTheTop2PackageProcedureByPath.sql | 0 ...epareRunnerForTheTop2PackageProcedureByPathCurUser.sql | 0 ...cution_by_path.PrepareRunnerForTheTopPackageByName.sql | 0 ...by_path.PrepareRunnerForTheTopPackageByNameCurUser.sql | 0 ...cution_by_path.PrepareRunnerForTheTopPackageByPath.sql | 0 ...by_path.PrepareRunnerForTheTopPackageByPathCurUser.sql | 0 ..._path.PrepareRunnerForTheTopPackageProcedureByPath.sql | 0 ...repareRunnerForTheTopPackageProcedureByPathCurUser.sql | 0 ...nerForTheTopPackageProcedureWithoutSubsuitesByName.sql | 0 ...heTopPackageProcedureWithoutSubsuitesByNameCurUser.sql | 0 ...repareRunnerForTheTopPackageWithoutSubsuitesByName.sql | 0 ...unnerForTheTopPackageWithoutSubsuitesByNameCurUser.sql | 0 ...repareRunnerForTheTopPackageWithoutSubsuitesByPath.sql | 0 ...unnerForTheTopPackageWithoutSubsuitesByPathCurUser.sql | 0 .../ut_suite_manager/ut_suite_manager.emptySuitePath.sql | 0 ...et_schema_ut_packages.IncludesPackagesWithSutePath.sql | 0 .../ut_test/ut_test.AfterEachExecuted.sql | 0 .../ut_test/ut_test.AfterEachProcedureNameInvalid.sql | 0 .../ut_test/ut_test.AfterEachProcedureNameNull.sql | 0 .../ut_test/ut_test.ApplicationInfoOnExecution.sql | 0 .../ut_test/ut_test.BeforeEachExecuted.sql | 0 .../ut_test/ut_test.BeforeEachProcedureNameInvalid.sql | 0 .../ut_test/ut_test.BeforeEachProcedureNameNull.sql | 0 .../ut_test/ut_test.DisabledFlagSkipTest.sql | 0 .../ut_test.IgnoreTollbackToSavepointException.sql | 0 {tests => old_tests}/ut_test/ut_test.OwnerNameInvalid.sql | 0 {tests => old_tests}/ut_test/ut_test.OwnerNameNull.sql | 0 .../ut_test/ut_test.PackageInInvalidState.sql | 0 .../ut_test/ut_test.PackageNameInvalid.sql | 0 {tests => old_tests}/ut_test/ut_test.PackageNameNull.sql | 0 .../ut_test/ut_test.ProcedureNameInvalid.sql | 0 .../ut_test/ut_test.ProcedureNameNull.sql | 0 .../ut_test/ut_test.ReportWarningOnRollbackFailed.sql | 0 .../ut_test/ut_test.Rollback_type.Auto.sql | 0 .../ut_test/ut_test.Rollback_type.AutoOnFailure.sql | 0 .../ut_test/ut_test.Rollback_type.Manual.sql | 0 .../ut_test/ut_test.Rollback_type.ManualOnFailure.sql | 0 .../ut_test/ut_test.SetupExecutedBeforeTest.sql | 0 .../ut_test/ut_test.SetupProcedureNameInvalid.sql | 0 .../ut_test/ut_test.SetupProcedureNameNull.sql | 0 .../ut_test/ut_test.TeardownExecutedAfterTest.sql | 0 .../ut_test/ut_test.TeardownProcedureNameInvalid.sql | 0 .../ut_test/ut_test.TeardownProcedureNameNull.sql | 0 .../ut_test/ut_test.TestOutputGathering.sql | 0 .../ut_test/ut_test.TestOutputGatheringWhenEmpty.sql | 0 .../ut_test_suite/ut_test_suite.DisabledFlagSkipSuite.sql | 0 .../ut_test_suite.ErrorsATestWhenAfterTestFails.sql | 0 .../ut_test_suite.ErrorsATestWhenBeforeTestFails.sql | 0 .../ut_test_suite.ErrorsEachTestWhenBeforeAllFails.sql | 0 .../ut_test_suite.ErrorsEachTestWhenBeforeEachFails.sql | 0 ...test_suite.ErrorsEachTestWhenPackageHasInvalidBody.sql | 0 .../ut_test_suite.ErrorsEachTestWhenPackageHasNoBody.sql | 0 ...t_test_suite.ReportsWarningsATestWhenAfterAllFails.sql | 0 ..._test_suite.ReportsWarningsATestWhenAfterEachFails.sql | 0 .../ut_test_suite/ut_test_suite.Rollback_type.Auto.sql | 0 .../ut_test_suite.Rollback_type.AutoOnFailure.sql | 0 .../ut_test_suite/ut_test_suite.Rollback_type.Manual.sql | 0 .../ut_test_suite.Rollback_type.ManualOnFailure.sql | 0 .../ut_utils/common/ut_utils.clob_to_table.sql | 0 .../ut_utils/common/ut_utils.table_to_clob.sql | 0 .../ut_utils.append_to_clob.worksWithMultiByteChars.sql | 0 {tests => old_tests}/ut_utils/ut_utils.clob_to_table.sql | 0 .../ut_utils/ut_utils.clob_to_table_multibyte.sql | 0 {tests => old_tests}/ut_utils/ut_utils.table_to_clob.sql | 0 ...ut_utils.test_result_to_char.RunsWithInvalidValues.sql | 0 .../ut_utils.test_result_to_char.RunsWithNullValue.sql | 0 .../ut_utils/ut_utils.test_result_to_char.Success.sql | 0 {tests => old_tests}/ut_utils/ut_utils.to_string.Blob.sql | 0 {tests => old_tests}/ut_utils/ut_utils.to_string.Clob.sql | 0 {tests => old_tests}/ut_utils/ut_utils.to_string.Date.sql | 0 .../ut_utils/ut_utils.to_string.NullBlob.sql | 0 .../ut_utils/ut_utils.to_string.NullClob.sql | 0 .../ut_utils/ut_utils.to_string.NullDate.sql | 0 .../ut_utils/ut_utils.to_string.NullNumber.sql | 0 .../ut_utils/ut_utils.to_string.NullTimestamp.sql | 0 .../ut_utils/ut_utils.to_string.NullVarchar2.sql | 0 .../ut_utils/ut_utils.to_string.Timestamp.sql | 0 .../ut_utils.to_string.TimestampWithLocalTimeZone.sql | 0 .../ut_utils/ut_utils.to_string.TimestampWithTimeZone.sql | 0 .../ut_utils/ut_utils.to_string.Varchar2.sql | 0 .../ut_utils/ut_utils.to_string.veryBigBlob.sql | 0 .../ut_utils/ut_utils.to_string.veryBigClob.sql | 0 .../ut_utils/ut_utils.to_string.veryBigNumber.sql | 0 .../ut_utils/ut_utils.to_string.veryBigVarchar2.sql | 0 .../ut_utils/ut_utils.to_string.verySmallNumber.sql | 0 sonar-project.properties | 2 +- 279 files changed, 8 insertions(+), 7 deletions(-) rename {tests => old_tests}/RunAll.cmd (100%) rename {tests => old_tests}/RunAll.sql (100%) rename {tests => old_tests}/helpers/check_annotation_parsing.prc (100%) rename {tests => old_tests}/helpers/department.tps (100%) rename {tests => old_tests}/helpers/department1.tps (100%) rename {tests => old_tests}/helpers/html_coverage_test.pck (100%) rename {tests => old_tests}/helpers/test_package_1.pck (100%) rename {tests => old_tests}/helpers/test_package_2.pck (100%) rename {tests => old_tests}/helpers/test_package_3.pck (100%) rename {tests => old_tests}/helpers/test_reporters.pkb (100%) rename {tests => old_tests}/helpers/test_reporters.pks (100%) rename {tests => old_tests}/helpers/test_reporters_1.pkb (100%) rename {tests => old_tests}/helpers/test_reporters_1.pks (100%) rename {tests => old_tests}/helpers/ut_example_tests.pkb (100%) rename {tests => old_tests}/helpers/ut_example_tests.pks (100%) rename {tests => old_tests}/helpers/ut_transaction_control.pck (100%) rename {tests => old_tests}/helpers/utplsql_test_reporter.typ (100%) rename {tests => old_tests}/lib/RunSummary.sql (100%) rename {tests => old_tests}/lib/RunTest.sql (100%) rename {tests => old_tests}/lib/RunVars.sql (100%) rename {tests => old_tests}/lib/mystats/README.md (100%) rename {tests => old_tests}/lib/mystats/mystats.sql (100%) rename {tests => old_tests}/lib/mystats/mystats_pkg.sql (100%) rename {tests => old_tests}/readme.md (100%) rename {tests => old_tests}/ut/ut.run.AcceptsCoverageFileList.sql (100%) rename {tests => old_tests}/ut/ut.run.AcceptsCoverageFileListWithSutePaths.sql (100%) rename {tests => old_tests}/ut/ut.run.AcceptsSutePaths.sql (100%) rename {tests => old_tests}/ut/ut.run.FailsToExecuteAnInvalidPackageBody.sql (100%) rename {tests => old_tests}/ut/ut.run.WithGivenReporter.ExectutesAllInCurrentSchemaUsingReporter.sql (100%) rename {tests => old_tests}/ut/ut.run.WithNoParams.ExecutesAllFromCurrentSchema.sql (100%) rename {tests => old_tests}/ut/ut.run.WithPackageName.ExecutesAllFromGivenPackage.sql (100%) rename {tests => old_tests}/ut/ut.run.WithPackageName.ExecutesAllFromGivenPackageOnly.sql (100%) rename {tests => old_tests}/ut/ut.run.WithSchemaName.ExecutesAllFromGivenSchema.sql (100%) rename {tests => old_tests}/ut/ut.run.WithSuitePath.ExecutesAllFromGivenPath.sql (100%) rename {tests => old_tests}/ut/ut.run.function.AcceptsCoverageFileList.sql (100%) rename {tests => old_tests}/ut/ut.run.function.AcceptsCoverageFileListWithSutePaths.sql (100%) rename {tests => old_tests}/ut/ut.run.function.AcceptsSutePaths.sql (100%) rename {tests => old_tests}/ut/ut.run.function.WithGivenReporter.ExectutesAllInCurrentSchemaUsingReporter.sql (100%) rename {tests => old_tests}/ut/ut.run.function.WithNoParams.ExecutesAllFromCurrentSchema.sql (100%) rename {tests => old_tests}/ut/ut.run.function.WithPackageName.ExecutesAllFromGivenPackage.sql (100%) rename {tests => old_tests}/ut/ut.run.function.WithPackageName.ExecutesAllFromGivenPackageOnly.sql (100%) rename {tests => old_tests}/ut/ut.run.function.WithSchemaName.ExecutesAllFromGivenSchema.sql (100%) rename {tests => old_tests}/ut/ut.run.function.WithSuitePath.ExecutesAllFromGivenPath.sql (100%) rename {tests => old_tests}/ut/ut.version.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.IgnoreWrappedPackageAndDoesNotRaiseException.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationMixedWithWrongBeforeProcedure.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationNotBeforeProcedure.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationParamsWithBrackets.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationWithWindowsNewline.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParseComplexPackage.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParsePackageAndProcedureLevelAnnotations.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotation.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationAccessibleBy.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationMultilineDeclare.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationWithKeyValue.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParsePackageLevelAnnotationWithMultilineComment.sql (100%) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.spaceBeforeAnnotationParams.sql (100%) rename {tests => old_tests}/ut_expectation_processor/who_called_expectation.parseStackTrace.sql (100%) rename {tests => old_tests}/ut_expectation_processor/who_called_expectation.parseStackTraceWith0x.sql (100%) rename {tests => old_tests}/ut_expectations/common/ut.expect.not_to_equal.scalar.common.sql (100%) rename {tests => old_tests}/ut_expectations/common/ut.expect.to_equal.different_scalars.common.sql (100%) rename {tests => old_tests}/ut_expectations/common/ut.expect.to_equal.scalar.common.sql (100%) rename {tests => old_tests}/ut_expectations/common/ut.expect.to_equal.scalar.null_value_text.common.sql (100%) rename {tests => old_tests}/ut_expectations/common/ut.expect.to_equal.scalar.with_message.common.sql (100%) rename {tests => old_tests}/ut_expectations/common/ut.expect.to_equal.scalar.with_nulls_equal.common.sql (100%) rename {tests => old_tests}/ut_expectations/common/ut.expect.unuary_comparator.scalar.common.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.not_to_be_null.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.not_to_equal.GivesFailureForDifferentDataTypes.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.not_to_equal.GivesFailureForEqualValues.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.not_to_equal.GivesSuccessForDifferentValues.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsNotBoolean.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_false.GivesFailureWhenExpessionIsTrue.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_false.GivesSuccessWhenExpessionIsFalse.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_like.FailsForUnsupportedDatatype.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_not_null.GivesFailureWhenActualIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_not_null.GivesSuccessWhenActualIsNotNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_null.anydata.GivesSuccessWhenAnydataIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_null.anydata.GivesSuccessWhenCollectionPassedIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_null.anydata.GivesSuccessWhenObjectPassedIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_null.refcursor.GivesSuccessWhenCursorIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_null.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsFalse.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsNotBoolean.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_true.GivesFailureWhenExpessionIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_be_true.GivesSuccessWhenExpessionIsTrue.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesFailureForDifferentDataTypes.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesFailureForDifferentValues.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesFailureWhenActualIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesFailureWhenBothValuesAreNullAndArgumentAreNullEqualIsFalse.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesFailureWhenBothValuesAreNullAndConfigurationAreNullEqualIsFalse.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesFailureWhenExpectedIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesSuccessForEqualValues.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesSuccessWhenBothValuesAreNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.GivesSuccessWhenBothValuesAreNullAndArgumentAreNullEqualIsTrue.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.PutsNullIntoStringValueWhenActualIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.PutsNullIntoStringValueWhenExpectedIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.ExcludeColumnsXPathFailsOnInvalidXPath.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesFailureWhenBothObjectsAreNullButDifferentType.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesFailureWhenComparingDifferentData.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesFailureWhenComparingDifferentObjects.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesFailureWhenComparingObejctToCollection.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesFailureWhenOneOfObjectsIsNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWhenBothAnydataAreNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWhenBothObjectsAreNull.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWhenComparingTheSameCollections.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWhenComparingTheSameData.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWithExcludedCollectionAttributes.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWithExcludedCollectionAttributesXPath.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWithExcludedObjectAttributes.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.GivesSuccessWithExcludedObjectAttributesXPath.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.anydata.PutsObjectStrucureIntoResult.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.ComparesDateAndTimeWhenSetNlsIsUsed.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.ExcludeColumnNameListIsCaseSensitive.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.ExcludeColumnNamesAreCaseSensitive.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.ExcludeColumnsXPathFailsOnInvalidXPath.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.ExcludeColumnsXPathIsCaseSensitive.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.GivesFailureForDifferentValues.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.GivesSuccessForEqualValues.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.GivesSuccessForEqualValuesWithExcludedColumnList.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.GivesSuccessForEqualValuesWithExcludedColumns.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.ReportsTheExceptionWhenAnExceptionInCursorIsCaught.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.ReturnsCursorDataForFailure.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.SupportsSQLandPLSQLdatatypes.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.UsesDefaultNLSSettingsForDatesFormatting.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.with_text.GivesTheProvidedTextAsMessage.sql (100%) rename {tests => old_tests}/ut_expectations/ut.expect.to_match.FailsForUnsupportedDatatype.sql (100%) rename {tests => old_tests}/ut_expectations/ut_data_value_object.compare.Gives0WhenComparingIdenticalObjects.sql (100%) rename {tests => old_tests}/ut_expectations/ut_expectation_processor.nulls_are_equal.raisesExceptionWhenTryingToSetNullValue.sql (100%) rename {tests => old_tests}/ut_expectations/ut_expectation_processor.stackOnFailedTest.sql (100%) rename {tests => old_tests}/ut_expectations/ut_expectation_processor.stackOnUtFail.sql (100%) rename {tests => old_tests}/ut_matchers/be_between.sql (100%) rename {tests => old_tests}/ut_matchers/be_empty.sql (100%) rename {tests => old_tests}/ut_matchers/be_like.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.be_between.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.be_greater_or_equal.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.be_greater_than.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.be_less_or_equal.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.be_less_than.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.collection.be_empty.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.collection.not_be_empty.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.other.be_empty.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.other.not_be_empty.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.refcursor.be_empty.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.common.refcursor.not_to_be_empty.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.to_be_like.common.sql (100%) rename {tests => old_tests}/ut_matchers/common/ut.expect.to_match.common.sql (100%) rename {tests => old_tests}/ut_matchers/greater_or_equal.sql (100%) rename {tests => old_tests}/ut_matchers/greater_than.sql (100%) rename {tests => old_tests}/ut_matchers/less_or_equal.sql (100%) rename {tests => old_tests}/ut_matchers/less_than.sql (100%) rename {tests => old_tests}/ut_matchers/match.sql (100%) rename {tests => old_tests}/ut_matchers/timestamp_between.sql (100%) rename {tests => old_tests}/ut_matchers/timestamp_ltz_between.sql (100%) rename {tests => old_tests}/ut_matchers/timestamp_ltz_not_between.sql (100%) rename {tests => old_tests}/ut_matchers/timestamp_not_between.sql (100%) rename {tests => old_tests}/ut_matchers/timestamp_tz_between.sql (100%) rename {tests => old_tests}/ut_matchers/timestamp_tz_not_between.sql (100%) rename {tests => old_tests}/ut_metadata/ut_metadata.form_name.TrimStandaloneProgramName.sql (100%) rename {tests => old_tests}/ut_output_buffer/get_lines.RecievesALineFromBufferTableAndDeletes.sql (100%) rename {tests => old_tests}/ut_output_buffer/get_lines.WaitsForTheDataToAppearForSpecifiedTime.sql (100%) rename {tests => old_tests}/ut_output_buffer/send_line.DoesNotSendLineIfNullReporterIdGiven.sql (100%) rename {tests => old_tests}/ut_output_buffer/send_line.DoesNotSendLineIfNullTextGiven.sql (100%) rename {tests => old_tests}/ut_output_buffer/send_line.SendsALineIntoBufferTable.sql (100%) rename {tests => old_tests}/ut_reporters/ut_coverage_sonar_reporter.AcceptsFileMapping.sql (100%) rename {tests => old_tests}/ut_reporters/ut_coverage_sonar_reporter.BuildsSonarCoverageReport.sql (100%) rename {tests => old_tests}/ut_reporters/ut_documentation_reporter.providesCorrectLineFromStacktrace.sql (100%) rename {tests => old_tests}/ut_reporters/ut_documentation_reporter.reportMultipleWarnings.sql (100%) rename {tests => old_tests}/ut_reporters/ut_documentation_reporter.reportTestTiming.sql (100%) rename {tests => old_tests}/ut_reporters/ut_html_reporter.DefaultSchemaCoverage.sql (100%) rename {tests => old_tests}/ut_reporters/ut_html_reporter.UserOverrideSchemaCoverage.sql (100%) rename {tests => old_tests}/ut_reporters/ut_sonar_test_reporter.AcceptsFileMapping.sql (100%) rename {tests => old_tests}/ut_reporters/ut_sonar_test_reporter.ProducesExpectedOutputs.sql (100%) rename {tests => old_tests}/ut_reporters/ut_teamcity_reporter.ProducesExpectedOutputs.sql (100%) rename {tests => old_tests}/ut_reporters/ut_xunit_reporter.ProducesExpectedOutputs.sql (100%) rename {tests => old_tests}/ut_reporters/ut_xunit_reporter.ReportOnSuiteWithoutDesc.sql (100%) rename {tests => old_tests}/ut_reporters/ut_xunit_reporter.ReportOnTestWithoutDesc.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.AllowsDescriptionsWithComma.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.CacheInvalidaesOnPackageDrop.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.DoesntFindTheSuiteWhenPackageSpecIsInvalid.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.IncludesInvalidPackageBodiesInTheRun.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.PackageWithDollarSign.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.PackageWithHash.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.TestWithDollarSign.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.TestWithHashSign.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheSchema.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByName.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByNameCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByPath.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageByPathCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageProcedureByPath.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTop2PackageProcedureByPathCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByName.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByNameCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByPath.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageByPathCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureByPath.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureByPathCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureWithoutSubsuitesByName.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageProcedureWithoutSubsuitesByNameCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByName.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByNameCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByPath.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.configure_execution_by_path.PrepareRunnerForTheTopPackageWithoutSubsuitesByPathCurUser.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.emptySuitePath.sql (100%) rename {tests => old_tests}/ut_suite_manager/ut_suite_manager.get_schema_ut_packages.IncludesPackagesWithSutePath.sql (100%) rename {tests => old_tests}/ut_test/ut_test.AfterEachExecuted.sql (100%) rename {tests => old_tests}/ut_test/ut_test.AfterEachProcedureNameInvalid.sql (100%) rename {tests => old_tests}/ut_test/ut_test.AfterEachProcedureNameNull.sql (100%) rename {tests => old_tests}/ut_test/ut_test.ApplicationInfoOnExecution.sql (100%) rename {tests => old_tests}/ut_test/ut_test.BeforeEachExecuted.sql (100%) rename {tests => old_tests}/ut_test/ut_test.BeforeEachProcedureNameInvalid.sql (100%) rename {tests => old_tests}/ut_test/ut_test.BeforeEachProcedureNameNull.sql (100%) rename {tests => old_tests}/ut_test/ut_test.DisabledFlagSkipTest.sql (100%) rename {tests => old_tests}/ut_test/ut_test.IgnoreTollbackToSavepointException.sql (100%) rename {tests => old_tests}/ut_test/ut_test.OwnerNameInvalid.sql (100%) rename {tests => old_tests}/ut_test/ut_test.OwnerNameNull.sql (100%) rename {tests => old_tests}/ut_test/ut_test.PackageInInvalidState.sql (100%) rename {tests => old_tests}/ut_test/ut_test.PackageNameInvalid.sql (100%) rename {tests => old_tests}/ut_test/ut_test.PackageNameNull.sql (100%) rename {tests => old_tests}/ut_test/ut_test.ProcedureNameInvalid.sql (100%) rename {tests => old_tests}/ut_test/ut_test.ProcedureNameNull.sql (100%) rename {tests => old_tests}/ut_test/ut_test.ReportWarningOnRollbackFailed.sql (100%) rename {tests => old_tests}/ut_test/ut_test.Rollback_type.Auto.sql (100%) rename {tests => old_tests}/ut_test/ut_test.Rollback_type.AutoOnFailure.sql (100%) rename {tests => old_tests}/ut_test/ut_test.Rollback_type.Manual.sql (100%) rename {tests => old_tests}/ut_test/ut_test.Rollback_type.ManualOnFailure.sql (100%) rename {tests => old_tests}/ut_test/ut_test.SetupExecutedBeforeTest.sql (100%) rename {tests => old_tests}/ut_test/ut_test.SetupProcedureNameInvalid.sql (100%) rename {tests => old_tests}/ut_test/ut_test.SetupProcedureNameNull.sql (100%) rename {tests => old_tests}/ut_test/ut_test.TeardownExecutedAfterTest.sql (100%) rename {tests => old_tests}/ut_test/ut_test.TeardownProcedureNameInvalid.sql (100%) rename {tests => old_tests}/ut_test/ut_test.TeardownProcedureNameNull.sql (100%) rename {tests => old_tests}/ut_test/ut_test.TestOutputGathering.sql (100%) rename {tests => old_tests}/ut_test/ut_test.TestOutputGatheringWhenEmpty.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.DisabledFlagSkipSuite.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ErrorsATestWhenAfterTestFails.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ErrorsATestWhenBeforeTestFails.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ErrorsEachTestWhenBeforeAllFails.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ErrorsEachTestWhenBeforeEachFails.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ErrorsEachTestWhenPackageHasInvalidBody.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ErrorsEachTestWhenPackageHasNoBody.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ReportsWarningsATestWhenAfterAllFails.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.ReportsWarningsATestWhenAfterEachFails.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.Rollback_type.Auto.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.Rollback_type.AutoOnFailure.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.Rollback_type.Manual.sql (100%) rename {tests => old_tests}/ut_test_suite/ut_test_suite.Rollback_type.ManualOnFailure.sql (100%) rename {tests => old_tests}/ut_utils/common/ut_utils.clob_to_table.sql (100%) rename {tests => old_tests}/ut_utils/common/ut_utils.table_to_clob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.append_to_clob.worksWithMultiByteChars.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.clob_to_table.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.clob_to_table_multibyte.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.table_to_clob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.test_result_to_char.RunsWithInvalidValues.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.test_result_to_char.RunsWithNullValue.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.test_result_to_char.Success.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.Blob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.Clob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.Date.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.NullBlob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.NullClob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.NullDate.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.NullNumber.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.NullTimestamp.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.NullVarchar2.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.Timestamp.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.TimestampWithLocalTimeZone.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.TimestampWithTimeZone.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.Varchar2.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.veryBigBlob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.veryBigClob.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.veryBigNumber.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.veryBigVarchar2.sql (100%) rename {tests => old_tests}/ut_utils/ut_utils.to_string.verySmallNumber.sql (100%) diff --git a/.travis.yml b/.travis.yml index e5d70ab41..661b2e428 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,9 +86,9 @@ before_script: - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/install_utplsql_release.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/create_additional_grants_for_old_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_examples.sh; fi + - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_old_tests.sh; fi script: - - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/run_old_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash test/install_and_run_tests.sh; fi - if [ "${TRAVIS_TAG}" = "" ] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sonar-scanner; fi - if [ "${TRAVIS_TAG}" = "" ]; then bash .travis/coveralls_uploader.sh; fi diff --git a/.travis/coveralls_uploader.js b/.travis/coveralls_uploader.js index 563d3d5ba..388e37f7c 100644 --- a/.travis/coveralls_uploader.js +++ b/.travis/coveralls_uploader.js @@ -9,7 +9,7 @@ if (process.env.COVERALLS_URL_BASE) { url = 'https://coveralls.io/api/v1/jobs'; } -fs.readFile('../tests/coverage.json',function (err,data) { +fs.readFile('../old_tests/coverage.json',function (err,data) { if (err) { return console.log(err); } @@ -19,13 +19,13 @@ fs.readFile('../tests/coverage.json',function (err,data) { if (process.env.COVERALLS_REPO_TOKEN) { req.repo_token = process.env.COVERALLS_REPO_TOKEN; } - + for (var i in req.source_files) { req.source_files[i].source_digest = md5File.sync("../" + req.source_files[i].name); } var requestStr = JSON.stringify(req); - + request.post({url : url, form : { json:requestStr}}, function(err, response, body){process.stdout.write(body);}); -}); \ No newline at end of file +}); diff --git a/.travis/run_old_tests.sh b/.travis/run_old_tests.sh index 83105b79c..4e8dcbce9 100644 --- a/.travis/run_old_tests.sh +++ b/.travis/run_old_tests.sh @@ -2,8 +2,9 @@ set -ev +cd old_tests + "$SQLCLI" $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR < Date: Sun, 13 Aug 2017 14:02:51 +0100 Subject: [PATCH 36/42] Disabled test due to failures on US7ASCII code page on 12.1 DB --- test/ut_utils/test_ut_utils.pks | 37 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/test/ut_utils/test_ut_utils.pks b/test/ut_utils/test_ut_utils.pks index e9ef53be5..2b3f4972a 100644 --- a/test/ut_utils/test_ut_utils.pks +++ b/test/ut_utils/test_ut_utils.pks @@ -2,56 +2,57 @@ create or replace package test_ut_utils is --%suite --%suitepath(utplsql.core) - + --%test procedure test_clob_to_table; - + --%test procedure test_to_char; - + --%test procedure test_to_string_blob; - + --%test procedure test_to_string_clob; - + --%test - procedure test_to_string_date; - + procedure test_to_string_date; + --%test - procedure to_string_null; - + procedure to_string_null; + --%test procedure to_string; - + --%test(Trims long Blob to max lenght and appends '[...]' at the end of string) procedure to_string_big_blob; - + --%test(Trims long Clob to max lenght and appends '[...]' at the end of string) - procedure to_string_big_clob; - + procedure to_string_big_clob; + --%test(Returns a full string representation of a very big number) procedure to_string_big_number; - + --%test(Trims long varchars to max lenght and appends '[...]' at the end of string) procedure to_string_big_varchar2; --%test(Returns a full string representation of a very small number) procedure to_string_big_tiny_number; - + --%test(Table to clob function test) procedure test_table_to_clob; - + --%test(append_to_clob works With Multi Byte Chars) --%beforetest(setup_append_with_multibyte) --%aftertest(clean_append_with_multibyte) procedure test_append_with_multibyte; procedure setup_append_with_multibyte; procedure clean_append_with_multibyte; - + --%test(clob_to_table multibyte) + --%disabled(We cannot run this test successfully on 12.1 until we change NLSCHARACTERSET from US7ASCII to AL32UTF8) procedure test_clob_to_table_multibyte; - + end test_ut_utils; / From cd0d954f56d8ffbba99bcc7a92ba48fa64036e94 Mon Sep 17 00:00:00 2001 From: Jacek Date: Sun, 13 Aug 2017 16:21:10 +0100 Subject: [PATCH 37/42] Added test for `ut_coverage_sonar_reporter` Added missing privileges to mock data in ut3 schema. Added ability to mock coverage. --- .travis/install.sh | 2 +- source/core/coverage/ut_coverage.pkb | 31 ++++--- source/core/coverage/ut_coverage_helper.pkb | 8 ++ source/core/coverage/ut_coverage_helper.pks | 6 ++ test/ut_reporters/test_coverage.pkb | 84 +++++++++++++++++++ test/ut_reporters/test_coverage.pks | 13 +++ .../test_coverage_sonar_reporter.pkb | 34 ++++++++ .../test_coverage_sonar_reporter.pks | 10 +++ 8 files changed, 177 insertions(+), 11 deletions(-) create mode 100644 test/ut_reporters/test_coverage.pkb create mode 100644 test/ut_reporters/test_coverage.pks create mode 100644 test/ut_reporters/test_coverage_sonar_reporter.pkb create mode 100644 test/ut_reporters/test_coverage_sonar_reporter.pks diff --git a/.travis/install.sh b/.travis/install.sh index 8723abc1c..1e9c70d49 100644 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -30,6 +30,6 @@ set feedback off set feedback on --Needed for testing coverage outside of main UT3 schema. -grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, delete any table, create any table, drop any table, alter any table, select any dictionary to $UT3_TESTER; +grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table, select any dictionary to $UT3_TESTER; exit SQL diff --git a/source/core/coverage/ut_coverage.pkb b/source/core/coverage/ut_coverage.pkb index 1eaa6fbe2..e3dece447 100644 --- a/source/core/coverage/ut_coverage.pkb +++ b/source/core/coverage/ut_coverage.pkb @@ -16,6 +16,8 @@ create or replace package body ut_coverage is limitations under the License. */ + type t_source_lines is table of binary_integer; + -- The source query has two important transformations done in it. -- the flag: to_be_skipped ='Y' is set for a line of code that is badly reported by DBMS_PROFILER as executed 0 times. -- This includes lines that are: @@ -157,13 +159,25 @@ create or replace package body ut_coverage is ut_coverage_helper.coverage_stop_develop(); end; + function get_lines_to_skip(a_object_owner varchar2, a_object_name varchar2) return t_source_lines is + l_result t_source_lines; + begin + select line + bulk collect into l_result + from ut_coverage_sources_tmp o + where to_be_skipped = 'Y' + and o.owner = a_object_owner + and o.name = a_object_name; + + return l_result; + end; + function get_coverage_data(a_coverage_options ut_coverage_options) return t_coverage is l_line_calls ut_coverage_helper.unit_line_calls; l_result t_coverage; l_new_unit t_unit_coverage; l_skipped_objects ut_object_names := ut_object_names(); - - type t_source_lines is table of binary_integer; + l_lines_to_skip t_source_lines; line_no binary_integer; begin @@ -178,24 +192,21 @@ create or replace package body ut_coverage is end if; for src_object in ( - select o.owner, o.name, o.full_name, max(o.line) lines_count, - cast( - collect(decode(to_be_skipped, 'Y', to_char(line))) as ut_varchar2_list - ) to_be_skipped_list + select o.owner, o.name, o.full_name, max(o.line) lines_count from ut_coverage_sources_tmp o group by o.owner, o.name, o.full_name ) loop + l_lines_to_skip := get_lines_to_skip( src_object.owner, src_object.name ); + --get coverage data l_line_calls := ut_coverage_helper.get_raw_coverage_data( src_object.owner, src_object.name ); --if there is coverage, we need to filter out the garbage (badly indicated data from dbms_profiler) if l_line_calls.count > 0 then --remove lines that should not be indicted as meaningful - for i in 1 .. src_object.to_be_skipped_list.count loop - if src_object.to_be_skipped_list(i) is not null then - l_line_calls.delete(src_object.to_be_skipped_list(i)); - end if; + for i in 1 .. l_lines_to_skip.count loop + l_line_calls.delete(l_lines_to_skip(i)); end loop; end if; diff --git a/source/core/coverage/ut_coverage_helper.pkb b/source/core/coverage/ut_coverage_helper.pkb index b2434f592..ec97764ef 100644 --- a/source/core/coverage/ut_coverage_helper.pkb +++ b/source/core/coverage/ut_coverage_helper.pkb @@ -109,5 +109,13 @@ create or replace package body ut_coverage_helper is end loop; return l_results; end; + + procedure mock_coverage_id(a_coverage_id integer) is + begin + if g_develop_mode and g_is_started then + g_coverage_id := a_coverage_id; + end if; + end; + end; / diff --git a/source/core/coverage/ut_coverage_helper.pks b/source/core/coverage/ut_coverage_helper.pks index cc966c2b0..8c47a3503 100644 --- a/source/core/coverage/ut_coverage_helper.pks +++ b/source/core/coverage/ut_coverage_helper.pks @@ -38,5 +38,11 @@ create or replace package ut_coverage_helper authid definer is procedure coverage_resume; function get_raw_coverage_data(a_object_owner varchar2, a_object_name varchar2) return unit_line_calls; + + /*** + * Allows overwriting of private global variable g_coverage_id + * Used internally, only for unit testing of the framework only + */ + procedure mock_coverage_id(a_coverage_id integer); end; / diff --git a/test/ut_reporters/test_coverage.pkb b/test/ut_reporters/test_coverage.pkb new file mode 100644 index 000000000..83c575f23 --- /dev/null +++ b/test/ut_reporters/test_coverage.pkb @@ -0,0 +1,84 @@ +create or replace package body test_coverage is + + g_run_id integer; + + function get_mock_run_id return integer is + v_result integer; + begin + select min(runid) - 1 into v_result + from ut3.plsql_profiler_runs; + return v_result; + end; + + procedure create_dummy_coverage_package is + begin + execute immediate q'[create or replace package DUMMY_COVERAGE is + procedure do_stuff; + end;]'; + execute immediate q'[create or replace package body DUMMY_COVERAGE is + procedure do_stuff is + begin + if 1 = 2 then + dbms_output.put_line('should not get here'); + else + dbms_output.put_line('should get here'); + end if; + end; + end;]'; + end; + + procedure create_dummy_coverage_test is + begin + execute immediate q'[create or replace package TEST_DUMMY_COVERAGE is + --%suite(dummy coverage test) + + --%test + procedure test_do_stuff; + end;]'; + execute immediate q'[create or replace package body TEST_DUMMY_COVERAGE is + procedure test_do_stuff is + begin + dummy_coverage.do_stuff; + end; + end;]'; + end; + + procedure mock_coverage_data(a_run_id integer) is + c_unit_id constant integer := 1; + begin + insert into ut3.plsql_profiler_runs ( runid, run_owner, run_date, run_comment) + values(a_run_id, user, sysdate, 'unit testing utPLSQL'); + + insert into ut3.plsql_profiler_units ( runid, unit_number, unit_type, unit_owner, unit_name) + values(a_run_id, c_unit_id, 'PACKAGE BODY', 'UT3_TESTER', 'DUMMY_COVERAGE'); + + insert into ut3.plsql_profiler_data ( runid, unit_number, line#, total_occur, total_time) + select a_run_id, c_unit_id, 4, 1, 1 from dual union all + select a_run_id, c_unit_id, 5, 0, 0 from dual union all + select a_run_id, c_unit_id, 7, 1, 1 from dual; + end; + + procedure setup_dummy_coverage is + pragma autonomous_transaction; + begin + create_dummy_coverage_package(); + create_dummy_coverage_test(); + g_run_id := get_mock_run_id(); + ut3.ut_coverage_helper.mock_coverage_id(g_run_id); + mock_coverage_data(g_run_id); + commit; + end; + + procedure cleanup_dummy_coverage is + pragma autonomous_transaction; + begin + execute immediate q'[drop package test_dummy_coverage]'; + execute immediate q'[drop package dummy_coverage]'; + delete from ut3.plsql_profiler_data where runid = g_run_id; + delete from ut3.plsql_profiler_units where runid = g_run_id; + delete from ut3.plsql_profiler_runs where runid = g_run_id; + commit; + end; + +end; +/ diff --git a/test/ut_reporters/test_coverage.pks b/test/ut_reporters/test_coverage.pks new file mode 100644 index 000000000..a45d0357a --- /dev/null +++ b/test/ut_reporters/test_coverage.pks @@ -0,0 +1,13 @@ +create or replace package test_coverage is + + --%suite + --%suitepath(utplsql.core) + + --%beforeall + procedure setup_dummy_coverage; + + --%afterall + procedure cleanup_dummy_coverage; + +end; +/ diff --git a/test/ut_reporters/test_coverage_sonar_reporter.pkb b/test/ut_reporters/test_coverage_sonar_reporter.pkb new file mode 100644 index 000000000..f27960ab4 --- /dev/null +++ b/test/ut_reporters/test_coverage_sonar_reporter.pkb @@ -0,0 +1,34 @@ +create or replace package body test_coverage_sonar_reporter is + + procedure report_on_file is + v_run_id integer; + l_results ut3.ut_varchar2_list; + l_expected clob; + l_actual clob; + begin + --Arrange + l_expected := ' + + + + + +'; + --Act + select * + bulk collect into l_results + from table( + ut3.ut.run( + a_path => 'test_dummy_coverage', + a_reporter=> ut3.ut_coverage_sonar_reporter( ), + a_source_files => ut3.ut_varchar2_list( 'test/dummy_coverage.pkb' ), + a_test_files => ut3.ut_varchar2_list( ) + ) + ); + l_actual := ut3.ut_utils.table_to_clob(l_results); + --Assert + ut.expect(l_actual).to_equal(l_expected); + end; + +end; +/ diff --git a/test/ut_reporters/test_coverage_sonar_reporter.pks b/test/ut_reporters/test_coverage_sonar_reporter.pks new file mode 100644 index 000000000..152da9829 --- /dev/null +++ b/test/ut_reporters/test_coverage_sonar_reporter.pks @@ -0,0 +1,10 @@ +create or replace package test_coverage_sonar_reporter is + + --%suite(ut_coverge_sonar_reporter) + --%suitepath(utplsql.core.test_coverage.reporters) + + --%test(reports on a project file mapped to database object) + procedure report_on_file; + +end; +/ From b330e748fa474abef29dfbf8bc3c23b42216bcc7 Mon Sep 17 00:00:00 2001 From: Jacek Date: Sun, 13 Aug 2017 16:26:42 +0100 Subject: [PATCH 38/42] Added test for `ut_coveralls_reporter` Added tests to the installaltion list. --- test/install_tests.sql | 6 ++++ test/ut_reporters/test_coveralls_reporter.pkb | 31 +++++++++++++++++++ test/ut_reporters/test_coveralls_reporter.pks | 10 ++++++ 3 files changed, 47 insertions(+) create mode 100644 test/ut_reporters/test_coveralls_reporter.pkb create mode 100644 test/ut_reporters/test_coveralls_reporter.pks diff --git a/test/install_tests.sql b/test/install_tests.sql index 2bb36072a..2b28ce3b1 100644 --- a/test/install_tests.sql +++ b/test/install_tests.sql @@ -5,6 +5,9 @@ @ut_matchers/test_matchers.pks @ut_output_buffer/test_output_buffer.pks @ut_suite_manager/test_suite_manager.pks +@@ut_reporters/test_coverage.pks +@@ut_reporters/test_coverage_sonar_reporter.pks +@@ut_reporters/test_coveralls_reporter.pks @core.pkb @ut_utils/test_ut_utils.pkb @@ -12,6 +15,9 @@ @ut_matchers/test_matchers.pkb @ut_output_buffer/test_output_buffer.pkb @ut_suite_manager/test_suite_manager.pkb +@@ut_reporters/test_coverage.pkb +@@ut_reporters/test_coverage_sonar_reporter.pkb +@@ut_reporters/test_coveralls_reporter.pkb show errors diff --git a/test/ut_reporters/test_coveralls_reporter.pkb b/test/ut_reporters/test_coveralls_reporter.pkb new file mode 100644 index 000000000..8288ad2ea --- /dev/null +++ b/test/ut_reporters/test_coveralls_reporter.pkb @@ -0,0 +1,31 @@ +create or replace package body test_coveralls_reporter is + + procedure report_on_file is + v_run_id integer; + l_results ut3.ut_varchar2_list; + l_expected clob; + l_actual clob; + begin + --Arrange + l_expected := '{"source_files":[ +{ "name": "test/dummy_coverage.pkb", +"coverage": [null,null,null,1,0,null,1]}]} + '; + --Act + select * + bulk collect into l_results + from table( + ut3.ut.run( + a_path => 'test_dummy_coverage', + a_reporter=> ut3.ut_coveralls_reporter( ), + a_source_files => ut3.ut_varchar2_list( 'test/dummy_coverage.pkb' ), + a_test_files => ut3.ut_varchar2_list( ) + ) + ); + l_actual := ut3.ut_utils.table_to_clob(l_results); + --Assert + ut.expect(l_actual).to_equal(l_expected); + end; + +end; +/ diff --git a/test/ut_reporters/test_coveralls_reporter.pks b/test/ut_reporters/test_coveralls_reporter.pks new file mode 100644 index 000000000..8dc6ea369 --- /dev/null +++ b/test/ut_reporters/test_coveralls_reporter.pks @@ -0,0 +1,10 @@ +create or replace package test_coveralls_reporter is + + --%suite(ut_coveralls_reporter) + --%suitepath(utplsql.core.test_coverage.reporters) + + --%test(reports on a project file mapped to database object) + procedure report_on_file; + +end; +/ From c960d4443d2973b4418b71c24b6d793528d30411 Mon Sep 17 00:00:00 2001 From: Jacek Date: Sun, 13 Aug 2017 17:07:26 +0100 Subject: [PATCH 39/42] Fixed failing tests and refactored sonar reporter. --- source/reporters/ut_coverage_sonar_reporter.tpb | 12 +++++------- test/ut_reporters/test_coverage.pkb | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/source/reporters/ut_coverage_sonar_reporter.tpb b/source/reporters/ut_coverage_sonar_reporter.tpb index 6653ac82d..156f50fcb 100644 --- a/source/reporters/ut_coverage_sonar_reporter.tpb +++ b/source/reporters/ut_coverage_sonar_reporter.tpb @@ -42,13 +42,11 @@ create or replace type body ut_coverage_sonar_reporter is end loop; else while l_line_no is not null loop - l_file_part := - case a_unit_coverage.lines(l_line_no) - when 0 then - ''||chr(10) - else - ''||chr(10) - end; + if a_unit_coverage.lines(l_line_no) = 0 then + l_file_part := ''||chr(10); + else + l_file_part := ''||chr(10); + end if; ut_utils.append_to_clob(l_result, l_file_part); l_line_no := a_unit_coverage.lines.next(l_line_no); end loop; diff --git a/test/ut_reporters/test_coverage.pkb b/test/ut_reporters/test_coverage.pkb index 83c575f23..7feba8b46 100644 --- a/test/ut_reporters/test_coverage.pkb +++ b/test/ut_reporters/test_coverage.pkb @@ -5,7 +5,7 @@ create or replace package body test_coverage is function get_mock_run_id return integer is v_result integer; begin - select min(runid) - 1 into v_result + select nvl(min(runid),0) - 1 into v_result from ut3.plsql_profiler_runs; return v_result; end; From 41b484990dd38aa667d625f06be64c03c660bb61 Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 17 Aug 2017 02:27:25 +0100 Subject: [PATCH 40/42] Fixed issues with framework accessing wrong tables when running self-test. the TMP table for coverage is now always accessed from package with authid DEFINER. --- source/core/coverage/ut_coverage.pkb | 143 +++++++++--------- source/core/coverage/ut_coverage_helper.pkb | 63 +++++++- source/core/coverage/ut_coverage_helper.pks | 36 ++++- source/core/ut_utils.pkb | 5 +- .../create_synonyms_and_grants_for_public.sql | 2 - .../create_synonyms_and_grants_for_user.sql | 2 - .../ut_coverage_report_html_helper.pkb | 12 +- test/ut_suite_manager/test_suite_manager.pks | 82 +++++----- 8 files changed, 212 insertions(+), 133 deletions(-) diff --git a/source/core/coverage/ut_coverage.pkb b/source/core/coverage/ut_coverage.pkb index e3dece447..0f080d039 100644 --- a/source/core/coverage/ut_coverage.pkb +++ b/source/core/coverage/ut_coverage.pkb @@ -30,7 +30,7 @@ create or replace package body ut_coverage is -- The subquery is optimized by: -- - COALESCE function -> it will execute only for TRIGGERS -- - scalar subquery cache -> it will only execute once for one trigger source code. - function get_populate_sources_tmp_sql(a_coverage_options ut_coverage_options) return varchar2 is + function get_cov_sources_sql(a_coverage_options ut_coverage_options) return varchar2 is l_result varchar2(32767); l_full_name varchar2(100); l_view_name varchar2(200) := ut_metadata.get_dba_view('dba_source'); @@ -41,10 +41,9 @@ create or replace package body ut_coverage is l_full_name := 'lower(s.owner||''.''||s.name)'; end if; l_result := ' - insert /*+ append */ into ut_coverage_sources_tmp(full_name,owner,name,line,text, to_be_skipped) - select * + select full_name, owner, name, line, to_be_skipped, text from ( - select '||l_full_name||q'[, + select '||l_full_name||q'[ as full_name, s.owner, s.name, s.line - @@ -101,26 +100,46 @@ create or replace package body ut_coverage is return l_result; end; - function is_tmp_table_populated return boolean is - l_result integer; + function get_cov_sources_cursor(a_coverage_options ut_coverage_options) return sys_refcursor is + l_cursor sys_refcursor; + l_skip_objects ut_object_names; + l_schema_names ut_varchar2_rows; + l_sql varchar2(32767); begin - select 1 into l_result from ut_coverage_sources_tmp where rownum = 1; - return (l_result = 1); - exception - when no_data_found then - return false; + l_schema_names := coalesce(a_coverage_options.schema_names, ut_varchar2_rows(sys_context('USERENV','CURRENT_SCHEMA'))); + if not ut_coverage_helper.is_develop_mode() then + --skip all the utplsql framework objects and all the unit test packages that could potentially be reported by coverage. + l_skip_objects := ut_utils.get_utplsql_objects_list() multiset union all coalesce(a_coverage_options.exclude_objects, ut_object_names()); + end if; + l_sql := get_cov_sources_sql(a_coverage_options); + if a_coverage_options.file_mappings is not empty then + open l_cursor for l_sql using a_coverage_options.file_mappings, l_skip_objects, a_coverage_options.include_objects; + else + open l_cursor for l_sql using l_schema_names, l_skip_objects, a_coverage_options.include_objects; + end if; + return l_cursor; end; - procedure populate_tmp_table(a_coverage_options ut_coverage_options, a_skipped_objects ut_object_names) is + procedure populate_tmp_table(a_coverage_options ut_coverage_options) is pragma autonomous_transaction; - l_schema_names ut_varchar2_rows; + l_cov_sources_crsr sys_refcursor; + l_cov_sources_data ut_coverage_helper.t_coverage_sources_tmp_rows; begin - delete from ut_coverage_sources_tmp; - l_schema_names := coalesce(a_coverage_options.schema_names, ut_varchar2_rows(sys_context('USERENV','CURRENT_SCHEMA'))); - if a_coverage_options.file_mappings is not empty then - execute immediate get_populate_sources_tmp_sql(a_coverage_options) using a_coverage_options.file_mappings, a_skipped_objects, a_coverage_options.include_objects; - else - execute immediate get_populate_sources_tmp_sql(a_coverage_options) using l_schema_names, a_skipped_objects, a_coverage_options.include_objects; + + if not ut_coverage_helper.is_tmp_table_populated() or ut_coverage_helper.is_develop_mode() then + ut_coverage_helper.cleanup_tmp_table(); + + l_cov_sources_crsr := get_cov_sources_cursor(a_coverage_options); + + loop + fetch l_cov_sources_crsr bulk collect into l_cov_sources_data limit 1000; + + ut_coverage_helper.insert_into_tmp_table(l_cov_sources_data); + + exit when l_cov_sources_crsr%notfound; + end loop; + + close l_cov_sources_crsr; end if; commit; end; @@ -159,94 +178,80 @@ create or replace package body ut_coverage is ut_coverage_helper.coverage_stop_develop(); end; - function get_lines_to_skip(a_object_owner varchar2, a_object_name varchar2) return t_source_lines is - l_result t_source_lines; - begin - select line - bulk collect into l_result - from ut_coverage_sources_tmp o - where to_be_skipped = 'Y' - and o.owner = a_object_owner - and o.name = a_object_name; - - return l_result; - end; - function get_coverage_data(a_coverage_options ut_coverage_options) return t_coverage is - l_line_calls ut_coverage_helper.unit_line_calls; - l_result t_coverage; - l_new_unit t_unit_coverage; - l_skipped_objects ut_object_names := ut_object_names(); - l_lines_to_skip t_source_lines; - line_no binary_integer; + l_line_calls ut_coverage_helper.t_unit_line_calls; + l_result t_coverage; + l_new_unit t_unit_coverage; + line_no binary_integer; + l_source_objects_crsr ut_coverage_helper.t_tmp_table_objects_crsr; + l_source_object ut_coverage_helper.t_tmp_table_object; begin - if not ut_coverage_helper.is_develop_mode() then - --skip all the utplsql framework objects and all the unit test packages that could potentially be reported by coverage. - l_skipped_objects := ut_utils.get_utplsql_objects_list() multiset union all coalesce(a_coverage_options.exclude_objects, ut_object_names()); - end if; - --prepare global temp table with sources - if not is_tmp_table_populated() or ut_coverage_helper.is_develop_mode() then - populate_tmp_table(a_coverage_options, l_skipped_objects); - end if; + populate_tmp_table(a_coverage_options); - for src_object in ( - select o.owner, o.name, o.full_name, max(o.line) lines_count - from ut_coverage_sources_tmp o - group by o.owner, o.name, o.full_name - ) loop - - l_lines_to_skip := get_lines_to_skip( src_object.owner, src_object.name ); + l_source_objects_crsr := ut_coverage_helper.get_tmp_table_objects_cursor(); + loop + fetch l_source_objects_crsr into l_source_object; + exit when l_source_objects_crsr%notfound; --get coverage data - l_line_calls := ut_coverage_helper.get_raw_coverage_data( src_object.owner, src_object.name ); + l_line_calls := ut_coverage_helper.get_raw_coverage_data( l_source_object.owner, l_source_object.name ); --if there is coverage, we need to filter out the garbage (badly indicated data from dbms_profiler) if l_line_calls.count > 0 then --remove lines that should not be indicted as meaningful - for i in 1 .. l_lines_to_skip.count loop - l_line_calls.delete(l_lines_to_skip(i)); + for i in 1 .. l_source_object.to_be_skipped_list.count loop + if l_source_object.to_be_skipped_list(i) is not null then + l_line_calls.delete(l_source_object.to_be_skipped_list(i)); + end if; end loop; end if; --if there are no file mappings or object was actually captured by profiler if a_coverage_options.file_mappings is null or l_line_calls.count > 0 then - if not l_result.objects.exists(src_object.full_name) then - l_result.objects(src_object.full_name) := l_new_unit; - l_result.objects(src_object.full_name).owner := src_object.owner; - l_result.objects(src_object.full_name).name := src_object.name; + + --populate total stats + l_result.total_lines := l_result.total_lines + l_source_object.lines_count; + + --populate object level coverage stats + if not l_result.objects.exists(l_source_object.full_name) then + l_result.objects(l_source_object.full_name) := l_new_unit; + l_result.objects(l_source_object.full_name).owner := l_source_object.owner; + l_result.objects(l_source_object.full_name).name := l_source_object.name; + l_result.objects(l_source_object.full_name).total_lines := l_source_object.lines_count; end if; - l_result.total_lines := l_result.total_lines + src_object.lines_count; - l_result.objects(src_object.full_name).total_lines := src_object.lines_count; --map to results line_no := l_line_calls.first; if line_no is null then - l_result.uncovered_lines := l_result.uncovered_lines + src_object.lines_count; - l_result.objects(src_object.full_name).uncovered_lines := src_object.lines_count; + l_result.uncovered_lines := l_result.uncovered_lines + l_source_object.lines_count; + l_result.objects(l_source_object.full_name).uncovered_lines := l_source_object.lines_count; else loop exit when line_no is null; if l_line_calls(line_no) > 0 then + --total stats l_result.covered_lines := l_result.covered_lines + 1; l_result.executions := l_result.executions + l_line_calls(line_no); - l_result.objects(src_object.full_name).covered_lines := l_result.objects(src_object.full_name).covered_lines + 1; - l_result.objects(src_object.full_name).executions := l_result.objects(src_object.full_name).executions + l_line_calls(line_no); + --object level stats + l_result.objects(l_source_object.full_name).covered_lines := l_result.objects(l_source_object.full_name).covered_lines + 1; + l_result.objects(l_source_object.full_name).executions := l_result.objects(l_source_object.full_name).executions + l_line_calls(line_no); elsif l_line_calls(line_no) = 0 then l_result.uncovered_lines := l_result.uncovered_lines + 1; - l_result.objects(src_object.full_name).uncovered_lines := l_result.objects(src_object.full_name).uncovered_lines + 1; + l_result.objects(l_source_object.full_name).uncovered_lines := l_result.objects(l_source_object.full_name).uncovered_lines + 1; end if; - l_result.objects(src_object.full_name).lines(line_no) := l_line_calls(line_no); + l_result.objects(l_source_object.full_name).lines(line_no) := l_line_calls(line_no); line_no := l_line_calls.next(line_no); end loop; end if; end if; - end loop; + close l_source_objects_crsr; + return l_result; end get_coverage_data; diff --git a/source/core/coverage/ut_coverage_helper.pkb b/source/core/coverage/ut_coverage_helper.pkb index ec97764ef..e56dc8b57 100644 --- a/source/core/coverage/ut_coverage_helper.pkb +++ b/source/core/coverage/ut_coverage_helper.pkb @@ -77,14 +77,14 @@ create or replace package body ut_coverage_helper is dbms_profiler.stop_profiler(); end; - function get_raw_coverage_data(a_object_owner varchar2, a_object_name varchar2) return unit_line_calls is + function get_raw_coverage_data(a_object_owner varchar2, a_object_name varchar2) return t_unit_line_calls is type coverage_row is record ( line binary_integer, calls number(38,0) ); type coverage_rows is table of coverage_row; l_tmp_data coverage_rows; - l_results unit_line_calls; + l_results t_unit_line_calls; begin select d.line#, -- This transformation addresses two issues: @@ -112,9 +112,62 @@ create or replace package body ut_coverage_helper is procedure mock_coverage_id(a_coverage_id integer) is begin - if g_develop_mode and g_is_started then - g_coverage_id := a_coverage_id; - end if; + g_develop_mode := true; + g_is_started := true; + g_coverage_id := a_coverage_id; + end; + + procedure insert_into_tmp_table(a_data t_coverage_sources_tmp_rows) is + begin + forall i in 1 .. a_data.count + insert into ut_coverage_sources_tmp + (full_name,owner,name,line,text, to_be_skipped) + values(a_data(i).full_name,a_data(i).owner,a_data(i).name,a_data(i).line,a_data(i).text,a_data(i).to_be_skipped); + end; + + procedure cleanup_tmp_table is + pragma autonomous_transaction; + begin + null; + execute immediate 'truncate table ut_coverage_sources_tmp$'; + commit; + end; + + function is_tmp_table_populated return boolean is + l_result integer; + begin + select 1 into l_result from ut_coverage_sources_tmp where rownum = 1; + return (l_result = 1); + exception + when no_data_found then + return false; + end; + + function get_tmp_table_objects_cursor return t_tmp_table_objects_crsr is + l_result t_tmp_table_objects_crsr; + begin + open l_result for + select o.owner, o.name, o.full_name, max(o.line) lines_count, + cast( + collect(decode(to_be_skipped, 'Y', to_char(line))) as ut_varchar2_list + ) to_be_skipped_list + from ut_coverage_sources_tmp o + group by o.owner, o.name, o.full_name; + + return l_result; + end; + + function get_tmp_table_object_lines(a_owner varchar2, a_object_name varchar2) return ut_varchar2_list is + l_result ut_varchar2_list; + begin + select rtrim(s.text,chr(10)) text + bulk collect into l_result + from ut_coverage_sources_tmp s + where s.owner = a_owner + and s.name = a_object_name + order by s.line; + + return l_result; end; end; diff --git a/source/core/coverage/ut_coverage_helper.pks b/source/core/coverage/ut_coverage_helper.pks index 8c47a3503..93ffaf573 100644 --- a/source/core/coverage/ut_coverage_helper.pks +++ b/source/core/coverage/ut_coverage_helper.pks @@ -18,7 +18,28 @@ create or replace package ut_coverage_helper authid definer is --table of line calls indexed by line number --!!! this table is sparse!!! - type unit_line_calls is table of number(38,0) index by binary_integer; + type t_unit_line_calls is table of number(38,0) index by binary_integer; + + type t_coverage_sources_tmp_row is record ( + full_name ut_coverage_sources_tmp.full_name%type, + owner ut_coverage_sources_tmp.owner%type, + name ut_coverage_sources_tmp.name%type, + line ut_coverage_sources_tmp.line%type, + to_be_skipped ut_coverage_sources_tmp.to_be_skipped%type, + text ut_coverage_sources_tmp.text%type + ); + + type t_coverage_sources_tmp_rows is table of t_coverage_sources_tmp_row; + + type t_tmp_table_object is record( + owner ut_coverage_sources_tmp.owner%type, + name ut_coverage_sources_tmp.name%type, + full_name ut_coverage_sources_tmp.full_name%type, + lines_count integer, + to_be_skipped_list ut_varchar2_list + ); + + type t_tmp_table_objects_crsr is ref cursor return t_tmp_table_object; function is_develop_mode return boolean; @@ -37,12 +58,23 @@ create or replace package ut_coverage_helper authid definer is procedure coverage_resume; - function get_raw_coverage_data(a_object_owner varchar2, a_object_name varchar2) return unit_line_calls; + function get_raw_coverage_data(a_object_owner varchar2, a_object_name varchar2) return t_unit_line_calls; /*** * Allows overwriting of private global variable g_coverage_id * Used internally, only for unit testing of the framework only */ procedure mock_coverage_id(a_coverage_id integer); + + procedure insert_into_tmp_table(a_data t_coverage_sources_tmp_rows); + + procedure cleanup_tmp_table; + + function is_tmp_table_populated return boolean; + + function get_tmp_table_objects_cursor return t_tmp_table_objects_crsr; + + function get_tmp_table_object_lines(a_owner varchar2, a_object_name varchar2) return ut_varchar2_list; + end; / diff --git a/source/core/ut_utils.pkb b/source/core/ut_utils.pkb index fb0ca05f7..e97d96723 100644 --- a/source/core/ut_utils.pkb +++ b/source/core/ut_utils.pkb @@ -340,12 +340,12 @@ create or replace package body ut_utils is end if; return l_result; end; - + procedure set_action(a_text in varchar2) is begin dbms_application_info.set_module('utPLSQL', a_text); end; - + procedure set_client_info(a_text in varchar2) is begin dbms_application_info.set_client_info(a_text); @@ -381,7 +381,6 @@ create or replace package body ut_utils is pragma autonomous_transaction; begin execute immediate 'truncate table ut_cursor_data'; - execute immediate 'truncate table ut_coverage_sources_tmp$'; commit; end; diff --git a/source/create_synonyms_and_grants_for_public.sql b/source/create_synonyms_and_grants_for_public.sql index f44c45742..b4fedff80 100644 --- a/source/create_synonyms_and_grants_for_public.sql +++ b/source/create_synonyms_and_grants_for_public.sql @@ -59,7 +59,6 @@ grant execute on &&ut3_owner..ut_reporter_base to public; grant execute on &&ut3_owner..ut_coverage to public; grant execute on &&ut3_owner..ut_coverage_options to public; grant execute on &&ut3_owner..ut_coverage_helper to public; -grant insert, delete, select on &&ut3_owner..ut_coverage_sources_tmp to public; grant execute on &&ut3_owner..ut_output_buffer to public; grant execute on &&ut3_owner..ut_file_mappings to public; grant execute on &&ut3_owner..ut_file_mapping to public; @@ -99,7 +98,6 @@ create public synonym ut_reporter_base for &&ut3_owner..ut_reporter_base; create public synonym ut_coverage for &&ut3_owner..ut_coverage; create public synonym ut_coverage_options for &&ut3_owner..ut_coverage_options; create public synonym ut_coverage_helper for &&ut3_owner..ut_coverage_helper; -create public synonym ut_coverage_sources_tmp for &&ut3_owner..ut_coverage_sources_tmp; create public synonym ut_output_buffer for &&ut3_owner..ut_output_buffer; create public synonym ut_file_mappings for &&ut3_owner..ut_file_mappings; create public synonym ut_file_mapping for &&ut3_owner..ut_file_mapping; diff --git a/source/create_synonyms_and_grants_for_user.sql b/source/create_synonyms_and_grants_for_user.sql index 5116710c8..e7f72270f 100644 --- a/source/create_synonyms_and_grants_for_user.sql +++ b/source/create_synonyms_and_grants_for_user.sql @@ -79,7 +79,6 @@ grant execute on &&ut3_owner..ut_reporter_base to &ut3_user; grant execute on &&ut3_owner..ut_coverage to &ut3_user; grant execute on &&ut3_owner..ut_coverage_options to &ut3_user; grant execute on &&ut3_owner..ut_coverage_helper to &ut3_user; -grant insert, delete, select on &&ut3_owner..ut_coverage_sources_tmp to &ut3_user; grant execute on &&ut3_owner..ut_output_buffer to &ut3_user; grant execute on &&ut3_owner..ut_file_mappings to &ut3_user; grant execute on &&ut3_owner..ut_file_mapping to &ut3_user; @@ -119,7 +118,6 @@ create or replace synonym &ut3_user..ut_reporter_base for &&ut3_owner..ut_report create or replace synonym &ut3_user..ut_coverage for &&ut3_owner..ut_coverage; create or replace synonym &ut3_user..ut_coverage_options for &&ut3_owner..ut_coverage_options; create or replace synonym &ut3_user..ut_coverage_helper for &&ut3_owner..ut_coverage_helper; -create or replace synonym &ut3_user..ut_coverage_sources_tmp for &&ut3_owner..ut_coverage_sources_tmp; create or replace synonym &ut3_user..ut_output_buffer for &&ut3_owner..ut_output_buffer; create or replace synonym &ut3_user..ut_file_mappings for &&ut3_owner..ut_file_mappings; create or replace synonym &ut3_user..ut_file_mapping for &&ut3_owner..ut_file_mapping; diff --git a/source/reporters/ut_coverage_report_html_helper.pkb b/source/reporters/ut_coverage_report_html_helper.pkb index a69b4a1f6..66fb5c200 100644 --- a/source/reporters/ut_coverage_report_html_helper.pkb +++ b/source/reporters/ut_coverage_report_html_helper.pkb @@ -95,11 +95,10 @@ create or replace package body ut_coverage_report_html_helper is end; function get_details_file_content(a_object_id varchar2, a_unit ut_object_name, a_unit_coverage ut_coverage.t_unit_coverage) return clob is - type tt_source_data is table of varchar2(32767); - l_source_code tt_source_data; + l_source_code ut_varchar2_list; l_result clob; - function build_details_file_content(a_object_id varchar2, a_object_full_name varchar2, a_source_code tt_source_data, a_coverage_unit ut_coverage.t_unit_coverage ) return clob is + function build_details_file_content(a_object_id varchar2, a_object_full_name varchar2, a_source_code ut_varchar2_list, a_coverage_unit ut_coverage.t_unit_coverage ) return clob is l_file_part varchar2(32767); l_result clob; l_coverage_pct number(5,2); @@ -138,12 +137,7 @@ create or replace package body ut_coverage_report_html_helper is return l_result; end; begin - select rtrim(s.text,chr(10)) text - bulk collect into l_source_code - from ut_coverage_sources_tmp s - where s.owner = a_unit.owner - and s.name = a_unit.name - order by s.line; + l_source_code := ut_coverage_helper.get_tmp_table_object_lines(a_unit.owner, a_unit.name); dbms_lob.createtemporary(l_result,true); l_result := build_details_file_content(a_object_id, a_unit.identity, l_source_code, a_unit_coverage); return l_result; diff --git a/test/ut_suite_manager/test_suite_manager.pks b/test/ut_suite_manager/test_suite_manager.pks index b2114c9da..6e9322214 100644 --- a/test/ut_suite_manager/test_suite_manager.pks +++ b/test/ut_suite_manager/test_suite_manager.pks @@ -1,134 +1,134 @@ create or replace package test_suite_manager is --%suite(suite_manager) - --%suitepath(ut_plsql.core) - + --%suitepath(utplsql.core) + --%beforeall procedure compile_dummy_packages; --%afterall procedure drop_dummy_packages; - + --%test(Prepare Runner For The Schema) procedure test_schema_run; - + --%test(Prepare runner for the top 2 package by package user.package_name) procedure test_top2_by_name; - + --%test(Prepare runner for the top2 package by name cur user) procedure test_top2_bt_name_cur_user; - + --%test(Prepare runner for the subsuite by path) procedure test_by_path_to_subsuite; - --%test(Prepare runner for the subsuite by path for current user) + --%test(Prepare runner for the subsuite by path for current user) procedure test_by_path_to_subsuite_cu; - + --%test(Prepare runner for the subsuite proc only by path) procedure test_subsute_proc_by_path; - - --%test(Prepare runner for the subsuite proc only by path for current user) - procedure test_subsute_proc_by_path_cu; - + + --%test(Prepare runner for the subsuite proc only by path for current user) + procedure test_subsute_proc_by_path_cu; + --%test(Prepare runner for the top package by package name) procedure test_top_pack_by_name; - + --%test(Prepare runner for the top package by package name for current user) procedure test_top_pack_by_name_cu; - + --%test(Prepare runner for the top package by path) procedure test_top_pack_by_path; - + --%test(Prepare runner for the top package by path for current user) procedure test_top_pack_by_path_cu; - + --%test(Prepare runner for the top package procedure by path) procedure test_top_pck_proc_by_path; - + --%test(Prepare runner for the top package procedure by path for current user) procedure test_top_pck_proc_by_path_cu; - + --%test(Prepare runner for the top package procedure without sub-suites by package name) procedure test_top_pkc_proc_by_name; - + --%test(Prepare runner for the top package procedure without sub-suites by package name for current user) procedure test_top_pkc_proc_by_name_cu; - + --%test(Prepare runner for the top package without sub-suites by package name) procedure test_top_pkc_nosub_by_name; - + --%test(Prepare runner for the top package without sub-suites by package name for current user) procedure test_top_pkc_nosub_by_name_cu; - + --%test(Prepare runner for the suites package by path) procedure test_top_subpck_by_path; - + --%test(Prepare runner for the suites package by path for current user) procedure test_top_subpck_by_path_cu; - + --%test(Prepare runner for invalid package) --%beforetest(compile_invalid_package) --%aftertest(drop_invalid_package) procedure test_search_invalid_pck; procedure compile_invalid_package; procedure drop_invalid_package; - + --%test(Test description with comma) --%beforetest(setup_desc_with_comma) - --%aftertest(clean_desc_with_comma) + --%aftertest(clean_desc_with_comma) procedure test_desc_with_comma; procedure setup_desc_with_comma; procedure clean_desc_with_comma; - + --%test(Invalidate cache on package drop) --%beforetest(setup_inv_cache_on_drop) - --%aftertest(clean_inv_cache_on_drop) + --%aftertest(clean_inv_cache_on_drop) procedure test_inv_cache_on_drop; procedure setup_inv_cache_on_drop; procedure clean_inv_cache_on_drop; --%test(Includes Invalid Package Bodies In The Run) --%beforetest(setup_inv_pck_bodies) - --%aftertest(clean_inv_pck_bodies) + --%aftertest(clean_inv_pck_bodies) procedure test_inv_pck_bodies; procedure setup_inv_pck_bodies; procedure clean_inv_pck_bodies; - + --%test(Package With Dollar Sign) --%beforetest(setup_pck_with_dollar) - --%aftertest(clean_pck_with_dollar) + --%aftertest(clean_pck_with_dollar) procedure test_pck_with_dollar; procedure setup_pck_with_dollar; procedure clean_pck_with_dollar; - + --%test(Package With Hash Sign) --%beforetest(setup_pck_with_hash) - --%aftertest(clean_pck_with_hash) + --%aftertest(clean_pck_with_hash) procedure test_pck_with_hash; procedure setup_pck_with_hash; procedure clean_pck_with_hash; - + --%test(Package with test with dollar sign) --%beforetest(setup_test_with_dollar) - --%aftertest(clean_test_with_dollar) + --%aftertest(clean_test_with_dollar) procedure test_test_with_dollar; procedure setup_test_with_dollar; procedure clean_test_with_dollar; - + --%test(Package with test with hash sign) --%beforetest(setup_test_with_hash) - --%aftertest(clean_test_with_hash) + --%aftertest(clean_test_with_hash) procedure test_test_with_hash; procedure setup_test_with_hash; procedure clean_test_with_hash; - - + + --%test(Setup suite with empty suitepath) --%beforetest(setup_empty_suite_path) - --%aftertest(clean_empty_suite_path) + --%aftertest(clean_empty_suite_path) procedure test_empty_suite_path; procedure setup_empty_suite_path; procedure clean_empty_suite_path; - + --%test --%disabled --procedure IncludesPackagesWithSutePath; From 8badb71c58fd2da3bc6f1d6da3324eb945cf1504 Mon Sep 17 00:00:00 2001 From: Jacek Date: Thu, 17 Aug 2017 08:19:32 +0100 Subject: [PATCH 41/42] Fixed failing test after rename of `tests` to `old_tests`. --- .../ut.expect.to_equal.cursor.worksOnLargeDatasets.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {tests => old_tests}/ut_expectations/ut.expect.to_equal.cursor.worksOnLargeDatasets.sql (100%) diff --git a/tests/ut_expectations/ut.expect.to_equal.cursor.worksOnLargeDatasets.sql b/old_tests/ut_expectations/ut.expect.to_equal.cursor.worksOnLargeDatasets.sql similarity index 100% rename from tests/ut_expectations/ut.expect.to_equal.cursor.worksOnLargeDatasets.sql rename to old_tests/ut_expectations/ut.expect.to_equal.cursor.worksOnLargeDatasets.sql From ff9865a9a39375e34d9e8867fbb5f72aa4872242 Mon Sep 17 00:00:00 2001 From: Jacek Date: Fri, 18 Aug 2017 20:13:49 +0100 Subject: [PATCH 42/42] Moved new test to the old_tests --- ...ckage_annotations.ParseProcedureAnnotationWithVeryLongName.sql | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {tests => old_tests}/ut_annotations/ut_annotations.parse_package_annotations.ParseProcedureAnnotationWithVeryLongName.sql (100%) diff --git a/tests/ut_annotations/ut_annotations.parse_package_annotations.ParseProcedureAnnotationWithVeryLongName.sql b/old_tests/ut_annotations/ut_annotations.parse_package_annotations.ParseProcedureAnnotationWithVeryLongName.sql similarity index 100% rename from tests/ut_annotations/ut_annotations.parse_package_annotations.ParseProcedureAnnotationWithVeryLongName.sql rename to old_tests/ut_annotations/ut_annotations.parse_package_annotations.ParseProcedureAnnotationWithVeryLongName.sql