2 package ZOOM::IRSpy::Test;
10 use Exporter 'import';
11 our @EXPORT = qw(zoom_error_timeout_update zoom_error_timeout_check);
15 ZOOM::IRSpy::Test - base class for tests in IRSpy
36 die "can't start the base-class test";
40 our $max_timeout_errors = $ZOOM::IRSpy::max_timeout_errors;
42 sub zoom_error_timeout_update {
43 my ($conn, $exception) = @_;
45 if ($exception =~ /Timeout/i) {
46 $conn->record->zoom_error->{TIMEOUT}++;
47 $conn->log("irspy_test", "Increase timeout error counter to: " .
48 $conn->record->zoom_error->{TIMEOUT});
52 sub zoom_error_timeout_check {
55 if ($conn->record->zoom_error->{TIMEOUT} >= $max_timeout_errors) {
56 $conn->log("irspy_test", "Got $max_timeout_errors or more timeouts, give up...");
69 Mike Taylor, E<lt>mike@indexdata.comE<gt>
71 =head1 COPYRIGHT AND LICENSE
73 Copyright (C) 2006 by Index Data ApS.
75 This library is free software; you can redistribute it and/or modify
76 it under the same terms as Perl itself, either Perl version 5.8.7 or,
77 at your option, any later version of Perl 5 you may have available.