Skip to content

Commit fed5007

Browse files
committed
Added test to confirm that long column names are suported in 3.1.7
Resolves: #952 Added safety check on drop of optional objects. Added safety harness to fail build if any of uninstall steps raises exceptions.
1 parent e5ec54c commit fed5007

File tree

4 files changed

+45
-4
lines changed

4 files changed

+45
-4
lines changed

.travis/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.2$ ]]; then
2323
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
2424
set feedback off
2525
set verify off
26+
whenever sqlerror exit failure rollback
2627
2728
@uninstall_all.sql $UT3_OWNER
2829
whenever sqlerror exit failure rollback

source/uninstall_objects.sql

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
set echo off
2+
set serverout on
3+
declare
4+
procedure drop_if_exists(a_object_type varchar2, a_object_name varchar2) is
5+
l_count integer;
6+
begin
7+
select count(1)
8+
into l_count
9+
from all_objects
10+
where owner = sys_context('USERENV','CURRENT_SCHEMA')
11+
and object_type = a_object_type
12+
and object_name = a_object_name;
13+
if l_count > 0 then
14+
execute immediate 'drop '||a_object_type||' '||a_object_name;
15+
dbms_output.put_line(initcap(a_object_type)||' '||a_object_name||' dropped.');
16+
else
17+
dbms_output.put_line(initcap(a_object_type)||' '||a_object_name||' was not dropped, '||lower(a_object_type)||' does not exist.');
18+
end if;
19+
end;
20+
begin
21+
drop_if_exists('TRIGGER', 'UT_TRIGGER_ANNOTATION_PARSING');
22+
drop_if_exists('SYNONYM','UT3_TRIGGER_ALIVE');
23+
end;
24+
/
125
set echo on
226

3-
drop trigger ut_trigger_annotation_parsing;
4-
5-
drop synonym ut3_trigger_alive;
6-
727
drop synonym be_between;
828

929
drop synonym have_count;

test/ut3_user/expectations/test_expectations_cursor.pkb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2843,5 +2843,22 @@ Check the query and data for errors.';
28432843
ut3.ut.expect(v_actual).to_equal(v_expected).exclude('ID');
28442844
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
28452845
end;
2846+
2847+
procedure compare_long_column_names is
2848+
l_actual sys_refcursor;
2849+
l_expected sys_refcursor;
2850+
begin
2851+
-- populate actual
2852+
open l_actual for
2853+
select rownum as id, '1' some_column_with_a_pretty_long_enough_name from dual;
2854+
2855+
open l_expected for
2856+
select rownum as id, '1' some_column_with_a_pretty_long_enough_name from dual;
2857+
2858+
ut3.ut.expect(l_actual).to_equal(l_expected).include('ID,SOME_COLUMN_WITH_A_PRETTY_LONG_ENOUGH_NAME').join_by('ID');
2859+
--Assert
2860+
ut.expect(ut3_tester_helper.main_helper.get_failed_expectations_num).to_equal(0);
2861+
end;
2862+
28462863
end;
28472864
/

test/ut3_user/expectations/test_expectations_cursor.pks

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,5 +462,8 @@ create or replace package test_expectations_cursor is
462462
--%test( Mixed column order exclusion )
463463
procedure uc_columns_exclude;
464464

465+
--%test(Compares cursors with long column names - Issue #952 )
466+
procedure compare_long_column_names;
467+
465468
end;
466469
/

0 commit comments

Comments
 (0)