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!

"Private" methods

  • test_flat_file_conns

  • fetch_flat_file_conns

  • fetch_execute_pkgs

  • test_execute_pkgs

  • test_pkg_log_auto_conf

  • test_exec_pkg_auto_conf

  • test_datapumps

  • test_conn_auto_cfg

  • fetch_conns



Alceu Rodrigues de Freitas Junior, <>


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.