← 输入框|github.com|刷新
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ before_script:
script:
- if [[ ! $TRAVIS_TAG ]]; then bash test/install_and_run_tests.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/validate_report_files.sh; fi
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then bash .travis/run_sonar_scanner.sh; fi
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "${TRAVIS_PULL_REQUEST_SLUG}" = "${TRAVIS_REPO_SLUG}" ]; then bash .travis/run_sonar_scanner.sh; fi
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/coveralls_uploader.sh; fi

notifications:
Expand Down
4 changes: 2 additions & 2 deletions source/create_synonyms_and_grants_for_public.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ grant execute on &&ut3_owner..ut_file_mapping to public;
grant execute on &&ut3_owner..ut_file_mapper to public;
grant execute on &&ut3_owner..ut_key_value_pairs to public;
grant execute on &&ut3_owner..ut_key_value_pair to public;
grant select, insert, delete on &&ut3_owner..ut_compound_data_tmp to public;
grant select, insert, delete on &&ut3_owner..ut_compound_data_diff_tmp to public;
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_tmp to public;
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_diff_tmp to public;
grant execute on &&ut3_owner..ut_sonar_test_reporter to public;
grant execute on &&ut3_owner..ut_annotations to public;
grant execute on &&ut3_owner..ut_annotation to public;
Expand Down
4 changes: 2 additions & 2 deletions source/create_user_grants.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ grant execute on &&ut3_owner..ut_file_mapping to &ut3_user;
grant execute on &&ut3_owner..ut_file_mapper to &ut3_user;
grant execute on &&ut3_owner..ut_key_value_pairs to &ut3_user;
grant execute on &&ut3_owner..ut_key_value_pair to &ut3_user;
grant select, insert, delete on &&ut3_owner..ut_compound_data_tmp to &ut3_user;
grant select, insert, delete on &&ut3_owner..ut_compound_data_diff_tmp to &ut3_user;
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_tmp to &ut3_user;
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_diff_tmp to &ut3_user;
grant execute on &&ut3_owner..ut_sonar_test_reporter to &ut3_user;
grant execute on &&ut3_owner..ut_annotations to &ut3_user;
grant execute on &&ut3_owner..ut_annotation to &ut3_user;
Expand Down
2 changes: 1 addition & 1 deletion test/api/test_ut_run.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ create or replace package body test_ut_run is
failing_stateful_test [% sec] (FAILED - 1)%
Failures:%
1) failing_stateful_test
ORA-04068: existing state of packages (DB_LOOPBACK) has been discarded
ORA-04068: existing state of packages (DB_LOOPBACK%) has been discarded
ORA-04061: existing state of package body "UT3_TESTER.STATEFUL_PACKAGE" has been invalidated
ORA-04065: not executed, altered or dropped package body "UT3_TESTER.STATEFUL_PACKAGE"%
ORA-06512: at line 6%
Expand Down
40 changes: 20 additions & 20 deletions test/core/annotations/test_annot_throws_exception.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -240,43 +240,43 @@ is

procedure throws_same_annotated_except is
begin
ut.expect(g_tests_results).to_match('^\s*Throws same annotated exception \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Throws same annotated exception \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('raised_same_exception');
end;

procedure throws_one_of_annotated_excpt is
begin
ut.expect(g_tests_results).to_match('^\s*Throws one of the listed exceptions \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Throws one of the listed exceptions \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('raised_one_listed_exception');
end;

procedure throws_with_leading_zero is
begin
ut.expect(g_tests_results).to_match('^\s*Leading zero is ignored in exception list \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Leading zero is ignored in exception list \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('leading_0_exception_no');
end;

procedure throws_diff_annotated_except is
begin
ut.expect(g_tests_results).to_match('^\s*Throws diff exception \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Throws diff exception \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('raised_diff_exception\s+Actual: -20143 was expected to equal: -20144\s+ORA-20143: Test error\s+ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"');
end;

procedure throws_empty is
begin
ut.expect(g_tests_results).to_match('^\s*Throws empty \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Throws empty \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('empty_throws\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"');
end;

procedure bad_paramters_with_except is
begin
ut.expect(g_tests_results).to_match('^\s*Ignores annotation and fails when exception was thrown \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Ignores annotation and fails when exception was thrown \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('bad_paramters_with_except\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"');
end;

procedure bad_paramters_without_except is
begin
ut.expect(g_tests_results).to_match('^\s*Ignores annotation and succeeds when no exception thrown \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Ignores annotation and succeeds when no exception thrown \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('bad_paramters_without_except');
end;

Expand All @@ -288,79 +288,79 @@ is

procedure nothing_thrown is
begin
ut.expect(g_tests_results).to_match('^\s*Gives failure when a exception is expected and nothing is thrown \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Gives failure when a exception is expected and nothing is thrown \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('nothing_thrown\s*Expected one of exceptions \(-20459, -20136, -20145\) but nothing was raised.');
end;

procedure single_exc_const_pkg is
begin
ut.expect(g_tests_results).to_match('^\s*Single exception defined as a constant number in package \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Single exception defined as a constant number in package \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('single_exc_const_pkg');
end;

procedure list_of_exc_constant is
begin
ut.expect(g_tests_results).to_match('^\s*Gives success when one of annotated exception using constant is thrown \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Gives success when one of annotated exception using constant is thrown \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('list_of_exc_constant');
end;

procedure fail_not_match_exc is
begin
ut.expect(g_tests_results).to_match('^\s*Gives failure when the raised exception is different that the annotated one using variable \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Gives failure when the raised exception is different that the annotated one using variable \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('fail_not_match_exc\s+Actual: -1403 was expected to equal: -20204\s+ORA-01403: no data found\s+ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"');
end;

procedure mixed_exc_list is
begin
ut.expect(g_tests_results).to_match('^\s*Success when one of exception from mixed list of number and constant is thrown \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Success when one of exception from mixed list of number and constant is thrown \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('mixed_exc_list');
end;

procedure mixed_list_notexi is
begin
ut.expect(g_tests_results).to_match('^\s*Success when match exception even if other variable on list dont exists \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Success when match exception even if other variable on list dont exists \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('mixed_list_notexi');
end;

procedure named_exc_pragma is
begin
ut.expect(g_tests_results).to_match('^\s*Success resolve and match named exception defined in pragma exception init \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Success resolve and match named exception defined in pragma exception init \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('mixed_list_notexi');
end;

procedure named_exc_ora is
begin
ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('named_exc_ora');
end;

procedure named_exc_ora_dup_ind is
begin
ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception dup val index \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Success resolve and match oracle named exception dup val index \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('named_exc_ora_dup_ind');
end;

procedure nodata_exc_ora is
begin
ut.expect(g_tests_results).to_match('^\s*Success map no data 100 to -1403 \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Success map no data 100 to -1403 \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('nodata_exc_ora');
end;

procedure defined_varchar_exc is
begin
ut.expect(g_tests_results).to_match('^\s*Success for exception defined as varchar \[[\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Success for exception defined as varchar \[[,\.0-9]+ sec\]\s*$','m');
ut.expect(g_tests_results).not_to_match('defined_varchar_exc');
end;

procedure non_existing_const is
begin
ut.expect(g_tests_results).to_match('^\s*Non existing constant exception \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Non existing constant exception \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('non_existing_const\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"');
end;

procedure bad_exc_const is
begin
ut.expect(g_tests_results).to_match('^\s*Bad exception constant \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('^\s*Bad exception constant \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
ut.expect(g_tests_results).to_match('bad_exc_const\s*ORA-20143: Test error\s*ORA-06512: at "UT3_TESTER.ANNOTATED_PACKAGE_WITH_THROWS"');
end;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ create or replace package body test_before_after_annotations is
ut.expect(l_actual).to_be_empty;

ut.expect(g_tests_results).to_match(
'^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[\.0-9]+ sec\] \(FAILED - 1\)\s*$'
'^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[,\.0-9]+ sec\] \(FAILED - 1\)\s*$'
,'m'
);
ut.expect(g_tests_results).to_match(
Expand All @@ -297,7 +297,7 @@ create or replace package body test_before_after_annotations is
ut.expect(l_actual).to_be_empty;

ut.expect(g_tests_results).to_match(
'^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[\.0-9]+ sec\] \(FAILED - 1\)\s*$'
'^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[,\.0-9]+ sec\] \(FAILED - 1\)\s*$'
,'m'
);
ut.expect(g_tests_results).to_match(
Expand Down
2 changes: 1 addition & 1 deletion test/core/reporters/test_junit_reporter.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ create or replace package body test_junit_reporter as
l_nls_numeric_characters varchar2(30);
begin
--Arrange
select nsp.value into l_nls_numeric_characters
select replace(nsp.value,'''','''''') into l_nls_numeric_characters
from nls_session_parameters nsp
where parameter = 'NLS_NUMERIC_CHARACTERS';
execute immediate q'[alter session set NLS_NUMERIC_CHARACTERS=', ']';
Expand Down
2 changes: 1 addition & 1 deletion test/core/reporters/test_tfs_junit_reporter.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ create or replace package body test_tfs_junit_reporter as
l_nls_numeric_characters varchar2(30);
begin
--Arrange
select nsp.value into l_nls_numeric_characters
select replace(nsp.value,'''','''''') into l_nls_numeric_characters
from nls_session_parameters nsp
where parameter = 'NLS_NUMERIC_CHARACTERS';
execute immediate q'[alter session set NLS_NUMERIC_CHARACTERS=', ']';
Expand Down
4 changes: 2 additions & 2 deletions test/install_tests.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ alter session set plsql_optimize_level=0;
@@core/test_ut_test.pks
@@core/annotations/test_annotation_parser.pks
@@core/annotations/test_annotation_manager.pks
@@core/annotations/test_before_after_test_annotation.pks
@@core/annotations/test_before_after_annotations.pks
@@core/expectations/test_expectation_processor.pks
@@core/expectations/test_matchers.pks
@@core/test_output_buffer.pks
Expand Down Expand Up @@ -74,7 +74,7 @@ set define off
@@core/annotations/test_annotation_manager.pkb
@@core/expectations/test_expectation_processor.pkb
@@core/expectations/test_matchers.pkb
@@core/annotations/test_before_after_test_annotation.pkb
@@core/annotations/test_before_after_annotations.pkb
@@core/test_output_buffer.pkb
@@core/test_file_mapper.pkb
@@core/test_suite_manager.pkb
Expand Down