X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest%2FPing.pm;h=ec6c441949f20e6e0cb98dbc695197aabda65eef;hp=12c3455231ae87c4a14b8d60dc20fec331396d43;hb=f5674617443eec5534a1f1770b6e9658045f8eb9;hpb=5bfd85dd260c144d16d5cf5da0ac690432777c87 diff --git a/lib/ZOOM/IRSpy/Test/Ping.pm b/lib/ZOOM/IRSpy/Test/Ping.pm index 12c3455..ec6c441 100644 --- a/lib/ZOOM/IRSpy/Test/Ping.pm +++ b/lib/ZOOM/IRSpy/Test/Ping.pm @@ -1,4 +1,3 @@ -# $Id: Ping.pm,v 1.25 2007-05-04 12:09:58 mike Exp $ # See the "Main" test package for documentation @@ -14,7 +13,7 @@ our @ISA = qw(ZOOM::IRSpy::Test); use ZOOM::IRSpy::Utils qw(isodate); use Text::Iconv; -my $conv = new Text::Iconv("LATIN1", "UTF8"); +my $conv = new Text::Iconv("LATIN1", "UTF-8"); sub start { @@ -25,9 +24,10 @@ sub start { my $xc = $conn->record()->xpath_context(); my $user = $xc->find("e:serverInfo/e:authentication/e:user"); my $password = $xc->find("e:serverInfo/e:authentication/e:password"); - warn "user='$user', password='$password'\n"; - $options{user} = $user if $user; - $options{password} = $password if $password; + my $proxy = $xc->find("e:serverInfo/e:authentication/e:proxy"); + $options{"*user"} = $user if $user; + $options{"*password"} = $password if $password; + $options{"*proxy"} = $proxy if $proxy; $conn->irspy_connect(undef, \%options, ZOOM::Event::ZEND, \&connected, @@ -54,9 +54,11 @@ sub connected { if $conn->option("init_opt_$opt"); } - foreach my $opt (qw(serverImplementationId - serverImplementationName - serverImplementationVersion)) { + my %params = (serverImplementationId => "id", + serverImplementationName => "name", + serverImplementationVersion => "version", + ); + foreach my $opt (keys %params) { my $val = $conn->option($opt); next if !defined $val; # not defined for SRU, for example @@ -81,6 +83,7 @@ sub connected { $val = $maybe; } $conn->record()->store_result($opt, value => $val); + $conn->irspy()->var($params{$opt}, $val); } return ZOOM::IRSpy::Status::TEST_GOOD; @@ -90,7 +93,7 @@ sub connected { sub not_connected { my($conn, $__UNUSED_task, $__UNUSED_udata, $exception) = @_; - $conn->log("irspy_test", "not connected: $exception"); + $conn->log("irspy", "not connected: $exception"); $conn->record()->store_result("probe", ok => 0, errcode => $exception->code(),