@@ -972,21 +972,16 @@ Rows: [ 4 differences ]
972972 procedure reports_on_exception_in_cursor
973973 as
974974 l_actual sys_refcursor;
975- l_expected_message varchar2(32767);
976- l_actual_message varchar2(32767);
977975 begin
978976 --Act
979977 open l_actual for select 1/0 as error_column from dual connect by level < 10;
980978 ut3.ut.expect(l_actual).to_be_empty();
981- --Assert
982- --Assert
983- l_expected_message := q'[%SQL exception thrown when fetching data from cursor:%
984- %ORA-01476: divisor is equal to zero%
985- %Check the query and data for errors.]';
986979
987- l_actual_message := ut3.ut_expectation_processor.get_failed_expectations()(1).message;
988- --Assert
989- ut.expect(l_actual_message).to_be_like(l_expected_message);
980+ ut.fail('Expected exception on cursor fetch');
981+ exception
982+ when others then
983+ ut.expect(sqlerrm).to_be_like('%ORA-20218: SQL exception thrown when fetching data from cursor:%
984+ %ORA-01476: divisor is equal to zero%Check the query and data for errors%');
990985 end;
991986
992987 procedure exception_when_closed_cursor
@@ -2531,8 +2526,6 @@ Diff:%
25312526 c_user CONSTANT varchar2(30):= 'TEST_USER';
25322527 v_actual sys_refcursor;
25332528 v_expected sys_refcursor;
2534- l_expected_message varchar2(32767);
2535- l_actual_message varchar2(32767);
25362529 begin
25372530 open v_actual for
25382531 select cast(null as number(10)) as usd_price_amt, c_user as update_id
@@ -2541,36 +2534,30 @@ Diff:%
25412534 select c_price as usd_price_amt, c_user as update_id from dual;
25422535
25432536 ut3.ut.expect(v_actual).to_equal(v_expected);
2544- --Assert
2545- l_expected_message := q'[%ORA-20218: SQL exception thrown when fetching data from cursor:
2546- %ORA-01722: invalid number%
2547- at%ut.expect(v_actual).to_equal(v_expected)%]';
25482537
2549- l_actual_message := ut3_tester_helper.main_helper.get_failed_expectations(1);
2550- --Assert
2551- ut.expect(l_actual_message).to_be_like(l_expected_message);
2538+ ut.fail('Expected exception on cursor fetch');
2539+ exception
2540+ when others then
2541+ ut.expect(sqlerrm).to_be_like('%ORA-20218: SQL exception thrown when fetching data from cursor:%
2542+ %ORA-01722: invalid number%%Check the query and data for errors%');
25522543 end;
25532544
25542545 procedure xml_error_expected is
25552546 v_actual sys_refcursor;
25562547 v_expected sys_refcursor;
2557- l_expected_message varchar2(32767);
2558- l_actual_message varchar2(32767);
25592548 begin
25602549 open v_expected for
25612550 select 1/0 as test from dual;
25622551 open v_actual for
25632552 select 1 as test from dual;
25642553
25652554 ut3.ut.expect(v_actual).to_equal(v_expected);
2566- --Assert
2567- l_expected_message := q'[%ORA-20218: SQL exception thrown when fetching data from cursor:
2568- %ORA-01476: divisor is equal to zero%
2569- %at % ut.expect(v_actual).to_equal(v_expected)%]';
25702555
2571- l_actual_message := ut3_tester_helper.main_helper.get_failed_expectations(1);
2572- --Assert
2573- ut.expect(l_actual_message).to_be_like(l_expected_message);
2556+ ut.fail('Expected exception on cursor fetch');
2557+ exception
2558+ when others then
2559+ ut.expect(sqlerrm).to_be_like('%ORA-20218: SQL exception thrown when fetching data from cursor:%
2560+ %ORA-01476: divisor is equal to zero%Check the query and data for errors%');
25742561 end;
25752562
25762563end;
0 commit comments