line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VSGDR::UnitTest::TestSet::Test::TestCondition::ExpectedSchema; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
891
|
use 5.010; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
16
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#our \$VERSION = '1.01'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
7
|
use parent qw(VSGDR::UnitTest::TestSet::Test::TestCondition) ; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
BEGIN { |
13
|
1
|
|
|
1
|
|
89
|
*AUTOLOAD = \&VSGDR::UnitTest::TestSet::Test::TestCondition::AUTOLOAD ; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
5
|
use Data::Dumper ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
17
|
1
|
|
|
1
|
|
6
|
use Carp ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
1
|
|
5
|
use vars qw($AUTOLOAD %ok_field); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
435
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# Authorize constructor hash fields |
23
|
|
|
|
|
|
|
my %ok_params = () ; |
24
|
|
|
|
|
|
|
for my $attr ( qw(CONDITIONTESTACTIONNAME CONDITIONNAME CONDITIONENABLED CONDITIONVERBOSE CONDITIONAPPLYRESOURCES) ) { $ok_params{$attr}++; } |
25
|
|
|
|
|
|
|
my %ok_fields = () ; |
26
|
|
|
|
|
|
|
my %ok_fields_type = () ; |
27
|
|
|
|
|
|
|
# Authorize attribute fields |
28
|
|
|
|
|
|
|
for my $attr ( qw(conditionTestActionName conditionName conditionEnabled conditionVerbose conditionApplyResources) ) { $ok_fields{$attr}++; $ok_fields_type{$attr} = 'plain'; } |
29
|
|
|
|
|
|
|
$ok_fields_type{conditionName} = 'quoted'; |
30
|
|
|
|
|
|
|
$ok_fields_type{conditionEnabled} = 'bool'; |
31
|
|
|
|
|
|
|
$ok_fields_type{conditionApplyResources} = 'literalcode'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _init { |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
|
|
local $_ = undef ; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $self = shift ; |
39
|
0
|
|
0
|
|
|
|
my $class = ref($self) || $self ; |
40
|
0
|
0
|
|
|
|
|
my $ref = shift or croak "no arg"; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$self->{OK_PARAMS} = \%ok_params ; |
43
|
0
|
|
|
|
|
|
$self->{OK_FIELDS} = \%ok_fields ; |
44
|
0
|
|
|
|
|
|
$self->{OK_FIELDS_TYPE} = \%ok_fields_type ; |
45
|
0
|
|
|
|
|
|
my @validargs = grep { exists($$ref{$_}) } keys %{$self->{OK_PARAMS}} ; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#warn Dumper @validargs; |
47
|
0
|
0
|
|
|
|
|
croak "bad args" |
48
|
|
|
|
|
|
|
if scalar(@validargs) != 4 ; |
49
|
|
|
|
|
|
|
#warn Dumper @validargs; |
50
|
0
|
|
|
|
|
|
my ${Name} = $$ref{CONDITIONNAME}; |
51
|
0
|
|
|
|
|
|
my ${TestActionName} = $$ref{CONDITIONTESTACTIONNAME}; |
52
|
0
|
|
|
|
|
|
my ${Enabled} = $$ref{CONDITIONENABLED}; |
53
|
0
|
|
|
|
|
|
my ${Verbose} = $$ref{CONDITIONVERBOSE}; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$self->conditionName(${Name}) ; |
56
|
0
|
|
|
|
|
|
$self->conditionTestActionName(${TestActionName}) ; |
57
|
0
|
|
|
|
|
|
$self->conditionEnabled(${Enabled}) ; |
58
|
0
|
|
|
|
|
|
$self->conditionVerbose(${Verbose}) ; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
return ; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub testConditionType { |
66
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
67
|
0
|
|
|
|
|
|
return 'ExpectedSchema' ; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub testConditionMSType { |
71
|
0
|
|
|
0
|
0
|
|
return 'ExpectedSchemaCondition' ; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub check { |
75
|
0
|
|
|
0
|
0
|
|
local $_ = undef ; |
76
|
0
|
|
|
|
|
|
my $self = shift ; |
77
|
0
|
|
|
|
|
|
my $ra_res = shift ; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
#warn Dumper $ra_res ; |
80
|
|
|
|
|
|
|
|
81
|
0
|
0
|
|
|
|
|
if ( $self->conditionISEnabled() ) { |
82
|
|
|
|
|
|
|
#say 'Condition is ', $self->conditionName() ; |
83
|
|
|
|
|
|
|
#say 'value is ', '"'.$ra_res->[$self->conditionResultSet()-1]->[$self->conditionRowNumber()-1]->[$self->conditionColumnNumber()-1].'"' ; |
84
|
|
|
|
|
|
|
#say 'expected was ', $self->conditionExpectedValue() ; |
85
|
0
|
|
|
|
|
|
return scalar 1 ; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
else { |
88
|
|
|
|
|
|
|
#say 'Condition ', $self->conditionName(), ' is disabled' ; |
89
|
0
|
|
|
|
|
|
return scalar -1 ; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
## local override for unstorable attribute - when called upon - just derive it. |
94
|
|
|
|
|
|
|
## luckily we can get away with this it's the same for vb and c# |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub conditionApplyResources { |
97
|
0
|
|
|
0
|
0
|
|
local $_ = undef ; |
98
|
0
|
|
|
|
|
|
my $self = shift ; |
99
|
0
|
|
|
|
|
|
my $ra_res = shift ; |
100
|
0
|
|
|
|
|
|
return "resources.ApplyResources(" . $self->conditionName() . ', "' . $self->conditionName() . '")' ; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
1 ; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
__DATA__ |