Toad World® Forums

Enhancement request


#1

When defining input variables, it would be nice if we could choose a variable.

is there a way of running a function when defining outcomes and test the results of that?

When writing ut_tests, we would often group together common assertions into one big group assertion and repeatedly call that something similar would be nice here.


#2

Try checking the ‘Evaluate as expression’ checkbox in the Input Value popup window.

You should be able to put in any valid sql, pl/sql call to derive the value for your variable at runtime.


#3

You wrote: When defining input variables, it would be nice if we could choose a variable.

I reply: it could be that I am jet lagged (over in Munich) now, but I am not sure what you are looking for here. What do you mean by choose a variable?

You wrote: is there a way of running a function when defining outcomes and test the results of that?

I reply: Could you give me a concrete example of what you want here so I can make sure I understand it clearly?

You wrote: When writing ut_tests, we would often group together common assertions into one big group assertion and repeatedly call that something similar would be nice here.

I reply: When you say assertion, you mean a test of an outcome? Again, could you give me a concrete example of what you want here so I can make sure I understand it clearly?


#4

Variables:

When setting up a test Step 2. Input values lists the parameters and the types
e.g. param1 varchar2
any text I enter will automatically have quotes surrounding it in the final code

I enter the string Nick
generated code is something like my_proc(‘Nick’);

I would like to have the option of enterging GNAME - one of the variables I defined earlier and see code that looks like:
my_proc(GNAME);

grouped assertions
I would often write in ut_plsql something like

proc my_assert(some variables) is
    UTASSERT.EQ('T1',SOMETHING, X);
     UTASSERT.EQ('T2',SOMETHING ELSE AGAIN, Y);
     UTASSERT.EQ('T3',YET SOMETHING ELSE, Z);
    .....
    .....

end my_assert;

I could build arbitraily complex assertions and reuse them many times.

I guess my question is can I call my own asserts in my own procedures and functions and will any failures be reported up through QCTO?

Thanks

Nick


#5

Nick,

Two answers:

  1. You can certainly pass in variables, in fact any sort of expression, rather than literals. Simply click on the […] button to pull up the Input Properties form and then check the “Evaluate as an expressoin” checkbox in lower left corner. Enter your expression, and you should be all set.

  2. As far as writing your own asserts, you can override our own logic as follows:

  • Open the test editor for your test definition (in other words, you must first create it with the Test Builder).

  • Navigate to the outcome whose logic you want to override.

  • Check the Override generated assertion code checkbox on the Properties form.

  • Then navigate to the Test case, click on the Customization section and enter your override logic in the “-- Custom assertion code” section.

Now having said that, I need to let you know that we are making this process easier in the commercial release, so I would honestly hold off on trying this until then.

Regards, Steven


#6

Thanks for you response, I don’t know how I missed […] button - getting old I guess.