New
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Test / Ping.pm
1 # $Id: Ping.pm,v 1.1 2006-06-20 16:32:42 mike Exp $
2
3 # See the "Main" test package for documentation
4
5 package ZOOM::IRSpy::Test::Ping;
6
7 use 5.008;
8 use strict;
9 use warnings;
10
11 use ZOOM::IRSpy::Test;
12 our @ISA;
13 @ISA = qw(ZOOM::IRSpy::Test);
14
15
16 sub run {
17     my $this = shift();
18
19     print "Running 'Ping' test\n";
20     ### Now actually do it
21     return 0;
22 }
23
24
25 # Some of this Pod-using code may be useful.
26 #
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;
35 #
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);
42 #    return 0;
43 #}
44 #
45 #sub got_record {
46 #    my($conn, $state, $rs, $event) = @_;
47 #
48 #    {
49 #       # Sanity-checking assertions.  These should be impossible
50 #       my $ns = $state->{next_to_show};
51 #       my $nf = $state->{next_to_fetch};
52 #       if ($ns > $nf) {
53 #           die "next_to_show > next_to_fetch ($ns > $nf)";
54 #       } elsif ($ns == $nf) {
55 #           die "next_to_show == next_to_fetch ($ns)";
56 #       }
57 #    }
58 #
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;
64 #
65 #    return 0;
66 #}
67 #
68 #sub exception_thrown {
69 #    my($conn, $state, $rs, $exception) = @_;
70 #    print "Uh-oh!  $exception\n";
71 #    return 0;
72 #}
73 #
74 #sub request_records {
75 #    my($conn, $rs, $state, $count) = @_;
76 #
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;
81 #}
82 #
83 #sub render_record {
84 #    my($rec) = @_;
85 #
86 #    return "undefined" if !defined $rec;
87 #    return "'" . $rec->render() . "'";
88 #}
89
90
91 1;