Toad World® Forums

How can I test multiple branches of code within the same test definition?


#1

A Code Tester user sent me this question:

I have a package that I am developing and want to test. Currently, there are two separate features that are being added to the package independent of each other, so I have two branches of the package. We’ll call them branches A and B. I created test cases in Quest for branch A and everything worked fine. Later, I loaded branch B and tried to deactivate the branch A’s test cases (the functionality doesn’t exist in branch B). When I try to compile the test cases it fails. I can reload branch A’s package and recompile the test cases and everything works fine, so I know it isn’t failing due to incorrectly constructed test cases. I have tried to de-activate branch A’s test cases at the method level and at the individual test case level, but it still fails to compile.

Please let me know if there is another way I can approach this. I need to be able to apply different branches of a package and de-activate the non-applicable test cases.


#2

Seth -

I am having trouble reproducing your issue. Here is what I did:

  1. I create this package:

CREATE OR REPLACE PACKAGE package_test
IS
PROCEDURE a;
END;
/

CREATE OR REPLACE PACKAGE BODY package_test
IS
PROCEDURE a
IS
BEGIN
NULL;
END;
END;
/

  1. I build a test definition and run the test. Success.

  2. I then override that package with this one:

CREATE OR REPLACE PACKAGE package_test
IS
PROCEDURE b;
END;
/

CREATE OR REPLACE PACKAGE BODY package_test
IS
PROCEDURE b
IS
BEGIN
NULL;
END;
END;
/

  1. I open the test definition in the Test Editor. I deactivate the A unit test. I go into Test Builder, add a test case, run the test, everything is fine.

What precisely are the steps that YOU are taking?

Thanks, SF


#3

Hi Steven

We have moved up to commercial version 1.6.1.212 and everything seems to be working correctly. The earlier experimenting was conducted using trial version 1.6.0.182. We are no longer using that version, so I was unable to reproduce the problem. Regardless, the current version seems to work wonderfully.

Thank you for your help, Seth