1 # $Id: Ping.pm,v 1.2 2006-06-21 14:35:09 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);
18 my $irspy = $this->irspy();
19 my $pod = $irspy->pod();
21 $pod->callback(ZOOM::Event::CONNECT, \&connected);
22 my $err = $pod->wait();
29 my($conn, $state, $rs, $event) = @_;
30 print $conn->option("host"), ": connected\n";
35 # Some of this Pod-using code may be useful.
37 #$pod->option(elementSetName => "b");
38 #$pod->callback(ZOOM::Event::RECV_SEARCH, \&completed_search);
39 #$pod->callback(ZOOM::Event::RECV_RECORD, \&got_record);
40 ##$pod->callback(exception => \&exception_thrown);
41 #$pod->search_pqf("the");
42 #my $err = $pod->wait();
43 #die "$pod->wait() failed with error $err" if $err;
45 #sub completed_search {
46 # my($conn, $state, $rs, $event) = @_;
47 # print $conn->option("host"), ": found ", $rs->size(), " records\n";
48 # $state->{next_to_fetch} = 0;
49 # $state->{next_to_show} = 0;
50 # request_records($conn, $rs, $state, 2);
55 # my($conn, $state, $rs, $event) = @_;
58 # # Sanity-checking assertions. These should be impossible
59 # my $ns = $state->{next_to_show};
60 # my $nf = $state->{next_to_fetch};
62 # die "next_to_show > next_to_fetch ($ns > $nf)";
63 # } elsif ($ns == $nf) {
64 # die "next_to_show == next_to_fetch ($ns)";
68 # my $i = $state->{next_to_show}++;
69 # my $rec = $rs->record($i);
70 # print $conn->option("host"), ": record $i is ", render_record($rec), "\n";
71 # request_records($conn, $rs, $state, 3)
72 # if $i == $state->{next_to_fetch}-1;
77 #sub exception_thrown {
78 # my($conn, $state, $rs, $exception) = @_;
79 # print "Uh-oh! $exception\n";
83 #sub request_records {
84 # my($conn, $rs, $state, $count) = @_;
86 # my $i = $state->{next_to_fetch};
87 # ZOOM::Log::log("irspy", "requesting $count records from $i");
88 # $rs->records($i, $count, 0);
89 # $state->{next_to_fetch} += $count;
95 # return "undefined" if !defined $rec;
96 # return "'" . $rec->render() . "'";