Skip to content

Commit

Permalink
New test for error conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan Dunklau committed Oct 5, 2012
1 parent d759365 commit 265df73
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/expected/multicorn_error_test.out
@@ -0,0 +1,19 @@
CREATE EXTENSION multicorn;
-- Test that the wrapper option is required on the server.
CREATE server multicorn_srv foreign data wrapper multicorn;
ERROR: The wrapper parameter is mandatory, specify a valid class name
-- Test that the wrapper option cannot be altered on the table
CREATE server multicorn_srv foreign data wrapper multicorn options (
wrapper 'multicorn.testfdw.TestForeignDataWrapper'
);
CREATE foreign table testmulticorn (
test1 character varying,
test2 character varying
) server multicorn_srv options (
option1 'option1',
wrapper 'multicorn.evilwrapper.EvilDataWrapper'
);
ERROR: Cannot set the wrapper class on the table
HINT: Set it on the server
DROP EXTENSION multicorn cascade;
NOTICE: drop cascades to server multicorn_srv
15 changes: 15 additions & 0 deletions test/sql/multicorn_error_test.sql
@@ -0,0 +1,15 @@
CREATE EXTENSION multicorn;
-- Test that the wrapper option is required on the server.
CREATE server multicorn_srv foreign data wrapper multicorn;
-- Test that the wrapper option cannot be altered on the table
CREATE server multicorn_srv foreign data wrapper multicorn options (
wrapper 'multicorn.testfdw.TestForeignDataWrapper'
);
CREATE foreign table testmulticorn (
test1 character varying,
test2 character varying
) server multicorn_srv options (
option1 'option1',
wrapper 'multicorn.evilwrapper.EvilDataWrapper'
);
DROP EXTENSION multicorn cascade;

0 comments on commit 265df73

Please sign in to comment.