views:

125

answers:

2

Hi, does anybody have any experience writing unit tests for sql server 2000 DTS packages? I about to start working with DTS and jobs, so I want to be able to unit test as much as possible. I guess i could invoke dtsrun.exe via command line , but perhaps someone else has better ideas.

Thanks

Fede

+1  A: 

I came here looking for insight but since no one else has given you ideas, I did come up with one that I will share.

In my case (I know not all cases), we use a lot of ActiveX (VBScript) scripts to accomplish things. I'm theorizing (I've not tried this) that, if I move my ActiveX functionality to VBScript classes that I can unit test those classes and etc. and then do very, very basic class instantiation and usage in the main function of the ActiveX script.

I've not tried to implement this; my project does not have the budget to do so. But, in theory it seems sound. I also am unaware of any challenges this may cause.

Please see another question I posted here. The question is loosely related to yours. The answer I selected for this question doesn't fit your scenario. You'd be more interested in Michal's answer: Creating unit tests for your asp application

Frank V
A: 

Saw this question had been here for a while so I'm just throwing some ideas out there...

I'm wondering if you could write some code to use the DTS API to call your packages, then write assertions about those packages in the unit test tool for whatever language you used. For example, you could write your code in C# and use NUnit.

Additionally, if your DTS packages are all just calling SQL stored procedures, you can unit test the procedures (which would be true unit testing) using T-SQL Unit.

If it's higher level (integration) tests you want, then you might also consider hooking FitNesse up to the DTS API.

Not sure if any of this helps, but I hope I've at least given you some ideas.

Paddyslacker