File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,23 +20,26 @@ create or replace package body test_expectations_cursor is
2020 procedure test_cursor_w_temp_table
2121 as
2222 pragma autonomous_transaction;
23- v_expected t_gtt_data_t;
24-
2523 c_expected sys_refcursor;
2624 c_actual sys_refcursor;
2725 begin
28-
29- v_expected(1).value := 'Test-entry';
3026
31- -- insert test-data into temporary table
27+ -- Arrange
3228 execute immediate 'insert into gtt_test_table ( value ) values ( ''Test-entry'' )';
3329
34- -- test
35- open c_expected for select * from table(v_expected);
30+ open c_expected for select 'Test-entry' as value from dual;
3631 open c_actual for 'select * from gtt_test_table';
37-
38- ut.expect( c_actual ).to_equal( a_expected => c_expected );
39-
32+
33+ --Act - execute the expectation on cursor opened on GTT
34+ ut3.ut.expect( c_actual ).to_equal( a_expected => c_expected );
35+
36+ --Assert - check that expectation was executed successfully
37+ ut.expect(ut3.ut_expectation_processor.get_status()).to_equal(ut3.ut_utils.tr_success);
38+
39+ --Cleanup
40+ ut3.ut_expectation_processor.clear_expectations();
41+
42+ rollback;
4043 end;
4144end;
4245/
Original file line number Diff line number Diff line change @@ -11,10 +11,5 @@ create or replace package test_expectations_cursor is
1111 --%beforetest(setup_temp_table_test)
1212 --%aftertest(cleanup_temp_table_test)
1313 procedure test_cursor_w_temp_table;
14-
15- type t_gtt_data_r is record (
16- value varchar2(250)
17- );
18- type t_gtt_data_t is table of t_gtt_data_r index by binary_integer;
1914end;
2015/
You can’t perform that action at this time.
0 commit comments