Menu

#4 Setup/Teardown Behavior Incorrect

Closed-Fixed
utPLSQL (6)
2.2
Medium
[unknown]
2013-10-12
2001-11-19
No

In the normal xUnit frameworks (JUnit as an example), the setup and teardown methods
are executed for each individual test method of a test class. I have verified that in
2.0.6 and 2.0.7, the setup and teardown procedures of utPLSQL are called only once
for the execution of all the test functions/procedures in a whole test package. Since
the typical use pattern is to write multiple test methods per method being tested and
to require that tests be independent of each other, utPLSQL should operate like the
other xUnit products. Otherwise, I would have to write multiple test packages, each
with only a single method for each and every function/procedure in a target package.
Part of the problem with executing the setup/teardown is that this can cause serious
dependence on the order of execution of the test functions/procedures. I would be
forced to essentially put setup/teardown code in each of my test functions/procedures
if I wanted to actually have test independence, therefore, rendering the current
setup/teardown procedures useless. This is what I'm having to do at the current time.

Related

Bugs Archive (Use GitHub now): #33

Discussion

  • Steven Feuerstein

    • status: open --> open-fixed
     
  • Steven Feuerstein

    Logged In: YES
    user_id=30290

    Changed from bug to enhancement

     
  • Paul Walker

    Paul Walker - 2013-07-30

    The status of this ticket is "open-fixed". Does that mean it is fixed in CVS?

     
  • Paul Walker

    Paul Walker - 2013-08-12

    This was added in a subsequent version (note that you can use the parameter in the test, run, testsuite and runsuite procedures). From the release notes:

    utPLSQL version 2.0.8.1

    Implements a new features in utPLSQL.test that allows you to specify that you want to run the setup and teardown procedures before and after EACH unit test procedure, as opposed to running them once for the unit test package as a whole. To utilize this feature, simply pass a value of TRUE to the new per_method_setup_in parameter of utPLSQL.test as shown below:

    SQL> exec utplsql.test ('str', per_method_setup_in => true)
    
     

    Last edit: Paul Walker 2013-08-12
  • Paul Walker

    Paul Walker - 2013-08-12
    • assigned_to: Paul Walker
     
  • Paul Walker

    Paul Walker - 2013-10-12
    • status: open-fixed --> Closed-Fixed
    • Fixed in version: --> 2.0.8.1
    • Seen in version: --> 2.2
    • Priority: 5 --> Medium
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.