DTS_UT::Model::UnitTest - class that represents the test to be executed with DTS packages.
DTS_UT::Model::UnitTest is the test that will be executed again the desired DTS package(s).
This class is based in Test::More and Test::Builder features. Test::Builder is specially necessary because of the methods output and reset that will change, respectivally, the default output (STDOUT) to a file and will reset the tests and results from previous execution.
The file where the output will be redirected is a temporary file (see File::Temp) that will be removed as soon the test is finished and results read.
Since Test::Builder object is a singleton, at the end of each test it's state must be reseted to start a new test without changing it's results.
With such implementation, DTS_UT::Model::UnitTest can be executed N times against DTS packages without exporting lots of subroutines of Test::More into main namespace. By using a temporary file for test output, it can be used with environments like mod_perl once it avoids doing system calls by calling the perl program to execute the test and read the output.
Expects as a parameter an hash reference like defined in Win32::SqlServer::DTS::Application.
Returns a DTS_UT::Model::UnitTest object.
Executes the test agains a given DTS package.
Expects as parameter the name of a DTS package.
Returns the complete pathname of the temporary file where the results of the test are written. Beware that if the DTS_UT::Model::UnitTest goes out of scope (and it's reclaimed by garbage collector), the temporary file will be removed automatically!
Alceu Rodrigues de Freitas Junior, <firstname.lastname@example.org>
Copyright (C) 2008 by Alceu Rodrigues de Freitas Junior
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Win32::SqlServer::DTS, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.