File Coverage

blib/lib/Win32/SqlServer/DTS/Assignment/DataFile.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Win32::SqlServer::DTS::Assignment::DataFile;
2            
3             =head1 NAME
4            
5             Win32::SqlServer::DTS::Assignment::DataFile - a class to represent a DTS DynamicPropertiesTaskAssignment object
6            
7             =head1 SYNOPSIS
8            
9             use warnings;
10             use strict;
11             use Win32::SqlServer::DTS::Application;
12             use Test::More;
13             use XML::Simple;
14            
15             my $xml = XML::Simple->new();
16             my $config = $xml->XMLin('test-config.xml');
17            
18             my $app = Win32::SqlServer::DTS::Application->new($config->{credential});
19            
20             my $package =
21             $app->get_db_package(
22             { id => '', version_id => '', name => $config->{package}, package_password => '' } );
23            
24             my $iterator = $package->get_dynamic_props();
25            
26             while ( my $dyn_prop = $iterator->() ) {
27            
28             foreach my $assignment_prop ( @{ $dyn_prop->get_properties() } ) {
29            
30             if ( $assignment_prop->get_type() eq 'DataFile' ) {
31            
32             print $assignment_prop->to_string(), "\n";
33            
34             }
35            
36             }
37             }
38            
39             =head1 DESCRIPTION
40            
41             C is a subclass of L superclass. It represents
42             a DTS C object that has a C property defined.
43            
44             Unless you want to extend the C API is quite probably that you're going to use C
45             returned by the C method from C class.
46            
47             =head2 EXPORT
48            
49             Nothing.
50            
51             =cut
52 1     1   29472 use strict;
  1         2  
  1         45  
53 1     1   5 use warnings;
  1         2  
  1         37  
54            
55 1     1   6 use base qw(Win32::SqlServer::DTS::Assignment);
  1         1  
  1         886  
56            
57             =head2 METHODS
58            
59             Inherits all methods from C.
60            
61             =head3 new
62            
63             Extends superclass method C by modifying the C attribute.
64            
65             =cut
66            
67             sub new {
68            
69             my $class = shift;
70            
71             my $self = $class->SUPER::new(@_);
72            
73             $self->{source} = $self->get_sibling()->SourceDataFileFileName();
74            
75             return $self;
76            
77             }
78            
79             =head3 get_source
80            
81             Overrided method from L class. Returns a string containing the complete pathname
82             plus filename from where the value will be fetched to set a destination. See
83             L method for more information.
84            
85             =cut
86            
87             sub get_source {
88            
89             my $self = shift;
90             return $self->{source};
91            
92             }
93            
94             1;
95             __END__