From f7fe13d8e55db3cf6d40960f3ff784fb8dd2c34b Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 14:35:03 +0000 Subject: [PATCH 01/16] Expose Pod object and per-target records to Test modules. --- lib/ZOOM/IRSpy.pm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 7ed3046..973c68a 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.3 2006-06-20 16:32:03 mike Exp $ +# $Id: IRSpy.pm,v 1.4 2006-06-21 14:35:03 mike Exp $ package ZOOM::IRSpy; @@ -41,7 +41,10 @@ sub new { my $this = bless { conn => $conn, allrecords => 1, # unless overridden by targets() - # query and targets will be filled in later + query => undef, # filled in later + targets => undef, # filled in later + target2record => undef, # filled in later + pod => undef, # filled in later }, $class; $this->log("irspy", "starting up with database '$dbname'"); @@ -144,7 +147,10 @@ sub initialise { } } + $this->{target2record} = \%target2record; $this->{pod} = new ZOOM::Pod(@{ $this->{targets} }); + delete $this->{targets}; # The information is now in the Pod. + delete $this->{query}; # Not needed at all } @@ -191,6 +197,20 @@ sub _run_test { } +# Access methods for the use of Test modules +sub pod { + my $this = shift(); + return $this->{pod}; +} + +sub record { + my $this = shift(); + my($target) = @_; + return $this->{target2record}->{$target}; +} + + + =head1 SEE ALSO ZOOM::IRSpy::Record -- 1.7.10.4 From d7c97727574a6f944fd0dd52ea9553dc34b32e4c Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 14:35:09 +0000 Subject: [PATCH 02/16] Rolling --- lib/ZOOM/IRSpy/Test/Ping.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/ZOOM/IRSpy/Test/Ping.pm b/lib/ZOOM/IRSpy/Test/Ping.pm index 402a98e..b1789c7 100644 --- a/lib/ZOOM/IRSpy/Test/Ping.pm +++ b/lib/ZOOM/IRSpy/Test/Ping.pm @@ -1,4 +1,4 @@ -# $Id: Ping.pm,v 1.1 2006-06-20 16:32:42 mike Exp $ +# $Id: Ping.pm,v 1.2 2006-06-21 14:35:09 mike Exp $ # See the "Main" test package for documentation @@ -15,16 +15,25 @@ our @ISA; sub run { my $this = shift(); + my $irspy = $this->irspy(); + my $pod = $irspy->pod(); - print "Running 'Ping' test\n"; - ### Now actually do it + $pod->callback(ZOOM::Event::CONNECT, \&connected); + my $err = $pod->wait(); + + return 0; +} + + +sub connected { + my($conn, $state, $rs, $event) = @_; + print $conn->option("host"), ": connected\n"; return 0; } # Some of this Pod-using code may be useful. # -#my $pod = new ZOOM::Pod(@ARGV); #$pod->option(elementSetName => "b"); #$pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search); #$pod->callback(ZOOM::Event::RECV_RECORD, \&got_record); -- 1.7.10.4 From 7c8818c661fd21c98531c5737e8dd0e5b2466d06 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 15:58:08 +0000 Subject: [PATCH 03/16] Suggest more verbose logging in sample command-line. --- irspy.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/irspy.pl b/irspy.pl index 6a487cf..80a2455 100755 --- a/irspy.pl +++ b/irspy.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl -w -# $Id: irspy.pl,v 1.6 2006-06-20 16:25:48 mike Exp $ +# $Id: irspy.pl,v 1.7 2006-06-21 15:58:08 mike Exp $ # # Run like this: -# YAZ_LOG=irspy perl -I lib irspy.pl -t "bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager" localhost:1313/IR-Explain---1 +# YAZ_LOG=irspy,irspy_test,irspy_debug perl -I lib irspy.pl -t "bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager" localhost:1313/IR-Explain---1 use strict; use warnings; -- 1.7.10.4 From 0921a9a14d3632f05b4da736193f7b074040eb94 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 16:09:02 +0000 Subject: [PATCH 04/16] record() may take a Connection instead of a target-string Logging now uses three different levels. --- lib/ZOOM/IRSpy.pm | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index 973c68a..da496e0 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.4 2006-06-21 14:35:03 mike Exp $ +# $Id: IRSpy.pm,v 1.5 2006-06-21 16:09:02 mike Exp $ package ZOOM::IRSpy; @@ -29,7 +29,11 @@ protocols. It is a successor to the ZSpy program. =cut -BEGIN { ZOOM::Log::mask_str("irspy") } +BEGIN { + ZOOM::Log::mask_str("irspy"); + ZOOM::Log::mask_str("irspy_test"); + ZOOM::Log::mask_str("irspy_debug"); +} sub new { my $class = shift(); @@ -76,8 +80,9 @@ sub targets { if (!defined $host) { $port = 210; ($host, $db) = ($target =~ /(.*?)\/(.*)/); - $this->log("irspy", "rewrote '$target' to '$host:$port/$db'"); - $target = "$host:$port/$db"; + my $new = "$host:$port/$db"; + $this->log("irspy_debug", "rewriting '$target' to '$new'"); + $target = $new; } die "invalid target string '$target'" if !defined $host; @@ -140,10 +145,10 @@ sub initialise { foreach my $target (keys %target2record) { my $record = $target2record{$target}; if (!defined $record) { - $this->log("irspy", "made new record for '$target'"); + $this->log("irspy_debug", "made new record for '$target'"); $target2record{$target} = new ZOOM::IRSpy::Record($target); } else { - $this->log("irspy", "using existing record for '$target'"); + $this->log("irspy_debug", "using existing record for '$target'"); } } @@ -206,7 +211,15 @@ sub pod { sub record { my $this = shift(); my($target) = @_; - return $this->{target2record}->{$target}; + + if (ref($target) && $target->isa("ZOOM::Connection")) { + # Can be called with a Connection instead of a target-name + my $conn = $target; + $target = $conn->option("host"); + $this->log("irspy_debug", "record() resolved $conn to '$target'"); + } + + return $this->{target2record}->{lc($target)}; } -- 1.7.10.4 From 296a16abb3e4263d96b90ecb45e765e0dae4723d Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 16:10:18 +0000 Subject: [PATCH 05/16] Running version -- does not yet register the results of its probing. --- lib/ZOOM/IRSpy/Test/Ping.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ZOOM/IRSpy/Test/Ping.pm b/lib/ZOOM/IRSpy/Test/Ping.pm index b1789c7..090c29f 100644 --- a/lib/ZOOM/IRSpy/Test/Ping.pm +++ b/lib/ZOOM/IRSpy/Test/Ping.pm @@ -1,4 +1,4 @@ -# $Id: Ping.pm,v 1.2 2006-06-21 14:35:09 mike Exp $ +# $Id: Ping.pm,v 1.3 2006-06-21 16:10:18 mike Exp $ # See the "Main" test package for documentation @@ -19,15 +19,18 @@ sub run { my $pod = $irspy->pod(); $pod->callback(ZOOM::Event::CONNECT, \&connected); - my $err = $pod->wait(); + my $err = $pod->wait($irspy); return 0; } sub connected { - my($conn, $state, $rs, $event) = @_; - print $conn->option("host"), ": connected\n"; + my($conn, $irspy, $rs, $event) = @_; + + my $rec = $irspy->record($conn); + $irspy->log("irspy_test", $conn->option("host"), " connected"); + ### Note the successful connection in $rec return 0; } -- 1.7.10.4 From 2f17d1103d5af52bf46ac80d9c5b041d9f15022a Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 16:24:55 +0000 Subject: [PATCH 06/16] _run_test() can now cope with complex text-class names such as Search::Title --- lib/ZOOM/IRSpy.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ZOOM/IRSpy.pm b/lib/ZOOM/IRSpy.pm index da496e0..0fb95f7 100644 --- a/lib/ZOOM/IRSpy.pm +++ b/lib/ZOOM/IRSpy.pm @@ -1,4 +1,4 @@ -# $Id: IRSpy.pm,v 1.5 2006-06-21 16:09:02 mike Exp $ +# $Id: IRSpy.pm,v 1.6 2006-06-21 16:24:55 mike Exp $ package ZOOM::IRSpy; @@ -189,7 +189,9 @@ sub _run_test { my($tname) = @_; eval { - require "ZOOM/IRSpy/Test/$tname.pm"; + my $slashSeperatedTname = $tname; + $slashSeperatedTname =~ s/::/\//g; + require "ZOOM/IRSpy/Test/$slashSeperatedTname.pm"; }; if ($@) { $this->log("warn", "can't load test '$tname': skipping", $@ =~ /^Can.t locate/ ? () : " ($@)"); -- 1.7.10.4 From 5412d328c46765854e28496f212ba89369c0eb62 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 16:26:09 +0000 Subject: [PATCH 07/16] Invoke the new Search::Title test as well as Ping --- lib/ZOOM/IRSpy/Test/Main.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ZOOM/IRSpy/Test/Main.pm b/lib/ZOOM/IRSpy/Test/Main.pm index 027da6b..7041061 100644 --- a/lib/ZOOM/IRSpy/Test/Main.pm +++ b/lib/ZOOM/IRSpy/Test/Main.pm @@ -1,4 +1,4 @@ -# $Id: Main.pm,v 1.1 2006-06-20 16:32:42 mike Exp $ +# $Id: Main.pm,v 1.2 2006-06-21 16:26:09 mike Exp $ package ZOOM::IRSpy::Test::Main; @@ -28,7 +28,7 @@ I<### To follow> sub run { my $this = shift(); - return $this->run_tests("Ping"); + return $this->run_tests(qw(Ping Search::Title)); } -- 1.7.10.4 From 09c14b2d6505f2d77ccd255842baec074bd24f6d Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 16:26:29 +0000 Subject: [PATCH 08/16] Remove extraneous commented-out code. --- lib/ZOOM/IRSpy/Test/Ping.pm | 67 +------------------------------------------ 1 file changed, 1 insertion(+), 66 deletions(-) diff --git a/lib/ZOOM/IRSpy/Test/Ping.pm b/lib/ZOOM/IRSpy/Test/Ping.pm index 090c29f..590b94d 100644 --- a/lib/ZOOM/IRSpy/Test/Ping.pm +++ b/lib/ZOOM/IRSpy/Test/Ping.pm @@ -1,4 +1,4 @@ -# $Id: Ping.pm,v 1.3 2006-06-21 16:10:18 mike Exp $ +# $Id: Ping.pm,v 1.4 2006-06-21 16:26:29 mike Exp $ # See the "Main" test package for documentation @@ -35,69 +35,4 @@ sub connected { } -# Some of this Pod-using code may be useful. -# -#$pod->option(elementSetName => "b"); -#$pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search); -#$pod->callback(ZOOM::Event::RECV_RECORD, \&got_record); -##$pod->callback(exception => \&exception_thrown); -#$pod->search_pqf("the"); -#my $err = $pod->wait(); -#die "$pod->wait() failed with error $err" if $err; -# -#sub completed_search { -# my($conn, $state, $rs, $event) = @_; -# print $conn->option("host"), ": found ", $rs->size(), " records\n"; -# $state->{next_to_fetch} = 0; -# $state->{next_to_show} = 0; -# request_records($conn, $rs, $state, 2); -# return 0; -#} -# -#sub got_record { -# my($conn, $state, $rs, $event) = @_; -# -# { -# # Sanity-checking assertions. These should be impossible -# my $ns = $state->{next_to_show}; -# my $nf = $state->{next_to_fetch}; -# if ($ns > $nf) { -# die "next_to_show > next_to_fetch ($ns > $nf)"; -# } elsif ($ns == $nf) { -# die "next_to_show == next_to_fetch ($ns)"; -# } -# } -# -# my $i = $state->{next_to_show}++; -# my $rec = $rs->record($i); -# print $conn->option("host"), ": record $i is ", render_record($rec), "\n"; -# request_records($conn, $rs, $state, 3) -# if $i == $state->{next_to_fetch}-1; -# -# return 0; -#} -# -#sub exception_thrown { -# my($conn, $state, $rs, $exception) = @_; -# print "Uh-oh! $exception\n"; -# return 0; -#} -# -#sub request_records { -# my($conn, $rs, $state, $count) = @_; -# -# my $i = $state->{next_to_fetch}; -# ZOOM::Log::log("irspy", "requesting $count records from $i"); -# $rs->records($i, $count, 0); -# $state->{next_to_fetch} += $count; -#} -# -#sub render_record { -# my($rec) = @_; -# -# return "undefined" if !defined $rec; -# return "'" . $rec->render() . "'"; -#} - - 1; -- 1.7.10.4 From f8135414d1128d25c83e0f8a6810012ff2a92a7c Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 21 Jun 2006 16:27:01 +0000 Subject: [PATCH 09/16] New --- lib/ZOOM/IRSpy/Test/Search/Title.pm | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/ZOOM/IRSpy/Test/Search/Title.pm diff --git a/lib/ZOOM/IRSpy/Test/Search/Title.pm b/lib/ZOOM/IRSpy/Test/Search/Title.pm new file mode 100644 index 0000000..b531c8f --- /dev/null +++ b/lib/ZOOM/IRSpy/Test/Search/Title.pm @@ -0,0 +1,41 @@ +# $Id: Title.pm,v 1.1 2006-06-21 16:27:01 mike Exp $ + +# See the "Main" test package for documentation + +package ZOOM::IRSpy::Test::Search::Title; + +use 5.008; +use strict; +use warnings; + +use ZOOM::IRSpy::Test; +our @ISA; +@ISA = qw(ZOOM::IRSpy::Test); + + +sub run { + my $this = shift(); + my $irspy = $this->irspy(); + my $pod = $irspy->pod(); + + $pod->callback(ZOOM::Event::RECV_SEARCH, \&found); + $pod->search_pqf('@attr 1=4 computer'); + my $err = $pod->wait($irspy); + + return 0; +} + + +sub found { + my($conn, $irspy, $rs, $event) = @_; + + my $rec = $irspy->record($conn); + my $n = $rs->size(); + $irspy->log("irspy_test", $conn->option("host"), + " title search found $n record", $n==1 ? "" : "s"); + ### Note the success or failure of the search in $rec + return 0; +} + + +1; -- 1.7.10.4 From 8d0120e34cea3b097ec3d0faad7a9bfc43fcac79 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 11 Jul 2006 14:16:06 +0000 Subject: [PATCH 11/16] Tweak --- lib/ZOOM/IRSpy/Test/Ping.pm | 4 ++-- lib/ZOOM/IRSpy/Test/Search/Title.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ZOOM/IRSpy/Test/Ping.pm b/lib/ZOOM/IRSpy/Test/Ping.pm index 590b94d..36b4b1f 100644 --- a/lib/ZOOM/IRSpy/Test/Ping.pm +++ b/lib/ZOOM/IRSpy/Test/Ping.pm @@ -1,4 +1,4 @@ -# $Id: Ping.pm,v 1.4 2006-06-21 16:26:29 mike Exp $ +# $Id: Ping.pm,v 1.5 2006-07-11 14:16:06 mike Exp $ # See the "Main" test package for documentation @@ -30,7 +30,7 @@ sub connected { my $rec = $irspy->record($conn); $irspy->log("irspy_test", $conn->option("host"), " connected"); - ### Note the successful connection in $rec + ### At this point we should note the successful connection in $rec return 0; } diff --git a/lib/ZOOM/IRSpy/Test/Search/Title.pm b/lib/ZOOM/IRSpy/Test/Search/Title.pm index b531c8f..122b170 100644 --- a/lib/ZOOM/IRSpy/Test/Search/Title.pm +++ b/lib/ZOOM/IRSpy/Test/Search/Title.pm @@ -1,4 +1,4 @@ -# $Id: Title.pm,v 1.1 2006-06-21 16:27:01 mike Exp $ +# $Id: Title.pm,v 1.2 2006-07-11 14:16:35 mike Exp $ # See the "Main" test package for documentation @@ -33,7 +33,7 @@ sub found { my $n = $rs->size(); $irspy->log("irspy_test", $conn->option("host"), " title search found $n record", $n==1 ? "" : "s"); - ### Note the success or failure of the search in $rec + ### We should note the success or failure of the search in $rec return 0; } -- 1.7.10.4 From 4201443f5fb1eb4a214d2f1dfaa9f0983e6496fd Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 11 Jul 2006 16:14:47 +0000 Subject: [PATCH 12/16] Notes on using XML::Simple --- lib/ZOOM/IRSpy/Record.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ZOOM/IRSpy/Record.pm b/lib/ZOOM/IRSpy/Record.pm index bded029..5b7a4d0 100644 --- a/lib/ZOOM/IRSpy/Record.pm +++ b/lib/ZOOM/IRSpy/Record.pm @@ -1,4 +1,4 @@ -# $Id: Record.pm,v 1.2 2006-06-20 12:36:14 mike Exp $ +# $Id: Record.pm,v 1.3 2006-07-11 16:14:47 mike Exp $ package ZOOM::IRSpy::Record; @@ -27,11 +27,17 @@ sub new { ### Should compile the ZeeRex record into something useful. return bless { target => $target, - zeerex => $zeerex, + zeerex => $zeerex, # Do we actually need this for anything? }, $class; } +#use XML::Simple qw(:strict); +#my %attr = (KeyAttr => [], KeepRoot => 1); +#my $config = XMLin("foo.xml", %attr, ForceArray => 1, ForceContent => 1); +#print XMLout($config, %attr); + + =head1 SEE ALSO ZOOM::IRSpy -- 1.7.10.4 From f3907f24c1bf8b10fa48d87e1f5db0b316fa5293 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 17 Jul 2006 12:10:56 +0000 Subject: [PATCH 13/16] Add --- MANIFEST | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MANIFEST b/MANIFEST index 9b43dac..2d73fa7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,10 @@ README irspy.pl lib/ZOOM/IRSpy.pm lib/ZOOM/IRSpy/Record.pm +lib/ZOOM/IRSpy/Test.pm +lib/ZOOM/IRSpy/Test/Main.pm +lib/ZOOM/IRSpy/Test/Ping.pm +lib/ZOOM/IRSpy/Test/Search/Title.pm lib/ZOOM/Pod.pm t/Net-Z3950-IRSpy.t test-pod.pl -- 1.7.10.4 From 1379040d14f26e2a07c7577715f2d2b834c3c49a Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 17 Jul 2006 15:37:33 +0000 Subject: [PATCH 14/16] New --- lib/ZOOM/XML/Simple.pm | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 lib/ZOOM/XML/Simple.pm diff --git a/lib/ZOOM/XML/Simple.pm b/lib/ZOOM/XML/Simple.pm new file mode 100644 index 0000000..da55ff7 --- /dev/null +++ b/lib/ZOOM/XML/Simple.pm @@ -0,0 +1,82 @@ +# $Id: Simple.pm,v 1.1 2006-07-17 15:37:33 mike Exp $ + +package ZOOM::XML::Simple; + +use 5.008; +use strict; +use warnings; + +use XML::LibXML; + + +=head1 NAME + +ZOOM::XML::Simple - read XML files into memory and play them out again + +=head1 SYNOPSIS + + $doc = ZOOM::XML::Simple::XMLin("foo.xml"); + $doc->[0]->{beenRead} = 1; + print ZOOM::XML::Simple::XMLout($doc); + +=head1 DESCRIPTION + +Ever used the C module? That's what I wanted. Read its +manual for details, but basically it lets you read a document into a +nice, simple in-memory format, fiddle with it to your heart's content, +then render it back out again. This is nice because the in-memory +format is so very much simpler than a DOM tree. + +Unfortunately, it turns out that C messes with your data +too much to be used if your XML needs to conform to a fixed pattern, +such as a DTD or XML Schema. Some of its damage can be prevented by +passing a hatful of attributes to its C and C +methods, but I've not found any way to prevent it from reordering the +subelements of each element into alphabetical order, which is of +course completely unacceptable in many cases. + +For the IRSpy project's C module, I need +something like C to handle the ZeeRex records -- but it +has to keep elements in their original order. Hence this module. +Because of its ordering requirement, it has to make a different +data-structure from the original. It also implements only a tiny +subset of the full C functionality - the parts that I +need, natch. + +=cut + +### But will what I make actually be all that much simpler than DOM? + + +#use XML::Simple qw(:strict); +#my %attr = (KeyAttr => [], KeepRoot => 1); +#my $config = XMLin("foo.xml", %attr, ForceArray => 1, ForceContent => 1); +#print XMLout($config, %attr); + + +=head1 SEE ALSO + +XML::Simple - the module that I hoped I'd be able to use, but wasn't +able to, hence my having had to write this one. + +ZOOM::IRSpy::Record - the module I was writing that I wanted to use +XML::Simple for, and found that it wouldn't do. + +The ZeeRex XML format is described at +http://explain.z3950.org/ + +=head1 AUTHOR + +Mike Taylor, Emike@indexdata.comE + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2006 by Index Data ApS. + +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.7 or, +at your option, any later version of Perl 5 you may have available. + +=cut + +1; -- 1.7.10.4 From 240409d8b919d306703c2418bf0552a7b6f47bfd Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 18 Jul 2006 10:40:13 +0000 Subject: [PATCH 15/16] Note failure as well as success. --- lib/ZOOM/IRSpy/Test/Ping.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/ZOOM/IRSpy/Test/Ping.pm b/lib/ZOOM/IRSpy/Test/Ping.pm index 36b4b1f..af61b3c 100644 --- a/lib/ZOOM/IRSpy/Test/Ping.pm +++ b/lib/ZOOM/IRSpy/Test/Ping.pm @@ -1,4 +1,4 @@ -# $Id: Ping.pm,v 1.5 2006-07-11 14:16:06 mike Exp $ +# $Id: Ping.pm,v 1.6 2006-07-18 10:40:13 mike Exp $ # See the "Main" test package for documentation @@ -19,17 +19,23 @@ sub run { my $pod = $irspy->pod(); $pod->callback(ZOOM::Event::CONNECT, \&connected); + $pod->callback("exception", \¬_connected); my $err = $pod->wait($irspy); return 0; } -sub connected { - my($conn, $irspy, $rs, $event) = @_; +sub connected { maybe_connected(@_, 1) } +sub not_connected { maybe_connected(@_, 0) } + +sub maybe_connected { + my($conn, $irspy, $rs, $event, $ok) = @_; my $rec = $irspy->record($conn); - $irspy->log("irspy_test", $conn->option("host"), " connected"); + $irspy->log("irspy_test", $conn->option("host"), + ($ok ? "" : " not"), " connected"); + $rec->failed(1) if !$ok; ### At this point we should note the successful connection in $rec return 0; } -- 1.7.10.4 From 6a70b9775b3f2397c03febba098e07b95fd62c14 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 18 Jul 2006 11:08:20 +0000 Subject: [PATCH 16/16] Add sample information to the end. --- zebra/zeerex.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zebra/zeerex.xml b/zebra/zeerex.xml index 6598ed9..7b5b771 100644 --- a/zebra/zeerex.xml +++ b/zebra/zeerex.xml @@ -1,5 +1,5 @@ - + @@ -157,4 +157,12 @@ + + + 2006-07-10T11:45:06 + 2006-07-17T11:45:02 + + + -- 1.7.10.4