metric_configuration_fixtures.rb
1.6 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
require File.dirname(__FILE__) + '/compound_metric_fixtures'
require File.dirname(__FILE__) + '/native_metric_fixtures'
require File.dirname(__FILE__) + '/range_fixtures'
class MetricConfigurationFixtures
def self.amloc_metric_configuration
amloc = Kalibro::MetricConfiguration.new amloc_metric_configuration_hash
amloc.configuration_name = "Sample Configuration"
amloc
end
def self.metric_configuration_without_ranges
amloc = Kalibro::MetricConfiguration.new
{
:metric => NativeMetricFixtures.amloc_hash,
:code => 'amloc',
:weight => 1.0,
:aggregation_form => 'AVERAGE'
}
amloc.configuration_name = "Sample Configuration"
amloc
end
def self.sc_metric_configuration
sc = Kalibro::MetricConfiguration.new sc_metric_configuration_hash
sc.configuration_name = "Sample Configuration"
sc
end
def self.amloc_metric_configuration_hash
{:metric => NativeMetricFixtures.amloc_hash, :code => 'amloc', :weight => 1.0,
:aggregation_form => 'AVERAGE',
:range => [RangeFixtures.range_excellent_hash, RangeFixtures.range_bad_hash],
:attributes! => {:metric => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:nativeMetricXml' }}}
end
def self.sc_metric_configuration_hash
{:metric => CompoundMetricFixtures.compound_metric_hash, :code => 'sc', :weight => 1.0, :aggregation_form => 'AVERAGE',
:attributes! => {:metric => {
'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:type' => 'kalibro:compoundMetricXml' }}}
end
end