Skip to content

Commit 766837e

Browse files
committed
Fixing test dependency on NLS settings.
Fixing test dependency on global_names (for DB links) Fixing missing privs. Resolves #765
1 parent a6e4e6a commit 766837e

9 files changed

+31
-31
lines changed

source/create_synonyms_and_grants_for_public.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ grant execute on &&ut3_owner..ut_file_mapping to public;
7676
grant execute on &&ut3_owner..ut_file_mapper to public;
7777
grant execute on &&ut3_owner..ut_key_value_pairs to public;
7878
grant execute on &&ut3_owner..ut_key_value_pair to public;
79-
grant select, insert, delete on &&ut3_owner..ut_compound_data_tmp to public;
80-
grant select, insert, delete on &&ut3_owner..ut_compound_data_diff_tmp to public;
79+
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_tmp to public;
80+
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_diff_tmp to public;
8181
grant execute on &&ut3_owner..ut_sonar_test_reporter to public;
8282
grant execute on &&ut3_owner..ut_annotations to public;
8383
grant execute on &&ut3_owner..ut_annotation to public;

source/create_user_grants.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ grant execute on &&ut3_owner..ut_file_mapping to &ut3_user;
9696
grant execute on &&ut3_owner..ut_file_mapper to &ut3_user;
9797
grant execute on &&ut3_owner..ut_key_value_pairs to &ut3_user;
9898
grant execute on &&ut3_owner..ut_key_value_pair to &ut3_user;
99-
grant select, insert, delete on &&ut3_owner..ut_compound_data_tmp to &ut3_user;
100-
grant select, insert, delete on &&ut3_owner..ut_compound_data_diff_tmp to &ut3_user;
99+
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_tmp to &ut3_user;
100+
grant select, insert, update, delete on &&ut3_owner..ut_compound_data_diff_tmp to &ut3_user;
101101
grant execute on &&ut3_owner..ut_sonar_test_reporter to &ut3_user;
102102
grant execute on &&ut3_owner..ut_annotations to &ut3_user;
103103
grant execute on &&ut3_owner..ut_annotation to &ut3_user;

test/api/test_ut_run.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ create or replace package body test_ut_run is
589589
failing_stateful_test [% sec] (FAILED - 1)%
590590
Failures:%
591591
1) failing_stateful_test
592-
ORA-04068: existing state of packages (DB_LOOPBACK) has been discarded
592+
ORA-04068: existing state of packages (DB_LOOPBACK%) has been discarded
593593
ORA-04061: existing state of package body "UT3_TESTER.STATEFUL_PACKAGE" has been invalidated
594594
ORA-04065: not executed, altered or dropped package body "UT3_TESTER.STATEFUL_PACKAGE"%
595595
ORA-06512: at line 6%

test/core/annotations/test_annot_throws_exception.pkb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -240,43 +240,43 @@ is
240240

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

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

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

259259
procedure throws_diff_annotated_except is
260260
begin
261-
ut.expect(g_tests_results).to_match('^\s*Throws diff exception \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
261+
ut.expect(g_tests_results).to_match('^\s*Throws diff exception \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
262262
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"');
263263
end;
264264

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

271271
procedure bad_paramters_with_except is
272272
begin
273-
ut.expect(g_tests_results).to_match('^\s*Ignores annotation and fails when exception was thrown \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
273+
ut.expect(g_tests_results).to_match('^\s*Ignores annotation and fails when exception was thrown \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
274274
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"');
275275
end;
276276

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

@@ -288,79 +288,79 @@ is
288288

289289
procedure nothing_thrown is
290290
begin
291-
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');
291+
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');
292292
ut.expect(g_tests_results).to_match('nothing_thrown\s*Expected one of exceptions \(-20459, -20136, -20145\) but nothing was raised.');
293293
end;
294294

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

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

307307
procedure fail_not_match_exc is
308308
begin
309-
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');
309+
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');
310310
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"');
311311
end;
312312

313313
procedure mixed_exc_list is
314314
begin
315-
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');
315+
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');
316316
ut.expect(g_tests_results).not_to_match('mixed_exc_list');
317317
end;
318318

319319
procedure mixed_list_notexi is
320320
begin
321-
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');
321+
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');
322322
ut.expect(g_tests_results).not_to_match('mixed_list_notexi');
323323
end;
324324

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

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

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

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

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

355355
procedure non_existing_const is
356356
begin
357-
ut.expect(g_tests_results).to_match('^\s*Non existing constant exception \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
357+
ut.expect(g_tests_results).to_match('^\s*Non existing constant exception \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
358358
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"');
359359
end;
360360

361361
procedure bad_exc_const is
362362
begin
363-
ut.expect(g_tests_results).to_match('^\s*Bad exception constant \[[\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
363+
ut.expect(g_tests_results).to_match('^\s*Bad exception constant \[[,\.0-9]+ sec\] \(FAILED - [0-9]+\)\s*$','m');
364364
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"');
365365
end;
366366

test/core/annotations/test_before_after_test_annotation.pkb renamed to test/core/annotations/test_before_after_annotations.pkb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ create or replace package body test_before_after_annotations is
277277
ut.expect(l_actual).to_be_empty;
278278

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

299299
ut.expect(g_tests_results).to_match(
300-
'^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[\.0-9]+ sec\] \(FAILED - 1\)\s*$'
300+
'^\s*Stops execution at first non-existing Beforetest procedure and marks test as errored \[[,\.0-9]+ sec\] \(FAILED - 1\)\s*$'
301301
,'m'
302302
);
303303
ut.expect(g_tests_results).to_match(

test/core/annotations/test_before_after_test_annotation.pks renamed to test/core/annotations/test_before_after_annotations.pks

File renamed without changes.

test/core/reporters/test_junit_reporter.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ create or replace package body test_junit_reporter as
166166
l_nls_numeric_characters varchar2(30);
167167
begin
168168
--Arrange
169-
select nsp.value into l_nls_numeric_characters
169+
select replace(nsp.value,'''','''''') into l_nls_numeric_characters
170170
from nls_session_parameters nsp
171171
where parameter = 'NLS_NUMERIC_CHARACTERS';
172172
execute immediate q'[alter session set NLS_NUMERIC_CHARACTERS=', ']';

test/core/reporters/test_tfs_junit_reporter.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ create or replace package body test_tfs_junit_reporter as
149149
l_nls_numeric_characters varchar2(30);
150150
begin
151151
--Arrange
152-
select nsp.value into l_nls_numeric_characters
152+
select replace(nsp.value,'''','''''') into l_nls_numeric_characters
153153
from nls_session_parameters nsp
154154
where parameter = 'NLS_NUMERIC_CHARACTERS';
155155
execute immediate q'[alter session set NLS_NUMERIC_CHARACTERS=', ']';

test/install_tests.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ alter session set plsql_optimize_level=0;
2323
@@core/test_ut_test.pks
2424
@@core/annotations/test_annotation_parser.pks
2525
@@core/annotations/test_annotation_manager.pks
26-
@@core/annotations/test_before_after_test_annotation.pks
26+
@@core/annotations/test_before_after_annotations.pks
2727
@@core/expectations/test_expectation_processor.pks
2828
@@core/expectations/test_matchers.pks
2929
@@core/test_output_buffer.pks
@@ -74,7 +74,7 @@ set define off
7474
@@core/annotations/test_annotation_manager.pkb
7575
@@core/expectations/test_expectation_processor.pkb
7676
@@core/expectations/test_matchers.pkb
77-
@@core/annotations/test_before_after_test_annotation.pkb
77+
@@core/annotations/test_before_after_annotations.pkb
7878
@@core/test_output_buffer.pkb
7979
@@core/test_file_mapper.pkb
8080
@@core/test_suite_manager.pkb

0 commit comments

Comments
 (0)