metric_configuration_snapshot_fixtures.rb
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
require File.dirname(__FILE__) + '/metric_fixtures'
require File.dirname(__FILE__) + '/range_snapshot_fixtures'
class MetricConfigurationSnapshotFixtures
def self.metric_configuration_snapshot
Kalibro::MetricConfigurationSnapshot.new metric_configuration_snapshot_hash
end
def self.metric_configuration_snapshot_hash
{
:code => "code",
:weight => "1.0",
:aggregation_form => 'AVERAGE',
:metric => MetricFixtures.amloc_hash,
:base_tool_name => "Analizo",
:range => [RangeSnapshotFixtures.range_snapshot_hash],
:attributes! => {
:metric => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:metricXml' },
:range => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:rangeSnapshotXml' }
}
}
end
def self.metric_configuration_snapshot_with_2_elements
Kalibro::MetricConfigurationSnapshot.new metric_configuration_snapshot_hash_with_2_elements
end
def self.metric_configuration_snapshot_hash_with_2_elements
hash = self.metric_configuration_snapshot_hash
hash[:range] << RangeSnapshotFixtures.range_snapshot_hash
hash
end
def self.compound_metric_configuration_snapshot
Kalibro::MetricConfigurationSnapshot.new compound_metric_configuration_snapshot_hash
end
def self.compound_metric_configuration_snapshot_hash
{
:code => "code",
:weight => "1.0",
:aggregation_form => 'AVERAGE',
:metric => MetricFixtures.compound_metric,
:base_tool_name => "Analizo",
:range => [RangeSnapshotFixtures.range_snapshot_hash],
:attributes! => {
:metric => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:metricXml' },
:range => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:rangeSnapshotXml' }
}
}
end
end