kalibro_entities 0.0.1.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +21 -0
- data/AUTHORS +4 -0
- data/COPYING +674 -0
- data/COPYING.LESSER +165 -0
- data/Gemfile +4 -0
- data/README.md +77 -0
- data/Rakefile +6 -0
- data/cucumber.yml +1 -0
- data/features/base_tool/all_names.feature +8 -0
- data/features/base_tool/find_by_name.feature +12 -0
- data/features/configuration/all.feature +10 -0
- data/features/metric_configuration/find.feature +18 -0
- data/features/metric_configuration/metric_configurations_of.feature +18 -0
- data/features/metric_result/descendant_results.feature +19 -0
- data/features/metric_result/history_of.feature +20 -0
- data/features/metric_result/metric_results_of.feature +19 -0
- data/features/module_result/children.feature +18 -0
- data/features/module_result/find.feature +15 -0
- data/features/module_result/history_of.feature +11 -0
- data/features/processing/first_processing_after.feature +18 -0
- data/features/processing/first_processing_of.feature +18 -0
- data/features/processing/has_processing.feature +18 -0
- data/features/processing/has_processing_after.feature +18 -0
- data/features/processing/has_processing_before.feature +18 -0
- data/features/processing/has_ready_processing.feature +18 -0
- data/features/processing/last_processing_before.feature +18 -0
- data/features/processing/last_processing_of.feature +18 -0
- data/features/processing/last_processing_state_of.feature +18 -0
- data/features/processing/last_ready_processing_of.feature +18 -0
- data/features/processing/processing_of.feature +32 -0
- data/features/processing/processing_with_date_of.feature +32 -0
- data/features/project/all.feature +10 -0
- data/features/project/creation.feature +9 -0
- data/features/project/destroy.feature +10 -0
- data/features/project/exists.feature +9 -0
- data/features/project/find.feature +10 -0
- data/features/range/ranges_of.feature +22 -0
- data/features/range/save.feature +32 -0
- data/features/reading/find.feature +11 -0
- data/features/reading/readings_of.feature +11 -0
- data/features/reading_group/all.feature +10 -0
- data/features/repository/all.feature +14 -0
- data/features/repository/cancel_processing.feature +14 -0
- data/features/repository/find.feature +14 -0
- data/features/repository/of.feature +15 -0
- data/features/repository/process.feature +16 -0
- data/features/repository/types.feature +9 -0
- data/features/step_definitions/base_tool_steps.rb +28 -0
- data/features/step_definitions/configuration_steps.rb +11 -0
- data/features/step_definitions/metric_configuration_steps.rb +52 -0
- data/features/step_definitions/metric_result_steps.rb +29 -0
- data/features/step_definitions/metric_steps.rb +3 -0
- data/features/step_definitions/module_result_steps.rb +30 -0
- data/features/step_definitions/processing_steps.rb +91 -0
- data/features/step_definitions/project_steps.rb +48 -0
- data/features/step_definitions/range_steps.rb +41 -0
- data/features/step_definitions/reading_group_steps.rb +19 -0
- data/features/step_definitions/reading_steps.rb +20 -0
- data/features/step_definitions/repository_steps.rb +57 -0
- data/features/support/env.rb +25 -0
- data/features/support/kalibro_cucumber_helpers.yml.sample +10 -0
- data/kalibro_entities.gemspec +48 -0
- data/lib/kalibro_entities.rb +61 -0
- data/lib/kalibro_entities/entities.rb +37 -0
- data/lib/kalibro_entities/entities/base_tool.rb +54 -0
- data/lib/kalibro_entities/entities/configuration.rb +33 -0
- data/lib/kalibro_entities/entities/date_metric_result.rb +39 -0
- data/lib/kalibro_entities/entities/date_module_result.rb +39 -0
- data/lib/kalibro_entities/entities/metric.rb +21 -0
- data/lib/kalibro_entities/entities/metric_configuration.rb +70 -0
- data/lib/kalibro_entities/entities/metric_configuration_snapshot.rb +57 -0
- data/lib/kalibro_entities/entities/metric_result.rb +63 -0
- data/lib/kalibro_entities/entities/model.rb +162 -0
- data/lib/kalibro_entities/entities/module.rb +27 -0
- data/lib/kalibro_entities/entities/module_result.rb +69 -0
- data/lib/kalibro_entities/entities/process_time.rb +31 -0
- data/lib/kalibro_entities/entities/processing.rb +113 -0
- data/lib/kalibro_entities/entities/project.rb +34 -0
- data/lib/kalibro_entities/entities/range.rb +75 -0
- data/lib/kalibro_entities/entities/range_snapshot.rb +37 -0
- data/lib/kalibro_entities/entities/reading.rb +51 -0
- data/lib/kalibro_entities/entities/reading_group.rb +43 -0
- data/lib/kalibro_entities/entities/repository.rb +78 -0
- data/lib/kalibro_entities/entities/repository_observer.rb +50 -0
- data/lib/kalibro_entities/entities/stack_trace_element.rb +31 -0
- data/lib/kalibro_entities/entities/throwable.rb +42 -0
- data/lib/kalibro_entities/errors.rb +18 -0
- data/lib/kalibro_entities/errors/record_not_found.rb +22 -0
- data/lib/kalibro_entities/errors/standard.rb +24 -0
- data/lib/kalibro_entities/helpers/aggregation_options.rb +25 -0
- data/lib/kalibro_entities/helpers/hash_converters.rb +48 -0
- data/lib/kalibro_entities/helpers/request_methods.rb +47 -0
- data/lib/kalibro_entities/helpers/xml_converters.rb +20 -0
- data/lib/kalibro_entities/kalibro_cucumber_helpers.rb +40 -0
- data/lib/kalibro_entities/kalibro_cucumber_helpers/configuration.rb +39 -0
- data/lib/kalibro_entities/kalibro_cucumber_helpers/hooks.rb +50 -0
- data/lib/kalibro_entities/kalibro_cucumber_helpers/scripts/delete_all_kalibro_entries.sh +23 -0
- data/lib/kalibro_entities/kalibro_cucumber_helpers/scripts/prepare_kalibro_query_file.sh +38 -0
- data/lib/kalibro_entities/kalibro_cucumber_helpers/scripts/put_kalibro_on_test_mode.sh +35 -0
- data/lib/kalibro_entities/kalibro_cucumber_helpers/scripts/return_kalibro_from_test_mode.sh +26 -0
- data/lib/kalibro_entities/version.rb +19 -0
- data/lib/rake/test_task.rb +57 -0
- data/spec/entities/base_tool_spec.rb +168 -0
- data/spec/entities/configuration_spec.rb +61 -0
- data/spec/entities/date_metric_result_spec.rb +62 -0
- data/spec/entities/date_module_result_spec.rb +61 -0
- data/spec/entities/metric_configuration_snapshot_spec.rb +107 -0
- data/spec/entities/metric_configuration_spec.rb +149 -0
- data/spec/entities/metric_result_spec.rb +193 -0
- data/spec/entities/metric_spec.rb +47 -0
- data/spec/entities/model_spec.rb +275 -0
- data/spec/entities/module_result_spec.rb +135 -0
- data/spec/entities/process_time_spec.rb +33 -0
- data/spec/entities/processing_spec.rb +334 -0
- data/spec/entities/project_spec.rb +68 -0
- data/spec/entities/range_snapshot_spec.rb +50 -0
- data/spec/entities/range_spec.rb +181 -0
- data/spec/entities/reading_group_spec.rb +90 -0
- data/spec/entities/reading_spec.rb +106 -0
- data/spec/entities/repository_observer_spec.rb +123 -0
- data/spec/entities/repository_spec.rb +167 -0
- data/spec/entities/stack_trace_element_spec.rb +26 -0
- data/spec/entities/throwable_spec.rb +51 -0
- data/spec/factories/base_tools.rb +31 -0
- data/spec/factories/configurations.rb +29 -0
- data/spec/factories/date_metric_results.rb +28 -0
- data/spec/factories/date_module_results.rb +22 -0
- data/spec/factories/metric_configurations.rb +28 -0
- data/spec/factories/metric_configurations_snapshot.rb +26 -0
- data/spec/factories/metric_results.rb +24 -0
- data/spec/factories/metrics.rb +35 -0
- data/spec/factories/models.rb +20 -0
- data/spec/factories/module_results.rb +33 -0
- data/spec/factories/modules.rb +22 -0
- data/spec/factories/process_times.rb +27 -0
- data/spec/factories/processings.rb +25 -0
- data/spec/factories/projects.rb +29 -0
- data/spec/factories/ranges.rb +30 -0
- data/spec/factories/ranges_snapshot.rb +26 -0
- data/spec/factories/reading_groups.rb +23 -0
- data/spec/factories/readings.rb +25 -0
- data/spec/factories/repositories.rb +34 -0
- data/spec/factories/repository_observers.rb +24 -0
- data/spec/factories/stack_trace_elements.rb +24 -0
- data/spec/factories/throwables.rb +23 -0
- data/spec/helpers/aggregation_options_spec.rb +31 -0
- data/spec/helpers/hash_converters_spec.rb +111 -0
- data/spec/helpers/xml_converters_spec.rb +64 -0
- data/spec/kalibro_entities_spec.rb +108 -0
- data/spec/savon/fixtures/config.yml +1 -0
- data/spec/savon/fixtures/invalid_config.yml +2 -0
- data/spec/savon/fixtures/project/does_not_exists.xml +1 -0
- data/spec/savon/savon_test_helper.rb +14 -0
- data/spec/spec_helper.rb +60 -0
- metadata +461 -0
@@ -0,0 +1,167 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe KalibroEntities::Entities::Repository do
|
20
|
+
subject { FactoryGirl.build(:repository) }
|
21
|
+
|
22
|
+
describe 'repository_types' do
|
23
|
+
before :each do
|
24
|
+
KalibroEntities::Entities::Repository.
|
25
|
+
expects(:request).
|
26
|
+
with(:supported_repository_types).
|
27
|
+
returns({:supported_type=>["BAZAAR", "GIT", "MERCURIAL", "REMOTE_TARBALL", "REMOTE_ZIP"],
|
28
|
+
:"@xmlns:ns2"=>"http://service.kalibro.org/"})
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should return an array of repository types' do
|
32
|
+
KalibroEntities::Entities::Repository.repository_types.should eq(["BAZAAR", "GIT", "MERCURIAL", "REMOTE_TARBALL", "REMOTE_ZIP"])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'repositories_of' do
|
37
|
+
before :each do
|
38
|
+
KalibroEntities::Entities::Repository.
|
39
|
+
expects(:request).
|
40
|
+
with(:repositories_of, {:project_id => 1}).
|
41
|
+
returns({:repository=>[],
|
42
|
+
:"@xmlns:ns2"=>"http://service.kalibro.org/"})
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should return an array' do
|
46
|
+
KalibroEntities::Entities::Repository.repositories_of(1).should be_an(Array)
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'should set the repository_id' do
|
50
|
+
KalibroEntities::Entities::Repository.repositories_of(1).each do |repository|
|
51
|
+
repository.project_id.should eq(1)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe "id=" do
|
57
|
+
it 'should set the id attribute values as integer' do
|
58
|
+
subject.id = "222"
|
59
|
+
subject.id.should eq(222)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "process_period=" do
|
64
|
+
it 'should set the process_period attribute values as integer' do
|
65
|
+
subject.process_period = "222"
|
66
|
+
subject.process_period.should eq(222)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe "configuration_id=" do
|
71
|
+
it 'should set the configuration_id attribute values as integer' do
|
72
|
+
subject.configuration_id = "222"
|
73
|
+
subject.configuration_id.should eq(222)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe 'process' do
|
78
|
+
before :each do
|
79
|
+
KalibroEntities::Entities::Repository.
|
80
|
+
expects(:request).
|
81
|
+
with(:process_repository, {:repository_id => subject.id})
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'should call the request method' do
|
85
|
+
subject.process
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
describe 'cancel_processing_of_repository' do
|
90
|
+
before :each do
|
91
|
+
KalibroEntities::Entities::Repository.
|
92
|
+
expects(:request).
|
93
|
+
with(:cancel_processing_of_repository, {:repository_id => subject.id})
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'should call the request method' do
|
97
|
+
subject.cancel_processing_of_repository
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
describe 'all' do
|
102
|
+
let(:project) { FactoryGirl.build(:project) }
|
103
|
+
|
104
|
+
before :each do
|
105
|
+
KalibroEntities::Entities::Project.
|
106
|
+
expects(:all).
|
107
|
+
returns([project])
|
108
|
+
KalibroEntities::Entities::Repository.
|
109
|
+
expects(:repositories_of).
|
110
|
+
with(project.id).
|
111
|
+
returns([subject])
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'should list all the repositories' do
|
115
|
+
KalibroEntities::Entities::Repository.all.should include(subject)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe 'find' do
|
120
|
+
context 'when the repository exists' do
|
121
|
+
before :each do
|
122
|
+
KalibroEntities::Entities::Repository.
|
123
|
+
expects(:all).
|
124
|
+
returns([subject])
|
125
|
+
end
|
126
|
+
|
127
|
+
it 'should return the repository' do
|
128
|
+
KalibroEntities::Entities::Repository.find(subject.id).should eq(subject)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
context "when the repository doesn't exists" do
|
133
|
+
before :each do
|
134
|
+
KalibroEntities::Entities::Repository.
|
135
|
+
expects(:all).
|
136
|
+
returns([FactoryGirl.build(:another_repository)])
|
137
|
+
end
|
138
|
+
|
139
|
+
it 'should raise a RecordNotFound error' do
|
140
|
+
expect { KalibroEntities::Entities::Repository.find(subject.id) }.
|
141
|
+
to raise_error(KalibroEntities::Errors::RecordNotFound)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# The only purpose of this test is to cover the overrided save_params method
|
147
|
+
describe 'save' do
|
148
|
+
subject {FactoryGirl.build(:repository, {id: nil})}
|
149
|
+
|
150
|
+
before :each do
|
151
|
+
KalibroEntities::Entities::Repository.
|
152
|
+
expects(:request).
|
153
|
+
with(:save_repository, {:repository => subject.to_hash, :project_id => 1}).
|
154
|
+
returns({:repository_id => 1})
|
155
|
+
|
156
|
+
KalibroEntities::Entities::Repository.any_instance.
|
157
|
+
expects(:id=).
|
158
|
+
with(1).
|
159
|
+
returns(1)
|
160
|
+
end
|
161
|
+
|
162
|
+
it 'should make a request to save model with id and return true without errors' do
|
163
|
+
subject.save.should be(true)
|
164
|
+
subject.kalibro_errors.should be_empty
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe KalibroEntities::Entities::StackTraceElement do
|
20
|
+
describe 'line_number=' do
|
21
|
+
it 'should set the line_number' do
|
22
|
+
subject.line_number = 42
|
23
|
+
subject.line_number.should eq(42)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
require 'spec_helper'
|
18
|
+
|
19
|
+
describe KalibroEntities::Entities::Throwable do
|
20
|
+
let(:stack_trace_element) { FactoryGirl.build(:stack_trace_element) }
|
21
|
+
|
22
|
+
describe 'stack_trace_element=' do
|
23
|
+
it 'should set the stack trace element' do
|
24
|
+
subject.stack_trace_element = stack_trace_element.to_hash
|
25
|
+
subject.stack_trace_element.should eq([stack_trace_element])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'stack_trace' do
|
30
|
+
it 'should return the stack trace element' do
|
31
|
+
subject.stack_trace_element = stack_trace_element.to_hash
|
32
|
+
subject.stack_trace.should eq([stack_trace_element])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'stack_trace=' do
|
37
|
+
it 'should set the stack trace element' do
|
38
|
+
subject.stack_trace = [stack_trace_element]
|
39
|
+
subject.stack_trace_element.should eq([stack_trace_element])
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'cause=' do
|
44
|
+
let(:another_throwable) { FactoryGirl.build(:throwable) }
|
45
|
+
|
46
|
+
it 'should set the cause' do
|
47
|
+
subject.cause = another_throwable.to_hash
|
48
|
+
subject.cause.should eq(another_throwable)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :base_tool, class: KalibroEntities::Entities::BaseTool do
|
19
|
+
name "Analizo"
|
20
|
+
description "Analizo is a suite of source code analysis tools."
|
21
|
+
collector_class_name "org.analizo.AnalizoMetricCollector"
|
22
|
+
supported_metric { [FactoryGirl.build(:metric), FactoryGirl.build(:metric)] }
|
23
|
+
|
24
|
+
trait :another_base_tool do
|
25
|
+
name "Avalio"
|
26
|
+
description "Avalio is another source code analyser that hasn't been developed yet."
|
27
|
+
end
|
28
|
+
|
29
|
+
factory :another_base_tool, traits: [:another_base_tool]
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :configuration, class: KalibroEntities::Entities::Configuration do
|
19
|
+
id 1
|
20
|
+
name "Java"
|
21
|
+
description "Code metrics for Java."
|
22
|
+
end
|
23
|
+
|
24
|
+
factory :another_configuration, class: KalibroEntities::Entities::Configuration do
|
25
|
+
id 12
|
26
|
+
name "Perl"
|
27
|
+
description "Code metrics for Perl."
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :date_metric_result, class: KalibroEntities::Entities::DateMetricResult do
|
19
|
+
date "2013-10-16T18:26:43.151+00:00"
|
20
|
+
metric_result { FactoryGirl.build(:metric_result) }
|
21
|
+
|
22
|
+
trait :another_date do
|
23
|
+
date "2013-05-06T06:26:43.151+00:00"
|
24
|
+
end
|
25
|
+
|
26
|
+
factory :another_date_metric_result, traits: [:another_date]
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :date_module_result, class: KalibroEntities::Entities::DateModuleResult do
|
19
|
+
date "2011-10-20T18:26:43.151+00:00"
|
20
|
+
module_result {FactoryGirl.build(:module_result)}
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :metric_configuration, class: KalibroEntities::Entities::MetricConfiguration do
|
19
|
+
id 1
|
20
|
+
code 'code'
|
21
|
+
metric {FactoryGirl.build(:metric)}
|
22
|
+
base_tool_name "Analizo"
|
23
|
+
weight 1
|
24
|
+
aggregation_form "AVERAGE"
|
25
|
+
reading_group_id 1
|
26
|
+
configuration_id 1
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :metric_configuration_snapshot, class: KalibroEntities::Entities::MetricConfigurationSnapshot do
|
19
|
+
code "code"
|
20
|
+
weight "1.0"
|
21
|
+
aggregation_form 'AVERAGE'
|
22
|
+
metric {FactoryGirl.build(:metric)}
|
23
|
+
base_tool_name "Analizo"
|
24
|
+
range {FactoryGirl.build(:range_snapshot)}
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :metric_result, class: KalibroEntities::Entities::MetricResult do
|
19
|
+
id "42"
|
20
|
+
self.configuration { FactoryGirl.build(:metric_configuration_snapshot) }
|
21
|
+
value "10.0"
|
22
|
+
aggregated_value "21"
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This file is part of KalibroEntities
|
2
|
+
# Copyright (C) 2013 it's respectives authors (please see the AUTHORS file)
|
3
|
+
#
|
4
|
+
# This program is free software: you can redistribute it and/or modify
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
6
|
+
# the Free Software Foundation, either version 3 of the License, or
|
7
|
+
# (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU General Public License for more details.
|
13
|
+
|
14
|
+
# You should have received a copy of the GNU General Public License
|
15
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
|
17
|
+
FactoryGirl.define do
|
18
|
+
factory :metric, class: KalibroEntities::Entities::Metric do
|
19
|
+
name "Total Abstract Classes"
|
20
|
+
compound false
|
21
|
+
scope "SOFTWARE"
|
22
|
+
description nil
|
23
|
+
script ""
|
24
|
+
language ["C", "CPP", "JAVA"]
|
25
|
+
end
|
26
|
+
|
27
|
+
factory :loc, class: KalibroEntities::Entities::Metric do
|
28
|
+
name "Lines of Code"
|
29
|
+
compound false
|
30
|
+
scope "CLASS"
|
31
|
+
description nil
|
32
|
+
script ""
|
33
|
+
language ["C", "CPP", "JAVA"]
|
34
|
+
end
|
35
|
+
end
|