Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with values from a table #70

Open
angoca opened this issue Oct 2, 2014 · 1 comment
Open

Test with values from a table #70

angoca opened this issue Oct 2, 2014 · 1 comment
Milestone

Comments

@angoca
Copy link
Owner

angoca commented Oct 2, 2014

There could be a second type of tests that receives the values from a table. This allows to reuse the same tests with multiple values.

The test should receive a number as parameter (IN). That is the difference with the other test, the current one, which do not receives any parameter.

The framework will identify the type of test, and if the test receives parameters, it will look for a table with the same name in the same schema (same suite name). Then, it will initialize a global variable with the row number (how? rowid? rid?), and then the framework passes this value to the procedure.

The test procedure will then initialize, and call a function that retrieves the values from a table, via a getNextValue. These getNext should be according to the datatype to retrieve (getNextInt, getNextString, getNextDatatype), and they receive the rownumber as parameter. This is not efficient because the table will be accessed many times, however values tables are not that big. The values returned by these functions will be assigned to local variables in the test proc, and they will be used to call the asserts.

It is responsibility of the developer to create the table with the same name as the procedure. The data types of the columns and order should be the same as the getNext function calls in the tests.

This feature was takes from utPLSQL.

@angoca angoca added this to the Version 2 milestone Oct 2, 2014
@angoca
Copy link
Owner Author

angoca commented Nov 22, 2014

The name of the table that contains the values has the same name of the test. This makes easier the match between tables and tests.

CREATE PROCEDURE TESTS.TEST_MY_TEST() ...@
CREATE TABLE TESTS.TEST_MY_TEST(...)@

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant