line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::PObject::Test; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Test.pm,v 1.5 2005/02/20 18:05:00 sherzodr Exp |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
14
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
95
|
|
6
|
|
|
|
|
|
|
#use diagnostics; |
7
|
3
|
|
|
3
|
|
18
|
use Carp; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
224
|
|
8
|
3
|
|
|
3
|
|
14
|
use Class::PObject; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
13
|
|
9
|
3
|
|
|
3
|
|
13
|
use vars ('$VERSION'); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
485
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$VERSION = '1.02'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
3
|
|
|
3
|
0
|
133
|
my $class = shift; |
15
|
3
|
|
33
|
|
|
27
|
$class = ref($class) || $class; |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
|
|
23
|
my $self = bless { |
18
|
|
|
|
|
|
|
driver => $_[0], # || 'file', |
19
|
|
|
|
|
|
|
datasource => $_[1] # || 'data' |
20
|
|
|
|
|
|
|
}, $class; |
21
|
|
|
|
|
|
|
|
22
|
3
|
50
|
33
|
|
|
118
|
unless ( $self->{driver} && $self->{datasource} ) { |
23
|
0
|
|
|
|
|
0
|
croak "'driver' and 'datasource' are not set in the test script"; |
24
|
|
|
|
|
|
|
} |
25
|
3
|
|
|
|
|
15
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub run { |
30
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
croak "You should override run() method in your test class"; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |