diff --git a/src/main/perl/Download.pm b/src/main/perl/Download.pm index 8024587b..fcd66cb0 100644 --- a/src/main/perl/Download.pm +++ b/src/main/perl/Download.pm @@ -10,7 +10,7 @@ use warnings; # For re-export only use CAF::Download::URL qw(set_url_defaults); -use parent qw(CAF::Object Exporter CAF::Download::URL CAF::Download::Retrieve); +use parent qw(CAF::ObjectText Exporter CAF::Download::URL CAF::Download::Retrieve); use Readonly; use LC::Exception qw (SUCCESS); @@ -38,17 +38,6 @@ Readonly::Hash my %DOWNLOAD_AUTHENTICATION => { x509 => [qw(lwp)], }; -# Handle failures. Stores the error message and log it verbose and -# returns undef. All failures should use 'return $self->fail("message");'. -# No error logging should occur in this module. -sub fail -{ - my ($self, @messages) = @_; - $self->{fail} = join('', @messages); - $self->verbose("FAIL: ", $self->{fail}); - return; -} - # Disclaimer: inspired by # NCM::Component::download (15.8) # EDG::WP4::CCM::Fetch (15.8) @@ -130,7 +119,7 @@ sub _initialize %opts = () if !%opts; - $self->{log} = $opts{log} if $opts{log}; + $self->_initialize_textopts(%opts); $self->{setup} = (! defined($opts{setup}) || $opts{setup}) ? 1 : 0; $self->{cleanup} = (! defined($opts{cleanup}) || $opts{cleanup}) ? 1 : 0; diff --git a/src/test/perl/download.t b/src/test/perl/download.t index ff3308f7..701e90c7 100644 --- a/src/test/perl/download.t +++ b/src/test/perl/download.t @@ -24,6 +24,7 @@ Test all methods for C my $d = CAF::Download->new(["http://localhost"], log => $obj); isa_ok($d, 'CAF::Download', 'is a CAF::Download instance'); +isa_ok($d, 'CAF::ObjectText', 'CAF::Download is a CAF::ObjectText instance'); is($d->{setup}, 1, "default setup is 1"); is($d->{cleanup}, 1, "default cleanup is 1"); ok(! exists($d->{destination}), 'no destination specified, attribute does not exist');