1 # $Id: Ping.pm,v 1.1 2006-06-20 16:32:42 mike Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Ping;
11 use ZOOM::IRSpy::Test;
13 @ISA = qw(ZOOM::IRSpy::Test);
19 print "Running 'Ping' test\n";
20 ### Now actually do it
25 # Some of this Pod-using code may be useful.
27 #my $pod = new ZOOM::Pod(@ARGV);
28 #$pod->option(elementSetName => "b");
29 #$pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search);
30 #$pod->callback(ZOOM::Event::RECV_RECORD, \&got_record);
31 ##$pod->callback(exception => \&exception_thrown);
32 #$pod->search_pqf("the");
33 #my $err = $pod->wait();
34 #die "$pod->wait() failed with error $err" if $err;
36 #sub completed_search {
37 # my($conn, $state, $rs, $event) = @_;
38 # print $conn->option("host"), ": found ", $rs->size(), " records\n";
39 # $state->{next_to_fetch} = 0;
40 # $state->{next_to_show} = 0;
41 # request_records($conn, $rs, $state, 2);
46 # my($conn, $state, $rs, $event) = @_;
49 # # Sanity-checking assertions. These should be impossible
50 # my $ns = $state->{next_to_show};
51 # my $nf = $state->{next_to_fetch};
53 # die "next_to_show > next_to_fetch ($ns > $nf)";
54 # } elsif ($ns == $nf) {
55 # die "next_to_show == next_to_fetch ($ns)";
59 # my $i = $state->{next_to_show}++;
60 # my $rec = $rs->record($i);
61 # print $conn->option("host"), ": record $i is ", render_record($rec), "\n";
62 # request_records($conn, $rs, $state, 3)
63 # if $i == $state->{next_to_fetch}-1;
68 #sub exception_thrown {
69 # my($conn, $state, $rs, $exception) = @_;
70 # print "Uh-oh! $exception\n";
74 #sub request_records {
75 # my($conn, $rs, $state, $count) = @_;
77 # my $i = $state->{next_to_fetch};
78 # ZOOM::Log::log("irspy", "requesting $count records from $i");
79 # $rs->records($i, $count, 0);
80 # $state->{next_to_fetch} += $count;
86 # return "undefined" if !defined $rec;
87 # return "'" . $rec->render() . "'";