From a5f33c1c8b56699aa2fdea6ac76f5b5b4309ded6 Mon Sep 17 00:00:00 2001 From: Walter Alexis Castro Date: Mon, 7 May 2018 15:39:46 -0600 Subject: [PATCH] Fixed the errors with timestamp in tests --- .../get_lines.WaitsForMoreDataToAppearForSpecifiedTime.sql | 4 ++-- .../get_lines.WaitsForTheDataToAppearForSpecifiedTime.sql | 4 ++-- test/api/test_ut_run.pkb | 3 ++- test/core/test_output_buffer.pkb | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/old_tests/ut_output_buffer/get_lines.WaitsForMoreDataToAppearForSpecifiedTime.sql b/old_tests/ut_output_buffer/get_lines.WaitsForMoreDataToAppearForSpecifiedTime.sql index c8f343492..24284f38b 100644 --- a/old_tests/ut_output_buffer/get_lines.WaitsForMoreDataToAppearForSpecifiedTime.sql +++ b/old_tests/ut_output_buffer/get_lines.WaitsForMoreDataToAppearForSpecifiedTime.sql @@ -3,14 +3,14 @@ declare l_result integer; l_dummy integer; l_output ut_output_buffer_base := ut_output_table_buffer(); - l_start_time timestamp := systimestamp; + l_start_time timestamp := localtimestamp; l_wait_seconds integer := 1; begin --Act l_output.send_line(lpad('a text',4000,',a text')); select count(*) into l_dummy from table( l_output.get_lines( a_initial_timeout => 0, a_timeout_sec => l_wait_seconds )); - l_result := round(extract(second from (systimestamp - l_start_time))); + l_result := round(extract(second from (localtimestamp - l_start_time))); --Assert ut.expect(l_result).to_equal(l_wait_seconds); diff --git a/old_tests/ut_output_buffer/get_lines.WaitsForTheDataToAppearForSpecifiedTime.sql b/old_tests/ut_output_buffer/get_lines.WaitsForTheDataToAppearForSpecifiedTime.sql index 037f6db9b..20bf4ca6c 100644 --- a/old_tests/ut_output_buffer/get_lines.WaitsForTheDataToAppearForSpecifiedTime.sql +++ b/old_tests/ut_output_buffer/get_lines.WaitsForTheDataToAppearForSpecifiedTime.sql @@ -3,12 +3,12 @@ declare l_result integer; l_dummy integer; l_output ut_output_buffer_base := ut_output_table_buffer(); - l_start_time timestamp := systimestamp; + l_start_time timestamp := localtimestamp; l_wait_seconds integer := 1; begin --Act select count(1) into l_dummy from table( l_output.get_lines( a_initial_timeout => l_wait_seconds, a_timeout_sec => 0 )); - l_result := round(extract(second from (systimestamp - l_start_time))); + l_result := round(extract(second from (localtimestamp - l_start_time))); --Assert ut.expect(l_result).to_equal(l_wait_seconds); diff --git a/test/api/test_ut_run.pkb b/test/api/test_ut_run.pkb index 503239307..dfd4a529b 100644 --- a/test/api/test_ut_run.pkb +++ b/test/api/test_ut_run.pkb @@ -60,7 +60,7 @@ create or replace package body test_ut_run is g_state varchar2(3) := 'abc'; end;]'; end;/', - start_date => sysdate, + start_date => localtimestamp, enabled => TRUE, auto_drop => TRUE, comments => 'one-time job' @@ -98,6 +98,7 @@ Failures:% --Act select * bulk collect into l_results from table(ut3.ut.run('test_stateful')); + --Assert ut.fail('Expected exception but nothing was raised'); exception diff --git a/test/core/test_output_buffer.pkb b/test/core/test_output_buffer.pkb index 7d60c5213..051293c60 100644 --- a/test/core/test_output_buffer.pkb +++ b/test/core/test_output_buffer.pkb @@ -55,9 +55,9 @@ create or replace package body test_output_buffer is --Act l_expected := lpad('a text',4000,',a text'); l_buffer.send_line(l_expected); - l_start := systimestamp; + l_start := localtimestamp; select * into l_result from table(l_buffer.get_lines(1,1)); - l_duration := systimestamp - l_start; + l_duration := localtimestamp - l_start; ut.expect(l_result).to_equal(l_expected); ut.expect(l_duration).to_be_greater_than(interval '1' second);