Thanks Marisa - You were essentially right. The fit.dll that my
fixture referenced didn't match the one in DbFit/dotnet2.
After a few more gyrations my ExecuteSsisFixture works great now.
Here's a summary of my journey for the benefit of other SQL Server
data warehouse developers:
Alexander Karmanov recommended using DbFit's Execute command with
xp_cmdshell 'dtexec...' There are two problems with this approach:
1. xp_cmdshell cannot handle relative paths to the .dtsx file which
makes your tests very non-portable.
2. Since MSFT is moving toward managed CLR code for SQL Server,
there is some speculation that xp_cmdshell may be deprecated in the
future.
Jan recommended using Bob Martin's CommandLineFixture to launch dtexec
directly. I had the following problems with that (as witnessed by the
threads above):
1. CommandLineFixture is written in Java and DbFit for SQLServer is
in dotNET.
2. I compiled CommandLineFixture.java into a .dll using Visual
Studio's V# compiler, but it didn't work well with the dotNET version
of fit.dll. Not sure why.
3. I started porting the java code to Csharp, but realized that this
was serious overkill for what I was trying to accomplish.
In the end I followed Gojko's advice and just created a simple
ExecuteSsisFixture using the code below. I decided to base it on the
ColumnFixture so that I could easily check the return value from
dtexec.
Thanks to everyone for your assistance and ideas.
Cheers, Ken
-------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
namespace warehouse.etlTest
{
public class ExecuteSsisFixture: fit.ColumnFixture
{
public string packageLocation = null; //File path to .dtsx
file
public int executionResult //0 = "Success"
{ //1 = "Failed"
get //3 = "Cancelled by
user"
{ //4 = "Unable to
locate file"
return runThePackage(); //5 = "Unable to load
file"
} //6 = "Internal error
occured"
}
public int runThePackage()
{
Package pkg;
Application app;
app = new Application();
pkg = app.LoadPackage(packageLocation, null);
return(Convert.ToInt32(pkg.Execute()));
> > > - Show quoted text -- Hide quoted text -