|
| 1 | +create or replace package test_pkg1 is |
| 2 | + |
| 3 | + /* |
| 4 | + This is the correct annotation |
| 5 | + */ |
| 6 | + -- %suite(Name of suite on test_pkg1) |
| 7 | + -- %suitepackage(all.globaltests) |
| 8 | + |
| 9 | + /* |
| 10 | + Such comments are skipped |
| 11 | + |
| 12 | + test name |
| 13 | + %test1 |
| 14 | + %test2(name=123) |
| 15 | + %test3(name2=123,tete=123) |
| 16 | + %test4(name2=123,tete) |
| 17 | + */ |
| 18 | + /* |
| 19 | + This procedure is annotated incorrectly as no correct annotations specified |
| 20 | + Procedure is skipped while suite configuration |
| 21 | + */ |
| 22 | + --test name |
| 23 | + --%test1 |
| 24 | + --%test2(name=123) |
| 25 | + ---- %test3(name2=123,tete=123) |
| 26 | + ---- asd %test4(name2=123,tete) |
| 27 | + -- t3 t4 |
| 28 | + procedure foo; |
| 29 | + |
| 30 | + -- %test(Name of test1) |
| 31 | + -- %testsetup(setup_test1) |
| 32 | + -- %testteardown(teardown_test1) |
| 33 | + procedure test1; |
| 34 | + |
| 35 | + -- %test(Name of test2) |
| 36 | + procedure test2; |
| 37 | + |
| 38 | + -- %suitesetup |
| 39 | + procedure global_setup; |
| 40 | + |
| 41 | + procedure setup_test1; |
| 42 | + |
| 43 | + procedure teardown_test1; |
| 44 | + |
| 45 | + -- %setup |
| 46 | + procedure def_setup; |
| 47 | + |
| 48 | + -- %teardown |
| 49 | + procedure def_teardown; |
| 50 | + |
| 51 | + --%suiteteardown |
| 52 | + procedure global_teardown; |
| 53 | + |
| 54 | +end; |
| 55 | +/ |
| 56 | +create or replace package body test_pkg1 is |
| 57 | + |
| 58 | + g_val1 number; |
| 59 | + g_val2 number; |
| 60 | + |
| 61 | + procedure foo is |
| 62 | + begin |
| 63 | + null; |
| 64 | + end; |
| 65 | + |
| 66 | + procedure test1 is |
| 67 | + begin |
| 68 | + ut_assert.are_equal(a_msg => '1 equals 1 check', a_expected => 1, a_actual => g_val1); |
| 69 | + end; |
| 70 | + |
| 71 | + procedure test2 is |
| 72 | + begin |
| 73 | + --ut_assert.are_equal(a_msg => 'null equals null check', a_expected => to_number(null), a_actual => g_val1); |
| 74 | + ut_assert.are_equal(a_msg => '2 equals 2 check', a_expected => 2, a_actual => g_val2); |
| 75 | + end; |
| 76 | + |
| 77 | + procedure global_setup is |
| 78 | + begin |
| 79 | + dbms_output.put_line('setup procedure of test_pkb1'); |
| 80 | + end; |
| 81 | + |
| 82 | + procedure setup_test1 is |
| 83 | + begin |
| 84 | + g_val1 := 1; |
| 85 | + end; |
| 86 | + |
| 87 | + procedure teardown_test1 is |
| 88 | + begin |
| 89 | + g_val1 := null; |
| 90 | + end; |
| 91 | + |
| 92 | + procedure def_setup is |
| 93 | + begin |
| 94 | + g_val2 := 2; |
| 95 | + end; |
| 96 | + |
| 97 | + procedure def_teardown is |
| 98 | + begin |
| 99 | + g_val2 := null; |
| 100 | + end; |
| 101 | + |
| 102 | + procedure global_teardown is |
| 103 | + begin |
| 104 | + dbms_output.put_line('global teardown procedure of test_pkb1'); |
| 105 | + end; |
| 106 | +end test_pkg1; |
| 107 | +/ |
0 commit comments