line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Delay.pm,v 1.4 2003/03/02 11:52:09 m_ilya Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTTP::WebTest::Plugin::Delay; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
HTTP::WebTest::Plugin::Delay - Pause before running test |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
plugins = ( ::Delay ) |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
test_name = Name |
14
|
|
|
|
|
|
|
delay = 10 |
15
|
|
|
|
|
|
|
.... |
16
|
|
|
|
|
|
|
end_test |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This plugin module lets you specify pauses before running specific tests |
21
|
|
|
|
|
|
|
in the test sequence. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
9
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
77
|
|
26
|
1
|
|
|
1
|
|
8
|
use base qw(HTTP::WebTest::Plugin); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
122
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
5
|
use Time::HiRes qw(sleep); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 TEST PARAMETERS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=for pod_merge copy opt_params |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 delay |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Duration of pause (in seconds) before running test. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head3 Allowed values |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Any number greater that zero. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub param_types { |
45
|
0
|
|
|
0
|
1
|
0
|
return q(delay scalar); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub prepare_request { |
49
|
3
|
|
|
3
|
0
|
8
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
3
|
100
|
|
|
|
17
|
if(my $delay = $self->test_param('delay')) { |
52
|
2
|
|
|
|
|
6002720
|
sleep($delay); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 COPYRIGHT |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Copyright (c) 2002-2003 Duncan Cameron. All rights reserved. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
61
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 SEE ALSO |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
L |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
L |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
L |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
L |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|