-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from MarketSquare/parse-script-improvements
Fix #184 Parse script improvements
- Loading branch information
Showing
9 changed files
with
203 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
*** Settings *** | ||
Documentation Tests for the parameter _omitTrailingSemicolon_ in the keyword | ||
... _Execute SQL String_ - special for the issue #184: | ||
... https://github.com/MarketSquare/Robotframework-Database-Library/issues/184 | ||
... The _PLSQL BLOCK_ is most likely valid for Oracle DB only. | ||
Resource ../../resources/common.resource | ||
Suite Setup Connect To DB | ||
Suite Teardown Disconnect From Database | ||
Test Setup Create Person Table And Insert Data | ||
Test Teardown Drop Tables Person And Foobar | ||
|
||
|
||
*** Variables *** | ||
${NORMAL QUERY} SELECT * FROM person; | ||
${PLSQL BLOCK} DECLARE ERRCODE NUMBER; ERRMSG VARCHAR2(200); BEGIN DBMS_OUTPUT.PUT_LINE('Hello!'); END; | ||
|
||
|
||
*** Test Cases *** | ||
Explicitely Omit Semicolon | ||
[Documentation] Check if it works for Oracle - explicitely omitting the semicolon | ||
... is equal to the default behaviour, otherwise oracle_db throws an error | ||
Execute Sql String ${NORMAL QUERY} omitTrailingSemicolon=True | ||
|
||
Explicitely Dont't Omit Semicolon | ||
[Documentation] Check if it works for Oracle - it throws an error without a semicolon | ||
Execute Sql String ${PLSQL BLOCK} omitTrailingSemicolon=False |
22 changes: 22 additions & 0 deletions
22
test/tests/custom_db_tests/sql_script_split_commands.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*** Settings *** | ||
Documentation Tests for the parameter _split_ in the keyword | ||
... _Execute SQL Script_ - special for the issue #184: | ||
... https://github.com/MarketSquare/Robotframework-Database-Library/issues/184 | ||
Resource ../../resources/common.resource | ||
Suite Setup Connect To DB | ||
Suite Teardown Disconnect From Database | ||
Test Setup Create Person Table | ||
Test Teardown Drop Tables Person And Foobar | ||
|
||
|
||
*** Test Cases *** | ||
Split Commands | ||
[Documentation] Such a simple script works always, | ||
... just check if the logs if the parameter value was processed properly | ||
Execute Sql Script ${CURDIR}/../../resources/insert_data_in_person_table.sql split=True | ||
|
||
Don't Split Commands | ||
[Documentation] Running such a script as a single statement works for PostgreSQL, | ||
... but fails in Oracle. Check in the logs if the splitting was disabled. | ||
Execute Sql Script ${CURDIR}/../../resources/insert_data_in_person_table.sql split=False |