kalibro_client 1.4.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -6
  3. data/features/kalibro_range/find.feature +1 -1
  4. data/features/kalibro_range/update.feature +1 -2
  5. data/features/metric_result/hotspot_related_results.feature +17 -0
  6. data/features/metric_result/{descendant_values.feature → tree/descendant_values.feature} +0 -0
  7. data/features/metric_result/{history_of.feature → tree/history_of.feature} +0 -0
  8. data/features/step_definitions/hotspot_metric_result_step.rb +15 -0
  9. data/features/step_definitions/metric_result_steps.rb +3 -3
  10. data/features/step_definitions/processing_steps.rb +5 -7
  11. data/features/step_definitions/repository_steps.rb +5 -0
  12. data/lib/kalibro_client/entities.rb +3 -1
  13. data/lib/kalibro_client/entities/base.rb +45 -44
  14. data/lib/kalibro_client/entities/configurations/metric_configuration.rb +7 -3
  15. data/lib/kalibro_client/entities/processor/hotspot_metric_result.rb +41 -0
  16. data/lib/kalibro_client/entities/processor/metric_result.rb +12 -32
  17. data/lib/kalibro_client/entities/processor/module_result.rb +20 -2
  18. data/lib/kalibro_client/entities/processor/tree_metric_result.rb +54 -0
  19. data/lib/kalibro_client/errors.rb +3 -1
  20. data/lib/kalibro_client/errors/record_invalid.rb +19 -0
  21. data/lib/kalibro_client/errors/record_not_found.rb +2 -2
  22. data/lib/kalibro_client/errors/request_error.rb +27 -0
  23. data/lib/kalibro_client/helpers/aggregation_options.rb +1 -1
  24. data/lib/kalibro_client/version.rb +1 -1
  25. data/spec/entities/base_spec.rb +292 -201
  26. data/spec/entities/configurations/metric_configuration_spec.rb +1 -1
  27. data/spec/entities/processor/hotspot_metric_result_spec.rb +49 -0
  28. data/spec/entities/processor/metric_result_spec.rb +31 -89
  29. data/spec/entities/processor/module_result_spec.rb +90 -61
  30. data/spec/entities/processor/tree_metric_result_spec.rb +128 -0
  31. data/spec/errors/record_invalid_spec.rb +45 -0
  32. data/spec/factories/hotspot_metric_results.rb +24 -0
  33. data/spec/factories/metric_configurations.rb +1 -1
  34. data/spec/factories/metric_results.rb +0 -1
  35. data/spec/factories/tree_metric_results.rb +24 -0
  36. data/spec/helpers/aggregation_options_spec.rb +1 -1
  37. metadata +24 -6
@@ -0,0 +1,45 @@
1
+ # This file is part of KalibroClient
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 KalibroClient::Errors::RecordInvalid do
20
+ describe 'initialize' do
21
+ let(:default_message){ "Record invalid" }
22
+
23
+ context 'without a record' do
24
+ subject { KalibroClient::Errors::RecordInvalid.new }
25
+
26
+ it 'is expected to have the default message' do
27
+ expect(subject.message).to eq(default_message)
28
+ end
29
+ end
30
+
31
+ context 'with a given record' do
32
+ let!(:record) { mock('record') }
33
+ let!(:kalibro_errors) { ['Kalibro', 'Error'] }
34
+ subject { KalibroClient::Errors::RecordInvalid.new(record) }
35
+
36
+ before :each do
37
+ record.expects(:kalibro_errors).returns(kalibro_errors)
38
+ end
39
+
40
+ it 'is expected to return the default message concatenated with the errors' do
41
+ expect(subject.message).to eq("#{default_message}: #{kalibro_errors.join(', ')}")
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,24 @@
1
+ # This file is part of KalibroClient
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 :hotspot_metric_result, class: KalibroClient::Entities::Processor::HotspotMetricResult do
19
+ metric_configuration { FactoryGirl.build(:metric_configuration, :with_id) }
20
+ line_number 1
21
+ message "1) Similar code found in :module (mass = 154)"
22
+ end
23
+ end
24
+
@@ -18,7 +18,7 @@ FactoryGirl.define do
18
18
  factory :metric_configuration, class: KalibroClient::Entities::Configurations::MetricConfiguration do
19
19
  metric { FactoryGirl.build(:loc) }
20
20
  weight 1
21
- aggregation_form "AVERAGE"
21
+ aggregation_form "mean"
22
22
  reading_group_id 1
23
23
  kalibro_configuration_id 1
24
24
 
@@ -19,6 +19,5 @@ FactoryGirl.define do
19
19
  id "42"
20
20
  metric_configuration_id { FactoryGirl.build(:metric_configuration_with_id).id }
21
21
  value "10.0"
22
- aggregated_value "21"
23
22
  end
24
23
  end
@@ -0,0 +1,24 @@
1
+ # This file is part of KalibroClient
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 :tree_metric_result, class: KalibroClient::Entities::Processor::TreeMetricResult do
19
+ id "42"
20
+ metric_configuration_id { FactoryGirl.build(:metric_configuration_with_id).id }
21
+ value "10.0"
22
+ aggregated_value "21"
23
+ end
24
+ end
@@ -23,7 +23,7 @@ describe 'all_with_label' do
23
23
  it 'should return the list of aggregation methods available' do
24
24
  expect(all_with_label).to eq(
25
25
  [
26
- ["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"],
26
+ ["Mean","mean"], ["Median", "MEDIAN"], ["Maximum", "max"], ["Minimum", "min"],
27
27
  ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]
28
28
  ]
29
29
  )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kalibro_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Quadros Miranda
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-09-14 00:00:00.000000000 Z
14
+ date: 2015-09-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -206,9 +206,10 @@ files:
206
206
  - features/metric_configuration/destroy.feature
207
207
  - features/metric_configuration/find.feature
208
208
  - features/metric_configuration/metric_configurations_of.feature
209
- - features/metric_result/descendant_values.feature
210
- - features/metric_result/history_of.feature
209
+ - features/metric_result/hotspot_related_results.feature
211
210
  - features/metric_result/metric_results_of.feature
211
+ - features/metric_result/tree/descendant_values.feature
212
+ - features/metric_result/tree/history_of.feature
212
213
  - features/module_result/children.feature
213
214
  - features/module_result/find.feature
214
215
  - features/module_result/history_of.feature
@@ -246,6 +247,7 @@ files:
246
247
  - features/repository/processing/processing_with_date.feature
247
248
  - features/repository/types.feature
248
249
  - features/statistic/metric_percentage.feature
250
+ - features/step_definitions/hotspot_metric_result_step.rb
249
251
  - features/step_definitions/kalibro_configuration_steps.rb
250
252
  - features/step_definitions/metric_collector_details_steps.rb
251
253
  - features/step_definitions/metric_configuration_steps.rb
@@ -282,6 +284,7 @@ files:
282
284
  - lib/kalibro_client/entities/miscellaneous/metric.rb
283
285
  - lib/kalibro_client/entities/miscellaneous/native_metric.rb
284
286
  - lib/kalibro_client/entities/processor/base.rb
287
+ - lib/kalibro_client/entities/processor/hotspot_metric_result.rb
285
288
  - lib/kalibro_client/entities/processor/kalibro_module.rb
286
289
  - lib/kalibro_client/entities/processor/metric_collector_details.rb
287
290
  - lib/kalibro_client/entities/processor/metric_result.rb
@@ -290,8 +293,11 @@ files:
290
293
  - lib/kalibro_client/entities/processor/processing.rb
291
294
  - lib/kalibro_client/entities/processor/project.rb
292
295
  - lib/kalibro_client/entities/processor/repository.rb
296
+ - lib/kalibro_client/entities/processor/tree_metric_result.rb
293
297
  - lib/kalibro_client/errors.rb
298
+ - lib/kalibro_client/errors/record_invalid.rb
294
299
  - lib/kalibro_client/errors/record_not_found.rb
300
+ - lib/kalibro_client/errors/request_error.rb
295
301
  - lib/kalibro_client/errors/standard.rb
296
302
  - lib/kalibro_client/helpers/aggregation_options.rb
297
303
  - lib/kalibro_client/helpers/date_attributes.rb
@@ -325,6 +331,7 @@ files:
325
331
  - spec/entities/miscellaneous/metric_spec.rb
326
332
  - spec/entities/miscellaneous/native_metric_spec.rb
327
333
  - spec/entities/processor/base_spec.rb
334
+ - spec/entities/processor/hotspot_metric_result_spec.rb
328
335
  - spec/entities/processor/kalibro_module_spec.rb
329
336
  - spec/entities/processor/metric_collector_details_spec.rb
330
337
  - spec/entities/processor/metric_result_spec.rb
@@ -333,9 +340,12 @@ files:
333
340
  - spec/entities/processor/processing_spec.rb
334
341
  - spec/entities/processor/project_spec.rb
335
342
  - spec/entities/processor/repository_spec.rb
343
+ - spec/entities/processor/tree_metric_result_spec.rb
344
+ - spec/errors/record_invalid_spec.rb
336
345
  - spec/factories/date_metric_results.rb
337
346
  - spec/factories/date_module_results.rb
338
347
  - spec/factories/granularities.rb
348
+ - spec/factories/hotspot_metric_results.rb
339
349
  - spec/factories/kalibro_configurations.rb
340
350
  - spec/factories/kalibro_module.rb
341
351
  - spec/factories/kalibro_ranges.rb
@@ -352,6 +362,7 @@ files:
352
362
  - spec/factories/reading_groups.rb
353
363
  - spec/factories/readings.rb
354
364
  - spec/factories/repositories.rb
365
+ - spec/factories/tree_metric_results.rb
355
366
  - spec/helpers/aggregation_options_spec.rb
356
367
  - spec/helpers/date_attributes_spec.rb
357
368
  - spec/helpers/hash_converters_spec.rb
@@ -405,9 +416,10 @@ test_files:
405
416
  - features/metric_configuration/destroy.feature
406
417
  - features/metric_configuration/find.feature
407
418
  - features/metric_configuration/metric_configurations_of.feature
408
- - features/metric_result/descendant_values.feature
409
- - features/metric_result/history_of.feature
419
+ - features/metric_result/hotspot_related_results.feature
410
420
  - features/metric_result/metric_results_of.feature
421
+ - features/metric_result/tree/descendant_values.feature
422
+ - features/metric_result/tree/history_of.feature
411
423
  - features/module_result/children.feature
412
424
  - features/module_result/find.feature
413
425
  - features/module_result/history_of.feature
@@ -445,6 +457,7 @@ test_files:
445
457
  - features/repository/processing/processing_with_date.feature
446
458
  - features/repository/types.feature
447
459
  - features/statistic/metric_percentage.feature
460
+ - features/step_definitions/hotspot_metric_result_step.rb
448
461
  - features/step_definitions/kalibro_configuration_steps.rb
449
462
  - features/step_definitions/metric_collector_details_steps.rb
450
463
  - features/step_definitions/metric_configuration_steps.rb
@@ -478,6 +491,7 @@ test_files:
478
491
  - spec/entities/miscellaneous/metric_spec.rb
479
492
  - spec/entities/miscellaneous/native_metric_spec.rb
480
493
  - spec/entities/processor/base_spec.rb
494
+ - spec/entities/processor/hotspot_metric_result_spec.rb
481
495
  - spec/entities/processor/kalibro_module_spec.rb
482
496
  - spec/entities/processor/metric_collector_details_spec.rb
483
497
  - spec/entities/processor/metric_result_spec.rb
@@ -486,9 +500,12 @@ test_files:
486
500
  - spec/entities/processor/processing_spec.rb
487
501
  - spec/entities/processor/project_spec.rb
488
502
  - spec/entities/processor/repository_spec.rb
503
+ - spec/entities/processor/tree_metric_result_spec.rb
504
+ - spec/errors/record_invalid_spec.rb
489
505
  - spec/factories/date_metric_results.rb
490
506
  - spec/factories/date_module_results.rb
491
507
  - spec/factories/granularities.rb
508
+ - spec/factories/hotspot_metric_results.rb
492
509
  - spec/factories/kalibro_configurations.rb
493
510
  - spec/factories/kalibro_module.rb
494
511
  - spec/factories/kalibro_ranges.rb
@@ -505,6 +522,7 @@ test_files:
505
522
  - spec/factories/reading_groups.rb
506
523
  - spec/factories/readings.rb
507
524
  - spec/factories/repositories.rb
525
+ - spec/factories/tree_metric_results.rb
508
526
  - spec/helpers/aggregation_options_spec.rb
509
527
  - spec/helpers/date_attributes_spec.rb
510
528
  - spec/helpers/hash_converters_spec.rb