Jump to content
shb

issue: can not overwrite setUp and tearDown in SubClasses

Recommended Posts

Why are setUp.vi and tearDown.vi not Dynamic Dispatch VIs? This does not look like xUnit style for me.

 

I would like to create an abstract test class (inheriting TestCase) which containts setUp and tearDown. This would be used by all Test Case Classes which inherit from this class. But this does now work. The VIs are not called when running a TestCase. And they can not be overwritten in a SubClass.

 

I suggest to define setUp.vi and tearDown.vi in the TestCase class as Dynamic Dispatch VIs. This would have the following advantages:

  • Easy creation in a Test Case Class by creating an overwrite VI.
    The VIs in each class are not necessary anymore. (Mine are often unchanged. Therefore I delete them.)
  • setUp.vi and tearDown.vi can be defined in a parent class
    • and they can be overwritten in a subclass

 

Not sure how the transition to the dynamic dispatch VI should be done. When introducing them in TestCase.lvclass, all former test classes are broken. So maybe the new methods should have a different name (set_up.vi, set Up.vi, ...). The implementations in TestCase.lvclass could call the old VIs.

 

The current workaround is to call VI of the parent class in the setUp.vi of the concrete test case. The called VI can be a dynamic dispatch VI.

 

Greetings,

shb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.