Humble Trader

Saturday, September 16, 2006

Warehouse Libraries - lib_util_test.sql

SET SERVEROUTPUT ON SIZE 1000000;

-- Test lib_string:
DECLARE
l_passed BOOLEAN := TRUE;
BEGIN
dbms_output.put_line('-');
dbms_output.put_line('+- FUNCTION lib_util.create_synonyms ' ||
'test start:');
dbms_output.put_line('|');

dbms_output.put_line
('| Test 1: Pass nothing: Test this runs without error.');
dbms_output.put_line
('| Expected result: Procedure runs without error.');
dbms_output.put_line('|');

BEGIN
lib_util.create_synonyms;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('| +----------+');
dbms_output.put_line('| | FAILED |');
l_passed := FALSE;
dbms_output.put_line('| +----------+');
END;

dbms_output.put_line('| +----------+');
dbms_output.put_line('| | PASSED |');
dbms_output.put_line('| +----------+');

dbms_output.put_line('|');
dbms_output.put_line('+- FUNCTION lib_util.create_synonyms ' ||
'test end:');
dbms_output.put_line('-');

dbms_output.put_line('+- FUNCTION lib_util.create_grants ' ||
'test start:');
dbms_output.put_line('|');

dbms_output.put_line
('| Test 1: Pass nothing: Test this runs without error.');
dbms_output.put_line
('| Expected result: Procedure runs without error.');
dbms_output.put_line('|');

BEGIN
lib_util.create_grants;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('| +----------+');
dbms_output.put_line('| | FAILED |');
l_passed := FALSE;
dbms_output.put_line('| +----------+');
END;

dbms_output.put_line('| +----------+');
dbms_output.put_line('| | PASSED |');
dbms_output.put_line('| +----------+');

dbms_output.put_line('|');
dbms_output.put_line('+- FUNCTION lib_util.create_synonyms ' ||
'test end:');

dbms_output.put_line('-');
dbms_output.put_line('- Overall result:');
dbms_output.put_line('-');
dbms_output.put_line('- +----------+');
IF l_passed = TRUE
THEN
dbms_output.put_line('- | PASSED |');
ELSE
dbms_output.put_line('- | FAILED |');
END IF;
dbms_output.put_line('- +----------+');
dbms_output.put_line('-');

END;
/

0 Comments:

Post a Comment

<< Home