diff --git a/plugins/mezuro/AUTHORS b/plugins/mezuro/AUTHORS
deleted file mode 100644
index b344249..0000000
--- a/plugins/mezuro/AUTHORS
+++ /dev/null
@@ -1,42 +0,0 @@
-Mezuro Authors
-==============
-
-Copyright 2010-2013
--------------------
-
- Almir Alves Pereira (almir.sne at gmail.com)
- Alessandro Palmeira (alessandro.palmeira at gmail.com)
- Andre Casimiro (ah.casimiro at gmail.com)
- Antonio Terceiro (terceiro at colivre.coop.br)
- Caio Salgado (caio.csalgado at gmail.com)
- Carlos Morais (carlos88morais at gmail.com)
- Daniel Alves (danpaulalves at gmail.com)
- Daniela Feitosa (daniela at colivre.coop.br)
- Diego Araújo (diegoamc90 at gmail.com)
- Everton Santos (everton2x4 at gmail.com)
- Guilherme Rojas (guilhermehrojas at gmail.com)
- Jefferson Fernandes (jeffs.fernandes at gmail.com)
- Joao Machini (joao.machini at gmail.com)
- João da Silva (jaodsilv@linux.ime.usp.br)
- Paulo Meirelles (paulo at softwarelivre.org)
- Pedro Leal (pedrombl at gmail.com)
- Rafael Manso (rr.manzo at gmail.com)
- Rafael Messias (rmmartins at gmail.com)
- Renan Teruo (renanteruoc at gmail.com)
- Rodrigo Souto (rodrigo at colivre.coop.br)
-
-Collaborators (from USP Lab XP course 2010 on another code)
------------------------------------------------------------
-
- Ana Paula Oliveira dos Santos (anapaulao.santos at gmail.com)
- Lucianna Almeida (lucianna.th at gmail.com)
- Thiago Colucci (ticolucci at gmail.com)
- Vinicius Daros (vinicius.k.daros at gmail.com)
- Viviane Almeida Santos (viviane.almeida at gmail.com)
-
-Advisors
---------
-
- Fabio Kon (fabio.kon at ime.usp.br)
- Alfredo Goldman (gold at ime.usp.br)
-
diff --git a/plugins/mezuro/README.md b/plugins/mezuro/README.md
deleted file mode 100644
index e50092e..0000000
--- a/plugins/mezuro/README.md
+++ /dev/null
@@ -1,144 +0,0 @@
-README - Mezuro Plugin
-======================
-
-Mezuro is a source code tracking platform based on Noosfero social networking
-platform with Mezuro Plugin actived to access Kalibro Web Service.
-
-
-INSTALL
-=======
-
-Dependences
------------
-
-See the Noosfero INSTALL (and HACKING) file. After install Noosfero, you must
-install Mezuro dependences:
-
-$ gem install --no-ri --no-rdoc nokogiri -v 1.5.0
-$ gem install --no-ri --no-rdoc wasabi -v 2.0.0
-$ gem install --no-ri --no-rdoc savon -v 0.9.7
-$ gem install --no-ri --no-rdoc googlecharts
-
-$ gem uninstall rack
-$ gem install --no-ri --no-rdoc rack -v 1.0.1
-
-
-*with RVM*
-
-if you want to use RVM (Ruby Version Manager) environment, just run:
-
-$ plugins/mezuro/script/install/install-rvm.sh
-
-
-Enable Mezuro Plugin
---------------------
-
-Also, you need to enable Mezuro Plugin at your Noosfero installation:
-
-cd This Configuration doesn't exist on the Web Service. Do you want to <%= link_to 'delete', :action => 'destroy', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %> or <%= link_to 'save it again', :action => 'edit', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %>? This project doesn't exist on the Web Service. Do you want to <%= link_to 'delete', :action => 'destroy', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %> or <%= link_to 'save it again', :action => 'edit', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %>? This reading group doesn't exist on the Web Service. Do you want to <%= link_to 'delete', :action => 'destroy', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %> or <%= link_to 'save it again', :action => 'edit', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %>? <%= f.submit "Save" %> <%= f.submit "Save" %>
- Collector Name: <%= @metric_configuration.base_tool_name %>
-
- Metric Name: <%= @metric.name %>
-
- Code: <%= @metric_configuration.code %>
-
- Aggregation Form: <%= @metric_configuration.aggregation_form %>
-
- Weight: <%= @metric_configuration.weight %>
-
-
You'll receive an e-mail when it's ready!");
- showProcessingAfter(20);
- }
-}
-
-function showProcessingAfter(seconds){
- if (seconds > 0){
- setTimeout(function() { showProcessingAfter(seconds - 10);}, 10000);
- } else {
- showProcessing();
- }
-}
-
-function showReadyProcessing(content) {
- jQuery('#processing').html(content);
-}
-
-function showModuleResult(content){
- jQuery('#module-result').html(content);
-}
-
-function callAction(controller, action, params, callback){
- var profile = processingData('profile');
- var content = processingData('content');
- var endpoint = '/profile/' + profile + '/plugin/mezuro/' + controller + '/' + action + '/' + content;
- jQuery.get(endpoint, params, callback);
-}
-
-function processingData(data){
- return jQuery('#processing').attr('data-' + data);
-}
-
-function showLoadingProcess(firstLoad){
- if(firstLoad)
- showReadyProcessing("");
- showModuleResult("
");
-}
-
-function sourceNodeToggle(id){
- var suffixes = ['_hidden', '_plus', '_minus'];
- for (var i in suffixes)
- jQuery('#' + id + suffixes[i]).toggle();
-}
diff --git a/plugins/mezuro/public/javascripts/validations.js b/plugins/mezuro/public/javascripts/validations.js
deleted file mode 100644
index cde27d3..0000000
--- a/plugins/mezuro/public/javascripts/validations.js
+++ /dev/null
@@ -1,181 +0,0 @@
-jQuery(function (){
- jQuery('#range_submit').live("click", validate_new_range_configuration);
- jQuery('#metric_configuration_submit').live("click", validate_metric_configuration);
- jQuery('#repository_submit').live("click", validate_new_repository);
- jQuery('#reading_submit').live("click", validate_new_reading);
-});
-
-function validate_code(code){
- return true;
-}
-
-function allRequiredFieldsAreFilled() {
- var name = jQuery('#repository_name').val();
- var address = jQuery('#repository_address').val();
-
- if (is_null(name) || is_null(address)) {
- alert("Please fill all fields marked with (*).");
- return false;
- }
- return true;
-}
-
-function validate_new_reading() {
- var name = jQuery('#reading_label').val();
- var grade = jQuery('#reading_grade').val();
- var color = jQuery('#reading_color').val();
-
- if (is_null(name) || is_null(grade) || is_null(color)){
- alert("Please fill all fields marked with (*).");
- return false;
- }
-
- var parser = jQuery('#labels_and_grades').attr('data-parser');
- var labels_and_grades = jQuery('#labels_and_grades').attr('data-list').split(parser);
- for (var id = 0; id < labels_and_grades.length; id = id + 2) {
- if (labels_and_grades[id] == name) {
- alert("This label already exists! Please, choose another one.");
- return false;
- }
-
- if (labels_and_grades[id+1] == grade || labels_and_grades[id+1] == grade + ".0") {
- alert("This grade already exists! Please, choose another one.");
- return false;
- }
- }
-
- if (!color.match(/^[a-fA-F0-9]{6}$/)) {
- alert("This is not a valid color.");
- return false;
- }
- return true;
-}
-
-function validate_new_repository() {
- if (allRequiredFieldsAreFilled()) {
- return addressAndTypeMatch();
- }
- return false;
-}
-
-function addressAndTypeMatch() {
- var type = jQuery('#repository_type').val();
- var address = jQuery('#repository_address').val();
-
- switch (type) {
- case "BAZAAR": return matchBazaar(address);
- case "CVS": return matchCVS(address);
- case "GIT": return matchGIT(address);
- case "MERCURIAL": return matchMercurial(address);
- case "REMOTE_TARBALL": return matchRemoteTarball(address);
- case "REMOTE_ZIP": return matchRemoteZIP(address);
- case "SUBVERSION": return matchSubversion(address);
- }
-}
-
-function matchBazaar(address) {
- if (address.match(/bzr/)) {
- return true;
- }
- alert("Address does not match type BAZAAR chosen.");
- return false;
-}
-
-function matchCVS(address) {
- if (address.match(/cvs/)) {
- return true;
- }
- alert("Address does not match type CVS chosen.");
- return false;
-}
-
-function matchGIT(address) {
- if (address.match(/^(http(s)?:\/\/git(hub)?\.|git:\/\/git(hub\.com|orious\.org)\/|git@git(hub\.com|orious\.org):).+.git$/)) {
- return true;
- }
- alert("Address does not match type GIT chosen.");
- return false;
-}
-
-function matchMercurial(address) {
- if (address.match(/^(http(s)?|ssh):\/\/.*hg/)) {
- return true;
- }
- alert("Address does not match type MERCURIAL chosen.");
- return false;
-}
-
-function matchRemoteTarball(address) {
- if (address.match(/\.tar(\..+)*$/)) {
- return true;
- }
- alert("Address does not match type REMOTE_TARBALL chosen.");
- return false;
-}
-
-function matchRemoteZIP(address) {
- if (address.match(/\.zip$/)) {
- return true;
- }
- alert("Address does not match type REMOTE_ZIP chosen.");
- return false;
-}
-
-function matchSubversion(address) {
- if (address.match(/^http(s)?:\/\/.+\/svn.+$/)) {
- return true;
- }
- alert("Address does not match type SUBVERSION chosen.");
- return false;
-}
-
-function validate_metric_configuration() {
- var code = jQuery('#metric_configuration_code').val();
- if (is_null(code)) {
- alert("Code must be filled out");
- return false;
- }
- return true;
-}
-
-function is_null(value) {
- if (value == "" || value == null) {
- return true;
- }
- return false;
-}
-
-function IsNotNumeric(value) {
- if (value.match(/[0-9]*\.?[0-9]+/)) {
- return false;
- }
- return true;
-}
-
-function IsNotInfinite(value) {
- if (value.match(/INF/)) {
- return false;
- }
- return true;
-}
-
-function validate_new_range_configuration(event) {
- var beginning = jQuery("#range_beginning").val();
- var end = jQuery("#range_end").val();
-
- if (is_null(beginning) || is_null(end)) {
- alert("Please fill all fields marked with (*).");
- return false;
- }
- if ( (IsNotNumeric(beginning) && IsNotInfinite(beginning)) || (IsNotNumeric(end) && IsNotInfinite(end))) {
- alert("Beginning, End and Grade must be numeric values.");
- return false;
- }
- if (parseInt(beginning) > parseInt(end)) {
- if (IsNotInfinite(beginning) && IsNotInfinite(end)) {
- alert("End must be greater than Beginning.");
- return false;
- }
- }
- return true;
-}
diff --git a/plugins/mezuro/public/style.css b/plugins/mezuro/public/style.css
deleted file mode 100644
index 9f17144..0000000
--- a/plugins/mezuro/public/style.css
+++ /dev/null
@@ -1,37 +0,0 @@
-@import url('colorPicker.css');
-
-.link {
- cursor: pointer;
-}
-
-.source-tree{
- background: #e7e7e7;
- border: groove 1px #666;
-}
-
-.icon {
- width: 20px;
-}
-
-.source-tree-text{
- font-family: Arial, Impact;
- font-size: 12px;
- border-left: solid 1px #666;
-}
-
-a:link,active,visited .ancestor{
- font-family: Arial, Impact;
- color: #5E5400;
-}
-
-.path{
- font-family: Arial, Impact;
- font-size: 14px;
- font-style: underline;
- display: inline;
-}
-
-.controller-profile_editor a.control-panel-mezuro,
- .controller-profile_editor .msie6 a.control-panel-mezuro {
- background-image: url(/plugins/mezuro/icons/mezuro.png)
-}
diff --git a/plugins/mezuro/script/install/install-rvm.sh b/plugins/mezuro/script/install/install-rvm.sh
deleted file mode 100644
index 152ef12..0000000
--- a/plugins/mezuro/script/install/install-rvm.sh
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/bin/bash --login
-
-#Ubuntu Package Dependencies
-sudo apt-get update
-sudo apt-get install build-essential curl libxslt1-dev git git-core tango-icon-theme sqlite3 libsqlite3-dev patch bzip2 openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev openjdk-6-jre
-
-#RVM Installation for Ubuntu 12.10
-curl -L https://get.rvm.io | bash -s stable --autolibs=enabled --version 1.19.0
-
-# Load RVM into a shell session *as a function*
-if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
- # First try to load from a user install
- source "$HOME/.rvm/scripts/rvm"
-elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
- # Then try to load from a root install
- source "/usr/local/rvm/scripts/rvm"
-else
- printf "ERROR: An RVM installation was not found.\n"
-fi
-rvm reload
-
-#Complements the RVM installation
-rvm requirements run
-#rvm pkg install zlib --verify-downloads 1
-
-#Ruby installation and setup
-CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rvm install 1.8.7-p302
-rvm use ruby-1.8.7-p302@global
-gem install rubygems-update -v 1.3.7
-update_rubygems
-gem install rake -v 0.8.7
-yes | gem uninstall rake -v 10.0.4
-rvm gemset create mezuro
-rvm use ruby-1.8.7-p302@mezuro
-
-#Gems installation
-#The order really matters here, so if you see an output like "2 gems instaled" something should be wrong
-gem install --no-ri --no-rdoc rack -v 1.0.1
-gem install --no-ri --no-rdoc rack-test -v 0.6.2
-gem install --no-ri --no-rdoc httpi -v 1.0
-gem install --no-ri --no-rdoc nokogiri -v 1.5.5
-gem install --no-ri --no-rdoc wasabi -v 2.0.0
-gem install --no-ri --no-rdoc json -v 1.7.5
-gem install --no-ri --no-rdoc gherkin -v 2.5.4
-gem install --no-ri --no-rdoc multi_json -v 1.3.7
-gem install --no-ri --no-rdoc rubyzip -v 0.9.9
-gem install --no-ri --no-rdoc ffi -v 1.2.0
-gem install --no-ri --no-rdoc childprocess -v 0.3.6
-gem install --no-ri --no-rdoc websocket -v 1.0.4
-gem install --no-ri --no-rdoc libwebsocket -v 0.1.6.1
-gem install --no-ri --no-rdoc selenium-webdriver -v 2.30.0
-gem install --no-ri --no-rdoc activesupport -v 2.3.5
-gem install --no-ri --no-rdoc actionpack -v 2.3.5
-gem install --no-ri --no-rdoc actionmailer -v 2.3.5
-gem install --no-ri --no-rdoc activerecord -v 2.3.5
-gem install --no-ri --no-rdoc activeresource -v 2.3.5
-gem install --no-ri --no-rdoc addressable -v 2.2.2
-gem install --no-ri --no-rdoc builder -v 3.1.4
-gem install --no-ri --no-rdoc gyoku -v 0.4.6
-gem install --no-ri --no-rdoc akami -v 1.2.0
-gem install --no-ri --no-rdoc xpath -v 0.1.4
-gem install --no-ri --no-rdoc mime-types -v 1.19
-gem install --no-ri --no-rdoc capybara -v 1.1.1
-gem install --no-ri --no-rdoc term-ansicolor -v 1.0.7
-gem install --no-ri --no-rdoc diff-lcs -v 1.1.3
-gem install --no-ri --no-rdoc cucumber -v 1.1.0
-gem install --no-ri --no-rdoc cucumber-rails -v 0.3.2
-gem install --no-ri --no-rdoc culerity -v 0.2.15
-gem install --no-ri --no-rdoc database_cleaner -v 0.9.1
-gem install --no-ri --no-rdoc exception_notification -v 1.0.20090728
-gem install --no-ri --no-rdoc googlecharts -v 1.6.8
-gem install --no-ri --no-rdoc hpricot -v 0.8.2
-gem install --no-ri --no-rdoc httpi -v 0.9.7
-gem install --no-ri --no-rdoc i18n -v 0.4.1
-gem install --no-ri --no-rdoc metaclass -v 0.0.1
-gem install --no-ri --no-rdoc mocha -v 0.9.8
-gem install --no-ri --no-rdoc nori -v 1.1.3
-gem install --no-ri --no-rdoc ntlm-http -v 0.1.1
-gem install --no-ri --no-rdoc polyglot -v 0.3.3
-gem install --no-ri --no-rdoc rails -v 2.3.5
-gem install --no-ri --no-rdoc rcov -v 0.9.7.1
-gem install --no-ri --no-rdoc RedCloth -v 4.2.2
-gem install --no-ri --no-rdoc rspec -v 1.2.9
-gem install --no-ri --no-rdoc rspec-rails -v 1.2.9
-gem install --no-ri --no-rdoc savon -v 0.9.7
-gem install --no-ri --no-rdoc Selenium -v 1.1.14
-gem install --no-ri --no-rdoc selenium-client -v 1.2.18
-gem install --no-ri --no-rdoc sqlite3 -v 1.3.6
-gem install --no-ri --no-rdoc system_timer -v 1.2.4
-gem install --no-ri --no-rdoc tango -v 0.1.15
-gem install --no-ri --no-rdoc tidy -v 1.1.2
-gem install --no-ri --no-rdoc treetop -v 1.4.10
-gem install --no-ri --no-rdoc webrat -v 0.5.1
-gem install --no-ri --no-rdoc will_paginate -v 2.3.12
-gem install --no-ri --no-rdoc gettext -v 1.8.0
-
-#Mezuro installation
-git clone git@gitorious.org:+mezuro/noosfero/mezuro.git
-cd mezuro
-git checkout mezuro-dev
-rvm use ruby-1.8.7-p302@mezuro
-cp config/database.yml.sqlite3 config/database.yml
-cp plugins/mezuro/service.yml.example plugins/mezuro/service.yml
-cp plugins/mezuro/licenses.yml.example plugins/mezuro/licenses.yml
-mkdir tmp
-rake db:schema:load
-rake db:migrate
-rake makemo
-./script/sample-data
-./script/noosfero-plugins enable mezuro
-cd public/designs/themes
-rm -f default
-git clone https://git.gitorious.org/mezuro/mezuro-theme.git
-ln -s mezuro-theme/ default
-cd ../../../
-
-#Prepare Mezuro for running functional and unit tests
-rake db:test:prepare
diff --git a/plugins/mezuro/script/tests/delete_all_kalibro_entries.sh b/plugins/mezuro/script/tests/delete_all_kalibro_entries.sh
deleted file mode 100755
index e2f25d9..0000000
--- a/plugins/mezuro/script/tests/delete_all_kalibro_entries.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-source plugins/mezuro/script/tests/kalibro_scripts.conf
-
-sudo su postgres -c "export PGPASSWORD=$PASSWORD && psql -q -d $DATABASE -f $QUERYFILE"
diff --git a/plugins/mezuro/script/tests/kalibro_scripts.conf b/plugins/mezuro/script/tests/kalibro_scripts.conf
deleted file mode 100644
index bf0d172..0000000
--- a/plugins/mezuro/script/tests/kalibro_scripts.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-# Definition of constants used in kalibro scripts.
-
-PSQLFILE=/tmp/PostgreSQL.sql
-DATABASE="kalibro_test"
-PASSWORD="kalibro"
-QUERYFILE=/tmp/query
\ No newline at end of file
diff --git a/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh b/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh
deleted file mode 100755
index f88c008..0000000
--- a/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-source plugins/mezuro/script/tests/kalibro_scripts.conf
-if ! [ -f $PSQLFILE ]
- then wget http://gitorious.org/kalibro/kalibro/blobs/raw/master/KalibroCore/src/META-INF/PostgreSQL.sql -O $PSQLFILE
-fi
-
-DROPLIMIT="END OF DROP TABLES"
-RANGE=$(grep -n "$DROPLIMIT" $PSQLFILE | cut -d":" -f1)
-START=1
-END=$(($RANGE - 1))
-CUT=$START,$END\!d
-REPLACE="s/DROP TABLE IF EXISTS sequences,/TRUNCATE/"
-
-if [ -f $QUERYFILE ]
- then sudo rm $QUERYFILE
-fi
-
-sed -e "$CUT" -e "$REPLACE" $PSQLFILE > $QUERYFILE
-sudo chown postgres.postgres $QUERYFILE
\ No newline at end of file
diff --git a/plugins/mezuro/script/tests/run_acceptance_tests.sh b/plugins/mezuro/script/tests/run_acceptance_tests.sh
deleted file mode 100755
index 4b211bf..0000000
--- a/plugins/mezuro/script/tests/run_acceptance_tests.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-TEST_FILE=$1
-PROFILE=$2
-
-if [ -z "$PROFILE" ]; then
- PROFILE='default'
-fi
-
-# where are your .kalibro dir?
-KALIBRO_HOME='/usr/share/tomcat6/.kalibro'
-
-# create a kalibro test dir
-echo "--> Creating tests directory"
-sudo mkdir $KALIBRO_HOME/tests
-echo "--> Copying test settings"
-sudo cp $KALIBRO_HOME/kalibro_test.settings $KALIBRO_HOME/tests/kalibro.settings
-echo "--> Changing owner of tests directory to tomcat6"
-sudo chown -R tomcat6:tomcat6 $KALIBRO_HOME/tests
-
-# you must restart tomcat6
-#if you are using a tomcat installed from apt-get, for example:
-sudo service tomcat6 restart
-
-#if you are using a tomcat installed a specific dir, for exemple:
-#~/tomcat6/bin/shoutdown.sh
-#~/tomcat6/bin/startup.sh
-
-# run test
-cucumber $TEST_FILE -p $PROFILE
-
-#back to normal mode
-echo "--> Removing tests directory"
-sudo rm -rf $KALIBRO_HOME/tests
-
-# you must restart tomcat6 again
-sudo service tomcat6 restart
-
-#or some thing like that...
-#~/tomcat6/bin/shoutdown.sh
-#~/tomcat6/bin/startup.sh
-
diff --git a/plugins/mezuro/service.yml.example b/plugins/mezuro/service.yml.example
deleted file mode 100644
index e2127f2..0000000
--- a/plugins/mezuro/service.yml.example
+++ /dev/null
@@ -1 +0,0 @@
-http://localhost:8080/KalibroService/
diff --git a/plugins/mezuro/test/features/echo_port_test.rb b/plugins/mezuro/test/features/echo_port_test.rb
deleted file mode 100644
index 286f25c..0000000
--- a/plugins/mezuro/test/features/echo_port_test.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/base_tool_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/configuration_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/module_result_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/project_result_fixtures"
-
-class EchoPortTest < ActiveSupport::TestCase
-
- def setup
- @port = Kalibro::Client::Port.new('Echo')
- address = YAML.load_file("#{Rails.root}/plugins/mezuro/service.yaml")
- address['KalibroService'] = 'KalibroFake'
- @port.service_address=(address);
- end
-
- should 'echo base tool' do
- test BaseToolFixtures.analizo, 'BaseTool' do |base_tool|
- base_tool.name = "echo " + base_tool.name
- end
- end
-
- should 'echo configuration' do
- test ConfigurationFixtures.kalibro_configuration, 'Configuration' do |configuration|
- configuration.name = "echo " + configuration.name
- end
- end
-
- should 'echo metric configuration' do
- test_metric_configuration(MetricConfigurationFixtures.amloc_configuration)
- test_metric_configuration(MetricConfigurationFixtures.sc_configuration)
- end
-
- should 'echo module result' do
- test ModuleResultFixtures.create, 'ModuleResult' do |module_result|
- module_result.module.name = "echo." + module_result.module.name
- end
- end
-
- should 'echo project' do
- test(ProjectFixtures.qt_calculator, 'Project') do |project|
- project.name = "echo " + project.name
- end
- end
-
- should 'echo project result' do
- test(ProjectResultFixtures.qt_calculator, 'ProjectResult') do |project_result|
- project_result.project.name = "echo " + project_result.project.name
- end
- end
-
- should 'echo raw project' do
- project = ProjectFixtures.qt_calculator
- echoed = @port.request(:echo_raw_project, {:project => project.to_hash})[:project]
- project.name = "echo " + project.name
- project.state = nil
- project.error = nil
- assert_equal project, Kalibro::Entities::Project.from_hash(echoed)
- end
-
- should 'work with enums' do
- test_granularity("METHOD", "CLASS")
- test_granularity("CLASS", "PACKAGE")
- test_granularity("PACKAGE", "PACKAGE")
- test_granularity("APPLICATION", "APPLICATION")
- end
-
- private
-
- def test_metric_configuration(fixture)
- test fixture, 'MetricConfiguration' do |metric_configuration|
- metric_configuration.code = "echo_" + metric_configuration.code
- end
- end
-
- def test(fixture, entity_name)
- entity_symbol = entity_name.underscore.to_sym
- request_body = {entity_symbol => fixture.to_hash}
- echoed = @port.request("echo_#{entity_symbol}".to_sym, request_body)[entity_symbol]
- yield fixture
- entity_class = "Kalibro::Entities::#{entity_name}".constantize
- assert_equal fixture, entity_class.from_hash(echoed)
- end
-
- def test_granularity(granularity, parent)
- body = {:granularity => granularity}
- assert_equal parent, @port.request(:infer_parent_granularity, body)[:parent_granularity]
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/base_tool_fixtures.rb b/plugins/mezuro/test/fixtures/base_tool_fixtures.rb
deleted file mode 100644
index 0a38a6b..0000000
--- a/plugins/mezuro/test/fixtures/base_tool_fixtures.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.dirname(__FILE__) + '/metric_fixtures'
-
-class BaseToolFixtures
-
- def self.base_tool
- Kalibro::BaseTool.new base_tool_hash
- end
-
- def self.base_tool_hash
- {
- :name => 'Analizo',
- :supported_metric => [
- MetricFixtures.total_cof_hash,
- MetricFixtures.amloc_hash],
- :collector_class_name => "org.analizo.AnalizoMetricCollector"
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/configuration_content_fixtures.rb b/plugins/mezuro/test/fixtures/configuration_content_fixtures.rb
deleted file mode 100644
index 1ab33e9..0000000
--- a/plugins/mezuro/test/fixtures/configuration_content_fixtures.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-class ConfigurationContentFixtures
-
- def self.configuration_content
- MezuroPlugin::ConfigurationContent.new configuration_content_hash
- end
-
- def self.created_configuration_content
- MezuroPlugin::ConfigurationContent.new( {
- :name => 'Sample Configuration',
- :description => 'Kalibro configuration for Java projects.',
- :configuration_id => nil
- } )
- end
-
- def self.configuration_content_hash
- {
- :name => 'Sample Configuration',
- :description => 'Kalibro configuration for Java projects.',
- :configuration_id => "42"
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/configuration_fixtures.rb b/plugins/mezuro/test/fixtures/configuration_fixtures.rb
deleted file mode 100644
index 30e4f09..0000000
--- a/plugins/mezuro/test/fixtures/configuration_fixtures.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-require File.dirname(__FILE__) + '/metric_configuration_fixtures'
-
-class ConfigurationFixtures
-
- def self.configuration
- Kalibro::Configuration.new configuration_hash
- end
-
- def self.created_configuration
- Kalibro::Configuration.new({
- :name => 'Created Sample Configuration',
- :description => 'Kalibro configuration for Java projects.'
- })
- end
-
- def self.configuration_hash
- {
- :id => "42",
- :name => 'Sample Configuration',
- :description => 'Kalibro configuration for Java projects.'
- }
- end
-
- def self.all
- [configuration]
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/date_metric_result_fixtures.rb b/plugins/mezuro/test/fixtures/date_metric_result_fixtures.rb
deleted file mode 100644
index c537f9f..0000000
--- a/plugins/mezuro/test/fixtures/date_metric_result_fixtures.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require File.dirname(__FILE__) + '/metric_result_fixtures'
-
-class DateMetricResultFixtures
-
- def self.date_metric_result
- Kalibro::DateMetricResult.new date_metric_result_hash
- end
-
- def self.date_metric_result_hash
- {
- :date => '2011-10-20T18:26:43.151+00:00',
- :metric_result => MetricResultFixtures.native_metric_result_hash,
- :attributes! =>
- {
- :metric_result =>
- {
- "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
- "xsi:type"=>"kalibro:metricResultXml"
- }
- }
- }
- end
-
- def self.score_history
- result = []
- result << date_metric_result
- newer_date_metric_result = date_metric_result
- newer_date_metric_result.date = '2011-10-25T18:26:43.151+00:00'
- newer_date_metric_result.metric_result.value = 5.0
- result << newer_date_metric_result
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/date_module_result_fixtures.rb b/plugins/mezuro/test/fixtures/date_module_result_fixtures.rb
deleted file mode 100644
index d49b4c5..0000000
--- a/plugins/mezuro/test/fixtures/date_module_result_fixtures.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require File.dirname(__FILE__) + '/module_result_fixtures'
-
-class DateModuleResultFixtures
-
- def self.date_module_result
- Kalibro::DateModuleResult.new date_module_result_hash
- end
-
- def self.date_module_result_hash
- {
- :date => '2011-10-20T18:26:43.151+00:00',
- :module_result => ModuleResultFixtures.module_result_hash,
- :attributes! =>
- {
- :module_result =>
- {
- "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
- "xsi:type"=>"kalibro:moduleResultXml"
- }
- }
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/metric_configuration_fixtures.rb b/plugins/mezuro/test/fixtures/metric_configuration_fixtures.rb
deleted file mode 100644
index fdcf7ef..0000000
--- a/plugins/mezuro/test/fixtures/metric_configuration_fixtures.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require File.dirname(__FILE__) + '/metric_fixtures'
-
-class MetricConfigurationFixtures
-
- def self.amloc_metric_configuration
- amloc = Kalibro::MetricConfiguration.new amloc_metric_configuration_hash
- amloc.configuration_id = "13"
- amloc
- end
-
- def self.sc_metric_configuration
- sc = Kalibro::MetricConfiguration.new sc_metric_configuration_hash
- sc.configuration_id = "13"
- sc
- end
-
- def self.created_metric_configuration
- Kalibro::MetricConfiguration.new({
- :code => 'amloc',
- :metric => MetricFixtures.amloc_hash,
- :base_tool_name => "Analizo",
- :weight => "1.0",
- :aggregation_form => 'AVERAGE',
- :reading_group_id => "31",
- :configuration_id => "13"
- })
- end
-
- def self.amloc_metric_configuration_hash
- {
- :id => "42",
- :code => 'amloc',
- :metric => MetricFixtures.amloc_hash,
- :base_tool_name => "Analizo",
- :weight => "1.0",
- :aggregation_form => 'AVERAGE',
- :reading_group_id => "31",
- :attributes! => {:metric => {
- 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
- 'xsi:type' => 'kalibro:metricXml' }}
- }
- end
-
- def self.sc_metric_configuration_hash
- {
- :id => "42",
- :code => 'sc',
- :metric => MetricFixtures.compound_metric_hash,
- :weight => "1.0",
- :aggregation_form => 'AVERAGE',
- :reading_group_id => "31",
- :attributes! => {:metric => {
- 'xmlns:xsi'=> 'http://www.w3.org/2001/XMLSchema-instance',
- 'xsi:type' => 'kalibro:metricXml' }}
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/metric_configuration_snapshot_fixtures.rb b/plugins/mezuro/test/fixtures/metric_configuration_snapshot_fixtures.rb
deleted file mode 100644
index 1aae495..0000000
--- a/plugins/mezuro/test/fixtures/metric_configuration_snapshot_fixtures.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-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
diff --git a/plugins/mezuro/test/fixtures/metric_fixtures.rb b/plugins/mezuro/test/fixtures/metric_fixtures.rb
deleted file mode 100644
index f036072..0000000
--- a/plugins/mezuro/test/fixtures/metric_fixtures.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-class MetricFixtures
-
- def self.compound_metric
- Kalibro::Metric.new compound_metric_hash
- end
-
- def self.compound_metric_hash
- {:name => 'Structural Complexity', :compound => "true", :scope => 'CLASS', :script => 'return 42;', :description => 'Calculate the Structural Complexity of the Code'}
- end
-
- def self.total_cof
- Kalibro::Metric.new total_cof_hash
- end
-
- def self.total_cof_hash
- {:name => 'Total Coupling Factor', :compound => "false", :scope => 'SOFTWARE', :language => ['JAVA']}
- end
-
- def self.amloc
- Kalibro::Metric.new amloc_hash
- end
-
- def self.amloc_hash
- {:name => 'Average Method LOC', :compound => "false", :scope => 'CLASS', :language => ['JAVA']}
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/metric_result_fixtures.rb b/plugins/mezuro/test/fixtures/metric_result_fixtures.rb
deleted file mode 100644
index f34f0c0..0000000
--- a/plugins/mezuro/test/fixtures/metric_result_fixtures.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require File.dirname(__FILE__) + '/metric_configuration_snapshot_fixtures'
-require File.dirname(__FILE__) + '/throwable_fixtures'
-
-class MetricResultFixtures
-
- def self.native_metric_result
- Kalibro::MetricResult.new native_metric_result_hash
- end
-
- def self.compound_metric_result
- Kalibro::MetricResult.new compound_metric_result_hash
- end
-
- def self.metric_result_with_error_hash
- {
- :id => "41",
- :configuration => MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash,
- :error => ThrowableFixtures.throwable_hash
- }
- end
-
- def self.native_metric_result_hash
- {
- :id => "42",
- :configuration => MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash,
- :value => "0.0",
- :attributes! =>
- {
- :configuration =>
- {
- "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
- "xsi:type"=>"kalibro:metricConfigurationSnapshotXml"
- }
- }
- }
- end
-
- def self.compound_metric_result_hash
- {
- :id => "43",
- :configuration => MetricConfigurationSnapshotFixtures.compound_metric_configuration_snapshot_hash,
- :value => "1.0",
- :attributes! =>
- {
- :configuration =>
- {
- "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
- "xsi:type"=>"kalibro:metricConfigurationSnapshotXml"
- }
- }
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/module_fixtures.rb b/plugins/mezuro/test/fixtures/module_fixtures.rb
deleted file mode 100644
index c3ed98a..0000000
--- a/plugins/mezuro/test/fixtures/module_fixtures.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-class ModuleFixtures
-
- def self.module
- Kalibro::Module.new module_hash
- end
-
- def self.module_hash
- {
- :name => 'Qt-Calculator',
- :granularity => 'APPLICATION'
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/module_result_fixtures.rb b/plugins/mezuro/test/fixtures/module_result_fixtures.rb
deleted file mode 100644
index bc04d34..0000000
--- a/plugins/mezuro/test/fixtures/module_result_fixtures.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-require File.dirname(__FILE__) + '/module_fixtures'
-
-class ModuleResultFixtures
-
- def self.module_result
- Kalibro::ModuleResult.new module_result_hash
- end
-
- def self.module_result_hash
- {
- :id => "42",
- :module => ModuleFixtures.module_hash,
- :grade => "10.0",
- :parent_id => "31",
- :attributes! =>
- {
- :module =>
- {
- "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
- "xsi:type"=>"kalibro:moduleXml"
- }
- }
- }
- end
-
- def self.parent_module_result_hash
- {
- :id => "31",
- :module => {
- :name => 'Qt-Calculator Parent',
- :granularity => 'APPLICATION'
- },
- :grade => "10.0",
- :attributes! =>
- {
- :module =>
- {
- "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
- "xsi:type"=>"kalibro:moduleXml"
- }
- }
- }
- end
-end
diff --git a/plugins/mezuro/test/fixtures/process_time_fixtures.rb b/plugins/mezuro/test/fixtures/process_time_fixtures.rb
deleted file mode 100644
index ece195f..0000000
--- a/plugins/mezuro/test/fixtures/process_time_fixtures.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class ProcessTimeFixtures
-
- def self.process_time
- Kalibro::ProcessTime.new process_time_hash
- end
-
- def self.process_time_hash
- {:state => "Ready", :time => "1"}
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/processing_fixtures.rb b/plugins/mezuro/test/fixtures/processing_fixtures.rb
deleted file mode 100644
index b56dcd4..0000000
--- a/plugins/mezuro/test/fixtures/processing_fixtures.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require File.dirname(__FILE__) + '/process_time_fixtures'
-require File.dirname(__FILE__) + '/throwable_fixtures'
-
-class ProcessingFixtures
-
- def self.processing
- Kalibro::Processing.new processing_hash
- end
-
- def self.processing_hash
- {
- :id => "31",
- :date => '2011-10-20T18:26:43.151+00:00',
- :state => 'READY',
- :process_time => [ProcessTimeFixtures.process_time_hash],
- :results_root_id => "13"
- }
- end
-
- def self.processing_with_error_hash
- {
- :id => "31",
- :date => '2011-10-20T18:26:43.151+00:00',
- :state => 'ERROR',
- :process_time => [ProcessTimeFixtures.process_time_hash],
- :error => ThrowableFixtures.throwable_hash
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/project_content_fixtures.rb b/plugins/mezuro/test/fixtures/project_content_fixtures.rb
deleted file mode 100644
index 11e2265..0000000
--- a/plugins/mezuro/test/fixtures/project_content_fixtures.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class ProjectContentFixtures
-
- def self.project_content
- content = MezuroPlugin::ProjectContent.new
- content.project_id = 42
- content
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/project_fixtures.rb b/plugins/mezuro/test/fixtures/project_fixtures.rb
deleted file mode 100644
index 8c18f90..0000000
--- a/plugins/mezuro/test/fixtures/project_fixtures.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require File.dirname(__FILE__) + '/repository_fixtures'
-
-class ProjectFixtures
-
- def self.project
- Kalibro::Project.new project_hash
- end
-
- def self.created_project
- Kalibro::Project.new :name => 'Qt-Calculator', :description => 'Calculator for Qt'
- end
-
- def self.project_hash
- {
- :id => "42",
- :name => 'Qt-Calculator',
- :description => 'Calculator for Qt'
- }
- end
-end
diff --git a/plugins/mezuro/test/fixtures/range_fixtures.rb b/plugins/mezuro/test/fixtures/range_fixtures.rb
deleted file mode 100644
index f57c51d..0000000
--- a/plugins/mezuro/test/fixtures/range_fixtures.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class RangeFixtures
-
- def self.range
- Kalibro::Range.new range_hash
- end
-
- def self.created_range
- Kalibro::Range.new created_range_hash
- end
-
- def self.created_range_hash
- {:beginning => "19.5", :end => "INF", :reading_id => "1", :comments => "Test range 1"}
- end
-
- def self.range_hash
- {:id => "1", :beginning => "19.5", :end => "INF", :reading_id => "1", :comments => "Test range 1"}
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/range_snapshot_fixtures.rb b/plugins/mezuro/test/fixtures/range_snapshot_fixtures.rb
deleted file mode 100644
index 6e0c236..0000000
--- a/plugins/mezuro/test/fixtures/range_snapshot_fixtures.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class RangeSnapshotFixtures
-
- def self.range_snapshot
- Kalibro::RangeSnapshot.new range_snapshot_hash
- end
-
- def self.range_snapshot_with_infinite_range
- Kalibro::RangeSnapshot.new range_snapshot_with_infinite_range_hash
- end
-
- def self.range_snapshot_hash
- { :beginning => "1.1", :end => "5.1", :label => "snapshot", :grade => "10.1", :color => "FF2284", :comments => "comment" }
- end
-
- def self.range_snapshot_with_infinite_range_hash
- { :beginning => "-INF", :end => "INF", :label => "snapshot", :grade => "10.1", :color => "FF2284", :comments => "comment" }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/reading_fixtures.rb b/plugins/mezuro/test/fixtures/reading_fixtures.rb
deleted file mode 100644
index 57faf53..0000000
--- a/plugins/mezuro/test/fixtures/reading_fixtures.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-class ReadingFixtures
-
- def self.reading
- Kalibro::Reading.new reading_hash
- end
-
- def self.created_reading # A created object has no id before being sent to kalibro
- Kalibro::Reading.new :label => "Reading Test Label", :grade => "10.5", :color => "AABBCC", :group_id => "31"
- end
-
- def self.reading_hash
- {:id => "42", :label => "Reading Test Label", :grade => "10.5", :color => "AABBCC", :group_id => "31"}
- end
-
-end
-
diff --git a/plugins/mezuro/test/fixtures/reading_group_content_fixtures.rb b/plugins/mezuro/test/fixtures/reading_group_content_fixtures.rb
deleted file mode 100644
index 2c306fe..0000000
--- a/plugins/mezuro/test/fixtures/reading_group_content_fixtures.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class ReadingGroupContentFixtures
-
- def self.reading_group_content
- content = MezuroPlugin::ReadingGroupContent.new
- content.reading_group_id = 42
- content
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/reading_group_fixtures.rb b/plugins/mezuro/test/fixtures/reading_group_fixtures.rb
deleted file mode 100644
index 41f68a5..0000000
--- a/plugins/mezuro/test/fixtures/reading_group_fixtures.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class ReadingGroupFixtures
-
- def self.reading_group
- Kalibro::ReadingGroup.new reading_group_hash
- end
-
- def self.created_reading_group # A created object has no id before being sent to kalibro
- Kalibro::ReadingGroup.new :name => "Reading Group Test", :description => "Reading group in the fixtures"
- end
-
- def self.reading_group_hash
- {:id => "42", :name => "Reading Group Test", :description => "Reading group in the fixtures"}
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/repository_fixtures.rb b/plugins/mezuro/test/fixtures/repository_fixtures.rb
deleted file mode 100644
index 4a5c515..0000000
--- a/plugins/mezuro/test/fixtures/repository_fixtures.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-class RepositoryFixtures
-
- def self.repository
- Kalibro::Repository.new repository_hash
- end
-
- def self.created_repository
- Kalibro::Repository.new({
- :name => "test created repository",
- :description => "test description",
- :license => "GPL",
- :process_period => "1",
- :type => 'SUBVERSION',
- :address => 'https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator',
- :configuration_id => "31",
- :project_id => "32"
- })
- end
-
- def self.repository_hash
- {:id => "42", :name => "test repository", :description => "test description", :license => "GPL", :process_period => "1", :type => 'SUBVERSION', :address => "https://qt-calculator.svn.sourceforge.net/svnroot/qt-calculator", :configuration_id => "31", :project_id => "32"}
- end
-
- def self.types
- ["SUBVERSION", "GIT"]
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/stack_trace_element_fixtures.rb b/plugins/mezuro/test/fixtures/stack_trace_element_fixtures.rb
deleted file mode 100644
index 30777ad..0000000
--- a/plugins/mezuro/test/fixtures/stack_trace_element_fixtures.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-class StackTraceElementFixtures
-
- def self.stack_trace_element
- Kalibro::StackTraceElement.new stack_trace_element_hash
- end
-
- def self.stack_trace_element_hash
- {
- :declaring_class => 'my.declaring.Class',
- :method_name => 'my method name',
- :file_name => 'MyFile.java',
- :line_number => '42'
- }
- end
-
-end
diff --git a/plugins/mezuro/test/fixtures/throwable_fixtures.rb b/plugins/mezuro/test/fixtures/throwable_fixtures.rb
deleted file mode 100644
index 4de270f..0000000
--- a/plugins/mezuro/test/fixtures/throwable_fixtures.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require File.dirname(__FILE__) + '/stack_trace_element_fixtures'
-
-class ThrowableFixtures
-
- def self.throwable
- Kalibro::Throwable.new throwable_hash
- end
-
- def self.throwable_hash
- {
- :target_string => 'Target String',
- :message => 'Throwable message from ThrowableTest',
- :stack_trace_element => [
- StackTraceElementFixtures.stack_trace_element_hash, StackTraceElementFixtures.stack_trace_element_hash
- ]
- }
- end
-
-end
diff --git a/plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb b/plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb
deleted file mode 100644
index d26f750..0000000
--- a/plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb
+++ /dev/null
@@ -1,228 +0,0 @@
-require 'test_helper'
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/error_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/base_tool_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/native_metric_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/configuration_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/range_fixtures"
-
-class MezuroPluginMyprofileControllerTest < ActionController::TestCase
-
- def setup
- @controller = MezuroPluginMyprofileController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Community)
-
- @base_tool = BaseToolFixtures.base_tool
- @base_tool_hash = BaseToolFixtures.base_tool_hash
- @metric = NativeMetricFixtures.amloc
- @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
- @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash
- @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration
- @compound_metric_configuration_hash = MetricConfigurationFixtures.sc_metric_configuration_hash
- @configuration = ConfigurationFixtures.configuration
- @configuration_hash = ConfigurationFixtures.configuration_hash
-
- Kalibro::Configuration.expects(:all_names).returns([])
- @content = MezuroPlugin::ConfigurationContent.new(:profile => @profile, :name => @configuration.name)
- @content.expects(:send_kalibro_configuration_to_service).returns(nil)
- @content.stubs(:solr_save)
- @content.save
-
- @native_hash = @metric_configuration.to_hash.merge({:configuration_name => @metric_configuration.configuration_name})
- @native_hash.delete :attributes!
- @compound_hash = @compound_metric_configuration.to_hash.merge({:configuration_name => @compound_metric_configuration.configuration_name})
- @compound_hash.delete :attributes!
-
- @range = RangeFixtures.range_excellent
- @range_hash = RangeFixtures.range_excellent_hash
- end
-
- should 'test choose base tool' do
- Kalibro::BaseTool.expects(:request).with("BaseTool", :get_base_tool_names).returns({:base_tool_name => @base_tool.name})
- get :choose_base_tool, :profile => @profile.identifier, :id => @content.id
- assert_equal [@base_tool.name], assigns(:base_tools)
- assert_equal @content, assigns(:configuration_content)
- assert_response 200
- end
-
- should 'test choose metric' do
- Kalibro::BaseTool.expects(:request).with("BaseTool", :get_base_tool, {:base_tool_name => @base_tool.name}).returns({:base_tool => @base_tool_hash})
- get :choose_metric, :profile => @profile.identifier, :id => @content.id, :base_tool => @base_tool.name
- assert_equal @content, assigns(:configuration_content)
- assert_equal @base_tool.name, assigns(:base_tool)
- assert_equal @base_tool.supported_metric[0].name, assigns(:supported_metrics)[0].name
- assert_response 200
- end
-
- should 'test new metric configuration' do
- Kalibro::BaseTool.expects(:request).with("BaseTool", :get_base_tool, {:base_tool_name => @base_tool.name}).returns({:base_tool => @base_tool_hash})
- get :new_metric_configuration, :profile => @profile.identifier, :id => @content.id, :base_tool => @base_tool.name, :metric_name => @metric.name
- assert_equal @content, assigns(:configuration_content)
- assert_equal @metric.name, assigns(:metric).name
- assert_response 200
- end
-
-
- should 'test new compound metric configuration' do
- Kalibro::Configuration.expects(:request).with("Configuration", :get_configuration, {:configuration_name => @content.name}).returns({:configuration => @configuration_hash})
- get :new_compound_metric_configuration, :profile => @profile.identifier, :id => @content.id
- assert_equal @content, assigns(:configuration_content)
- assert_equal @configuration.metric_configuration[0].code, assigns(:metric_configurations)[0].code
- assert_response 200
- end
-
- should 'test edit metric configuration' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @metric_configuration.metric.name}).returns({:metric_configuration => @metric_configuration_hash})
- get :edit_metric_configuration, :profile => @profile.identifier, :id => @content.id, :metric_name => @metric.name
- assert_equal @content, assigns(:configuration_content)
- assert_equal @metric_configuration.code, assigns(:metric_configuration).code
- assert_equal @metric_configuration.metric.name, assigns(:metric).name
- assert_response 200
- end
-
- should 'test edit compound metric configuration' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @compound_metric_configuration.metric.name}).returns({:metric_configuration => @compound_metric_configuration_hash})
- Kalibro::Configuration.expects(:request).with("Configuration", :get_configuration, {:configuration_name => @content.name}).returns({:configuration => @configuration_hash})
- get :edit_compound_metric_configuration,
- :profile => @profile.identifier,
- :id => @content.id,
- :metric_name => @compound_metric_configuration.metric.name
- assert_equal @content, assigns(:configuration_content)
- assert_equal @compound_metric_configuration.code, assigns(:metric_configuration).code
- assert_equal @compound_metric_configuration.metric.name, assigns(:metric).name
- assert_equal @configuration.metric_configuration[0].code, assigns(:metric_configurations)[0].code
- assert_response 200
- end
-
- should 'test create native metric configuration' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :save_metric_configuration, {
- :metric_configuration => @metric_configuration.to_hash,
- :configuration_name => @metric_configuration.configuration_name})
- get :create_metric_configuration,
- :profile => @profile.identifier,
- :id => @content.id,
- :metric_configuration => @native_hash
- assert_response 302
- end
-
- should 'test compound metric creation' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :save_metric_configuration, {
- :metric_configuration => @compound_metric_configuration.to_hash,
- :configuration_name => @compound_metric_configuration.configuration_name})
- get :create_compound_metric_configuration, :profile => @profile.identifier, :id => @content.id,
- :metric_configuration => @compound_hash
- assert_response 302
- end
-
- should 'test update native metric configuration' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @metric_configuration.metric.name}).returns({:metric_configuration => @metric_configuration_hash})
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :save_metric_configuration, {
- :metric_configuration => @metric_configuration.to_hash,
- :configuration_name => @metric_configuration.configuration_name})
- get :update_metric_configuration, :profile => @profile.identifier, :id => @content.id,
- :metric_configuration => @native_hash
- assert_equal @content, assigns(:configuration_content)
- assert_response 302
- end
-
- should 'test update compound metric configuration' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @compound_metric_configuration.metric.name}).returns({:metric_configuration => @compound_metric_configuration_hash})
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :save_metric_configuration, {
- :metric_configuration => @compound_metric_configuration.to_hash,
- :configuration_name => @compound_metric_configuration.configuration_name})
- get :update_compound_metric_configuration, :profile => @profile.identifier, :id => @content.id,
- :metric_configuration => @compound_hash
- assert_equal @content, assigns(:configuration_content)
- assert_response 302
- end
-
- should 'test remove metric configuration' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @metric.name}).returns({:metric_configuration => @metric_configuration_hash})
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :remove_metric_configuration, {
- :metric_name => @metric.name,
- :configuration_name => @metric_configuration.configuration_name})
- get :remove_metric_configuration, :profile => @profile.identifier, :id => @content.id, :metric_name => @metric.name
- assert_response 302
- end
-
- should 'test new range' do
- get :new_range, :profile => @profile.identifier, :id => @content.id, :metric_name => @metric.name
- assert_equal @content, assigns(:configuration_content)
- assert_equal @metric.name, assigns(:metric_name)
- assert_response 200
- end
-
- should 'test edit range' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @metric.name}).returns({:metric_configuration => @metric_configuration_hash})
- get :edit_range, :profile => @profile.identifier, :id => @content.id, :metric_name => @metric.name, :beginning_id => @range.beginning
- assert_equal @content, assigns(:configuration_content)
- assert_equal @metric.name, assigns(:metric_name)
- assert_equal @range.beginning, assigns(:beginning_id)
- assert_equal @range.end, assigns(:range).end
- assert_response 200
- end
-
- should 'test create instance range' do
- metric_configuration = @metric_configuration
- metric_configuration.add_range(@range)
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @metric.name}).returns({:metric_configuration => @metric_configuration_hash})
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :save_metric_configuration, {
- :metric_configuration => metric_configuration.to_hash,
- :configuration_name => metric_configuration.configuration_name})
- get :create_range, :profile => @profile.identifier, :range => @range_hash, :id => @content.id, :metric_name => @metric.name
- assert_equal @content, assigns(:configuration_content)
- assert_equal @range.end, assigns(:range).end
- assert_response 200
- end
-
- should 'test update range' do
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @metric.name}).returns({:metric_configuration => @metric_configuration_hash})
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :save_metric_configuration, {
- :metric_configuration => @metric_configuration.to_hash,
- :configuration_name => @metric_configuration.configuration_name})
- get :update_range,
- :profile => @profile.identifier,
- :range => @range_hash,
- :id => @content.id,
- :metric_name => @metric.name,
- :beginning_id => @range.beginning
- assert_response 200
- end
-
- should 'test remove range' do
- metric_configuration = @metric_configuration
- metric_configuration.ranges.delete_if { |range| range.beginning == @range.beginning.to_f }
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :get_metric_configuration, {
- :configuration_name => @content.name,
- :metric_name => @metric.name}).returns({:metric_configuration => @metric_configuration_hash})
- Kalibro::MetricConfiguration.expects(:request).with("MetricConfiguration", :save_metric_configuration, {
- :metric_configuration => metric_configuration.to_hash,
- :configuration_name => metric_configuration.configuration_name})
- get :remove_range,
- :profile => @profile.identifier,
- :id => @content.id,
- :metric_name => @metric.name,
- :beginning_id => @range.beginning
- assert_response 302
- end
-
-end
diff --git a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
deleted file mode 100644
index 0ca11dd..0000000
--- a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-require 'test_helper'
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/module_result_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/project_result_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/error_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/repository_fixtures"
-
-class MezuroPluginProfileControllerTest < ActionController::TestCase
-
- def setup
- @controller = MezuroPluginProfileController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Community)
-
- @project_result = ProjectResultFixtures.project_result
- @module_result = ModuleResultFixtures.module_result
- @repository_url = RepositoryFixtures.repository.address
- @project = @project_result.project
- @date = "2012-04-13T20:39:41+04:00"
-
- Kalibro::Project.expects(:all_names).returns([])
- @content = MezuroPlugin::ProjectContent.new(:profile => @profile, :name => @project.name, :repository_url => @repository_url)
- @content.expects(:send_project_to_service).returns(nil)
- @content.save
- end
-
- should 'test project state without kalibro_error' do
- Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash})
- get :project_state, :profile => @profile.identifier, :id => @content.id
- assert_response 200
- assert_equal @content, assigns(:content)
- end
-
- should 'test project state with kalibro_error' do
- Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash.merge({:error => ErrorFixtures.error_hash})})
- get :project_state, :profile => @profile.identifier, :id => @content.id
- assert_response 200
- assert_equal "ERROR", @response.body
- assert_equal @content, assigns(:content)
- end
-
- should 'test project error' do
- Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash.merge({:error => ErrorFixtures.error_hash})})
- get :project_error, :profile => @profile.identifier, :id => @content.id
- assert_response 200
- assert_select('h3', 'ERROR')
- assert_equal @content, assigns(:content)
- assert_equal @project.name, assigns(:project).name
- end
-
- should 'test project result without date' do
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_of, {:project_name => @project.name}).returns({:project_result => @project_result.to_hash})
- get :project_result, :profile => @profile.identifier, :id => @content.id, :date => nil
- assert_equal @content, assigns(:content)
- assert_equal @project_result.project.name, assigns(:project_result).project.name
- assert_response 200
- assert_select('h4', 'Last Result')
- end
-
- should 'test project results from a specific date' do
- request_body = {:project_name => @project.name, :date => @date}
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :has_results_before, request_body).returns({:has_results => true})
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_before, request_body).returns({:project_result => @project_result.to_hash})
- get :project_result, :profile => @profile.identifier, :id => @content.id, :date => @date
- assert_equal @content, assigns(:content)
- assert_equal @project_result.project.name, assigns(:project_result).project.name
- assert_response 200
- assert_select('h4', 'Last Result')
- end
-
-
- should 'get module result without date' do
- date_with_milliseconds = Kalibro::ProjectResult.date_with_milliseconds(@project_result.date)
- Kalibro::ProjectResult.expects(:request).
- with("ProjectResult", :get_last_result_of, {:project_name => @project.name}).
- returns({:project_result => @project_result.to_hash})
- Kalibro::ModuleResult.expects(:request).
- with("ModuleResult", :get_module_result, {:project_name => @project.name, :module_name => @project.name, :date => date_with_milliseconds}).
- returns({:module_result => @module_result.to_hash})
- get :module_result, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => nil
- assert_equal @content, assigns(:content)
- assert_equal @module_result.grade, assigns(:module_result).grade
- assert_response 200
- assert_select('h5', 'Metric results for: Qt-Calculator (APPLICATION)')
- end
-
- should 'get module result with a specific date' do
- date_with_milliseconds = Kalibro::ProjectResult.date_with_milliseconds(@project_result.date)
- request_body = {:project_name => @project.name, :date => @project_result.date}
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :has_results_before, request_body).returns({:has_results => true})
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_before, request_body).returns({:project_result => @project_result.to_hash})
- Kalibro::ModuleResult.expects(:request).with("ModuleResult", :get_module_result, {:project_name => @project.name, :module_name => @project.name, :date => date_with_milliseconds}).returns({:module_result => @module_result.to_hash})
- get :module_result, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => @project_result.date
- assert_equal @content, assigns(:content)
- assert_equal @module_result.grade, assigns(:module_result).grade
- assert_response 200
- assert_select('h5', 'Metric results for: Qt-Calculator (APPLICATION)')
- end
-
- should 'test project tree without date' do
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_of, {:project_name => @project.name}).returns({:project_result => @project_result.to_hash})
- Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash})
- get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => nil
- assert_equal @content, assigns(:content)
- assert_equal @project.name, assigns(:project_name)
- assert_equal @project_result.source_tree.module.name, assigns(:source_tree).module.name
- assert_response 200
- assert_select('h2', /Qt-Calculator/)
- end
-
- should 'test project tree with a specific date' do
- request_body = {:project_name => @project.name, :date => @project_result.date}
- Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash})
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :has_results_before, request_body).returns({:has_results => true})
- Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_before, request_body).returns({:project_result => @project_result.to_hash})
- get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => @project_result.date
- assert_equal @content, assigns(:content)
- assert_equal @project.name, assigns(:project_name)
- assert_equal @project_result.source_tree.module.name, assigns(:source_tree).module.name
- assert_response 200
- end
-
- should 'test module metrics history' do
- Kalibro::ModuleResult.expects(:request).with("ModuleResult", :get_result_history, {:project_name => @project.name, :module_name => @project.name}).returns({:module_result => @module_result})
- get :module_metrics_history, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name,
- :metric_name => @module_result.metric_result.first.metric.name.delete("() ")
- assert_equal @content, assigns(:content)
- assert_equal [[@module_result.metric_result[0].value, @module_result.date.to_s[0..9]]], assigns(:score_history)
- assert_response 200
- end
-
- should 'test grade history' do
- Kalibro::ModuleResult.expects(:request).with("ModuleResult", :get_result_history, {:project_name => @project.name, :module_name => @project.name}).returns({:module_result => @module_result})
- get :module_grade_history, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name
- assert_equal @content, assigns(:content)
- assert_equal [[@module_result.grade, @module_result.date.to_s[0..9]]], assigns(:score_history)
- assert_response 200
- end
-
-end
diff --git a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_metric_configuration_controller_test.rb b/plugins/mezuro/test/functional/myprofile/mezuro_plugin_metric_configuration_controller_test.rb
deleted file mode 100644
index e9f6589..0000000
--- a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_metric_configuration_controller_test.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-require 'test_helper'
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_group_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/range_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_fixtures"
-
-class MezuroPluginMetricConfigurationControllerTest < ActionController::TestCase
-
- def setup
- @controller = MezuroPluginMetricConfigurationController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Profile)
-
- @configuration = ConfigurationFixtures.configuration
- @created_configuration = ConfigurationFixtures.created_configuration
- @configuration_hash = ConfigurationFixtures.configuration_hash
-
- @configuration_content = MezuroPlugin::ConfigurationContent.new(:profile => @profile, :name => @configuration.name, :configuration_id => 42)
- @configuration_content.expects(:send_configuration_to_service).returns(nil)
- @configuration_content.expects(:validate_configuration_name).returns(true)
- @configuration_content.save
-
- @base_tool = BaseToolFixtures.base_tool
- @base_tool_hash = BaseToolFixtures.base_tool_hash
-
- @metric = MetricFixtures.amloc
-
- @reading_group = ReadingGroupFixtures.reading_group
- @range = RangeFixtures.range
- @reading = ReadingFixtures.reading
-
- @native_metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
- @native_metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash
- @created_metric_configuration = MetricConfigurationFixtures.created_metric_configuration
- @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration
- @compound_metric_configuration_hash = MetricConfigurationFixtures.sc_metric_configuration_hash
- end
-
- should 'choose metric' do
- Kalibro::BaseTool.expects(:all).returns([@base_tool])
- get :choose_metric, :profile => @profile.identifier, :id => @configuration_content.id
- assert_equal @configuration_content, assigns(:configuration_content)
- assert_equal [@base_tool], assigns(:base_tools)
- assert_response :success
- end
-
- should 'initialize native' do
- Kalibro::BaseTool.expects(:find_by_name).with(@base_tool.name).returns(@base_tool)
- Kalibro::ReadingGroup.expects(:all).returns([@reading_group])
- get :new_native, :profile => @profile.identifier, :id => @configuration_content.id, :base_tool_name => @base_tool.name, :metric_name => @metric.name
- assert_equal @configuration_content, assigns(:configuration_content)
- assert_equal @metric.name, assigns(:metric).name
- assert_equal @base_tool.name, assigns(:metric_configuration).base_tool_name
- assert_equal [[@reading_group.name,@reading_group.id]], assigns(:reading_group_names_and_ids)
- assert_response :success
- end
-
- should 'edit native' do
- Kalibro::MetricConfiguration.expects(:metric_configurations_of).with(@configuration.id).returns([@native_metric_configuration])
- Kalibro::ReadingGroup.expects(:all).returns([@reading_group])
- Kalibro::Range.expects(:ranges_of).with(@native_metric_configuration.id).returns([@range])
- Kalibro::Reading.expects(:find).with(@range.reading_id).returns(@reading)
- get :edit_native, :profile => @profile.identifier, :id => @configuration_content.id, :metric_configuration_id => @native_metric_configuration.id
- assert_equal @configuration_content, assigns(:configuration_content)
- assert_equal @native_metric_configuration.code, assigns(:metric_configuration).code
- assert_equal @native_metric_configuration.metric.name, assigns(:metric).name
- assert_equal [[@reading_group.name,@reading_group.id]], assigns(:reading_group_names_and_ids)
- assert_equal [@range], assigns(:ranges)
- assert_response :success
- end
-
- should 'initialize compound' do
- Kalibro::ReadingGroup.expects(:all).returns([@reading_group])
- Kalibro::MetricConfiguration.expects(:metric_configurations_of).with(@configuration_content.configuration_id).returns([@compound_metric_configuration])
- get :new_compound, :profile => @profile.identifier, :id => @configuration_content.id
- assert_equal @configuration_content, assigns(:configuration_content)
- assert_equal @compound_metric_configuration.code, assigns(:metric_configurations).first.code
- assert_equal [[@reading_group.name,@reading_group.id]], assigns(:reading_group_names_and_ids)
- assert_response :success
- end
-
- should 'edit compound' do
- Kalibro::MetricConfiguration.expects(:metric_configurations_of).with(@configuration.id).returns([@compound_metric_configuration])
- Kalibro::ReadingGroup.expects(:all).returns([@reading_group])
- Kalibro::Range.expects(:ranges_of).with(@compound_metric_configuration.id).returns([@range])
- Kalibro::Reading.expects(:find).with(@range.reading_id).returns(@reading)
- get :edit_compound, :profile => @profile.identifier, :id => @configuration_content.id, :metric_configuration_id => @compound_metric_configuration.id
- assert_equal @configuration_content, assigns(:configuration_content)
- assert_equal @compound_metric_configuration.code, assigns(:metric_configuration).code
- assert_equal @compound_metric_configuration.metric.name, assigns(:metric).name
- assert_equal [@compound_metric_configuration], assigns(:metric_configurations)
- assert_equal [[@reading_group.name,@reading_group.id]], assigns(:reading_group_names_and_ids)
- assert_equal [@range], assigns(:ranges)
- assert_response :success
- end
-
- should 'create' do
- Kalibro::MetricConfiguration.expects(:create).returns(@compound_metric_configuration) #FIXME need .with(some_hash), should it mock the request?.
- get :create, :profile => @profile.identifier, :id => @configuration_content.id, :metric_configuration => @compound_metric_configuration_hash
- assert_response :redirect
- end
-
- should 'update' do
- Kalibro::MetricConfiguration.expects(:metric_configurations_of).with(@configuration_content.configuration_id).returns([@native_metric_configuration])
- @native_metric_configuration.expects(:update_attributes).returns(true) #FIXME need .with(some_hash), should it mock the request?.
- get :update, :profile => @profile.identifier, :id => @configuration_content.id, :metric_configuration => @native_metric_configuration_hash
- assert_equal @configuration_content, assigns(:configuration_content)
- assert_response :redirect
- end
-
- should 'remove' do
- Kalibro::MetricConfiguration.expects(:new).with({:id => @native_metric_configuration.id}).returns(@native_metric_configuration)
- @native_metric_configuration.expects(:destroy).returns()
- get :remove, :profile => @profile.identifier, :id => @configuration_content.id, :metric_configuration_id => @native_metric_configuration.id
- assert_response :redirect
- end
-
-end
diff --git a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_range_controller_test.rb b/plugins/mezuro/test/functional/myprofile/mezuro_plugin_range_controller_test.rb
deleted file mode 100644
index 39749b4..0000000
--- a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_range_controller_test.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-require 'test_helper'
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/range_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_fixtures"
-
-class MezuroPluginRangeControllerTest < ActionController::TestCase
-
- def setup
- @controller = MezuroPluginRangeController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Profile)
-
- @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
- @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash
- @configuration = ConfigurationFixtures.configuration
-
- @content = MezuroPlugin::ConfigurationContent.new(:profile => @profile, :name => @configuration.name, :configuration_id => 42)
- @content.expects(:send_configuration_to_service).returns(nil)
- @content.expects(:validate_configuration_name).returns(true)
- @content.save
-
- @created_range = RangeFixtures.created_range
- @range = RangeFixtures.range
- @created_range_hash = RangeFixtures.created_range_hash
- @range_hash = RangeFixtures.range_hash
-
- @reading = ReadingFixtures.reading
- end
-
- should 'set correct attributes to create a new range' do
- Kalibro::Reading.expects(:readings_of).with(@metric_configuration.reading_group_id).returns([@reading])
- get :new, :profile => @profile.identifier, :id => @content.id, :metric_configuration_id => @metric_configuration.id, :reading_group_id => @metric_configuration.reading_group_id, :compound => @metric_configuration.metric.compound
- assert_equal @content.id, assigns(:content_id)
- assert_equal @metric_configuration.id, assigns(:metric_configuration_id)
- assert_equal [[@reading.label,@reading.id]], assigns(:reading_labels_and_ids)
- assert_equal @metric_configuration.reading_group_id, assigns(:reading_group_id)
- assert_equal @metric_configuration.metric.compound, assigns(:compound)
- assert_response :success
- end
-
- should 'set correct attributes to edit a range' do
- Kalibro::Reading.expects(:readings_of).with(@metric_configuration.reading_group_id).returns([@reading])
- Kalibro::Range.expects(:ranges_of).with(@metric_configuration.id).returns([@range])
- get :edit, :profile => @profile.identifier, :id => @content.id, :metric_configuration_id => @metric_configuration.id, :range_id => @range.id, :reading_group_id => @metric_configuration.reading_group_id
- assert_equal @content.id, assigns(:content_id)
- assert_equal @metric_configuration.id, assigns(:metric_configuration_id)
- assert_equal [[@reading.label,@reading.id]], assigns(:reading_labels_and_ids)
- assert_equal @range, assigns(:range)
- assert_response :success
- end
-
- should 'test create instance range' do
- Kalibro::Range.expects(:request).with(:save_range, {
- :metric_configuration_id => @metric_configuration.id,
- :range => @created_range.to_hash}).returns(:range_id => @range.id)
- Kalibro::Reading.expects(:find).with(@created_range.reading_id).returns(@reading)
- get :create, :profile => @profile.identifier, :range => @created_range_hash, :metric_configuration_id => @metric_configuration.id, :reading_group_id => @metric_configuration.reading_group_id, :compound => @metric_configuration.metric.compound
- assert_equal @range.id, assigns(:range).id
- assert_equal @metric_configuration.reading_group_id, assigns(:reading_group_id)
- assert_equal @metric_configuration.metric.compound, assigns(:compound)
- assert_response :success
- end
-
- should 'test update range' do
- Kalibro::Range.expects(:request).with(:save_range, {
- :metric_configuration_id => @metric_configuration.id,
- :range => @range.to_hash}).returns(:range_id => @range.id)
- get :update, :profile => @profile.identifier, :range => @range_hash, :metric_configuration_id => @metric_configuration.id
- assert_equal @range.id, assigns(:range).id
- assert_response :success
- end
-
- should 'test remove range in native metric configuration' do
- Kalibro::Range.expects(:new).with({:id => @range.id}).returns(@range)
- @range.expects(:destroy).with().returns()
- get :remove, :profile => @profile.identifier, :id => @content.id, :metric_configuration_id => @metric_configuration.id, :range_id => @range.id, :compound => false
- assert_response :redirect
- end
-end
diff --git a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_reading_controller_test.rb b/plugins/mezuro/test/functional/myprofile/mezuro_plugin_reading_controller_test.rb
deleted file mode 100644
index 47b5f20..0000000
--- a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_reading_controller_test.rb
+++ /dev/null
@@ -1,83 +0,0 @@
-require 'test_helper'
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_group_content_fixtures"
-
-class MezuroPluginReadingControllerTest < ActionController::TestCase
-
- def setup
- @controller = MezuroPluginReadingController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Profile)
-
- @reading = ReadingFixtures.reading
- @created_reading = ReadingFixtures.created_reading
- @reading_hash = ReadingFixtures.hash
- @content = MezuroPlugin::ReadingGroupContent.new(:profile => @profile, :name => name)
- @content.expects(:send_reading_group_to_service).returns(nil)
- @content.save
- end
-
- should 'set variables to create a new reading' do
- parser = "|*|"
- Kalibro::Reading.expects(:readings_of).with(@content.reading_group_id).returns([@reading])
- get :new, :profile => @profile.identifier, :id => @content.id
- assert_equal parser, assigns(:parser)
- assert_equal ["#{@reading.label}#{parser}#{@reading.grade}#{parser}"], assigns(:labels_and_grades)
- assert_equal @content.id, assigns(:reading_group_content).id
- assert_response :success
- end
-
- should 'create a reading' do
- Kalibro::Reading.expects(:new).with(@reading_hash.to_s).returns(@created_reading)
- @created_reading.expects(:save).with(@content.reading_group_id).returns(true)
- get :save, :profile => @profile.identifier, :id => @content.id, :reading => @reading_hash
- assert @created_reading.errors.empty?
- assert_response :redirect
- end
-
- should 'put an Exception in reading when an error occurs in create action' do
- @created_reading.errors = [Exception.new]
- Kalibro::Reading.expects(:new).with(@reading_hash.to_s).returns(@created_reading)
- @created_reading.expects(:save).with(@content.reading_group_id).returns(false)
- get :save, :profile => @profile.identifier, :id => @content.id, :reading => @reading_hash
- assert !@created_reading.errors.empty?
- assert_response :redirect
- end
-
- should 'set variables to edit a reading' do
- parser = "|*|"
- another_reading = ReadingFixtures.reading
- another_reading.id = 10
- Kalibro::Reading.expects(:readings_of).with(@content.reading_group_id).returns([@reading, another_reading])
- Kalibro::Reading.expects(:find).with(@reading.id.to_s).returns(@reading)
- get :edit, :profile => @profile.identifier, :id => @content.id, :reading_id => @reading.id
- assert_equal @content.id, assigns(:reading_group_content).id
- assert_equal @reading, assigns(:reading)
- assert_equal parser, assigns(:parser)
- assert_equal ["#{another_reading.label}#{parser}#{another_reading.grade}#{parser}"], assigns(:labels_and_grades)
- assert_response :success
- end
-
- should 'destroy a reading' do
- @reading.expects(:destroy)
- Kalibro::Reading.expects(:find).with(@reading.id.to_s).returns(@reading)
-
- get :destroy, :profile => @profile.identifier, :id => @content.id, :reading_id => @reading.id
-
- assert @reading.errors.empty?
- assert_response :redirect
- end
-
- should 'put an Exception in reading when an error occurs in destroy action' do
- @reading.errors = [Exception.new]
- @reading.expects(:destroy)
- Kalibro::Reading.expects(:find).with(@reading.id.to_s).returns(@reading)
-
- get :destroy, :profile => @profile.identifier, :id => @content.id, :reading_id => @reading.id
-
- assert !@reading.errors.empty?
- assert_response :redirect
- end
-end
diff --git a/plugins/mezuro/test/functional/profile/mezuro_plugin_module_result_controller_test.rb b/plugins/mezuro/test/functional/profile/mezuro_plugin_module_result_controller_test.rb
deleted file mode 100644
index 6ef3bba..0000000
--- a/plugins/mezuro/test/functional/profile/mezuro_plugin_module_result_controller_test.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'test_helper'
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/module_result_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_result_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/date_metric_result_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/date_module_result_fixtures"
-
-class MezuroPluginModuleResultControllerTest < ActionController::TestCase
-
- def setup
- @controller = MezuroPluginModuleResultController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Community)
-
- @module_result_hash = ModuleResultFixtures.module_result_hash
- @metric_result_hash = MetricResultFixtures.native_metric_result_hash
- @date_metric_result_hash = DateMetricResultFixtures.date_metric_result_hash
- @date_module_result_hash = DateModuleResultFixtures.date_module_result_hash
- end
-
- should 'find module result on kalibro' do
- parent_module_result = ModuleResultFixtures.parent_module_result_hash
- Kalibro::ModuleResult.expects(:request).with(:get_module_result, { :module_result_id => @module_result_hash[:id].to_i }).
- returns({:module_result => @module_result_hash})
- Kalibro::MetricResult.expects(:request).with(:metric_results_of, { :module_result_id => @module_result_hash[:id].to_i }).
- returns({:metric_result => @metric_result_hash})
- Kalibro::ModuleResult.expects(:request).with(:get_module_result, { :module_result_id => @module_result_hash[:parent_id].to_i }).
- returns({:module_result => parent_module_result})
- Kalibro::ModuleResult.expects(:request).with(:children_of, {:module_result_id => @module_result_hash[:id].to_i}).
- returns({:module_result => nil})
- get :module_result, :profile => @profile.identifier, :module_result_id => @module_result_hash[:id]
- assert_equal @module_result_hash[:grade].to_f, assigns(:module_result).grade
- assert_equal @metric_result_hash[:value].to_f, assigns(:metric_results).first.value
- assert_response :success
- #TODO assert_select('h5', 'Metric results for: Qt-Calculator (APPLICATION)')
- end
-
- should 'get metric result history' do
- metric_name = @metric_result_hash[:configuration][:metric][:name]
- Kalibro::MetricResult.expects(:request).with(:history_of_metric, { :metric_name => metric_name, :module_result_id => @module_result_hash[:id].to_i }).
- returns({:date_metric_result => @date_metric_result_hash})
- get :metric_result_history, :profile => @profile.identifier, :module_result_id => @module_result_hash[:id], :metric_name => metric_name
- assert_equal DateTime.parse(@date_metric_result_hash[:date]), assigns(:history).first.date
- assert_response :success
- #TODO assert_select
- end
-
- should 'get module result history' do
- Kalibro::ModuleResult.expects(:request).with(:history_of_module, { :module_result_id => @module_result_hash[:id].to_i }).
- returns({:date_module_result => @date_module_result_hash})
- get :module_result_history, :profile => @profile.identifier, :module_result_id => @module_result_hash[:id]
- assert_equal DateTime.parse(@date_module_result_hash[:date]), assigns(:history).first.date
- assert_response :success
- #TODO assert_select
- end
-
-end
diff --git a/plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb b/plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb
deleted file mode 100644
index 0fb8c96..0000000
--- a/plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require 'test_helper'
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/processing_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/throwable_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/repository_fixtures"
-
-
-class MezuroPluginProcessingControllerTest < ActionController::TestCase
- def setup
- @controller = MezuroPluginProcessingController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Community)
-
- @repository_id = RepositoryFixtures.repository.id
- @processing = ProcessingFixtures.processing
- @processing_hash = ProcessingFixtures.processing_hash
- @processing_with_error_hash = ProcessingFixtures.processing_with_error_hash
- end
-
- should 'render last processing state' do
- Kalibro::Processing.expects(:processing_of).with(@repository_id).returns(@processing)
- get :state, :profile => @profile.identifier, :repository_id => @repository_id
- assert_response :success
- assert_equal @processing.state, @response.body
- end
-
- should 'render a processing state in a specific date' do
- Kalibro::Processing.expects(:processing_with_date_of).with(@repository_id, @processing.date).returns(@processing)
- get :state, :profile => @profile.identifier, :repository_id => @repository_id, :date => @processing.date
- assert_response :success
- assert_equal @processing.state, @response.body
- end
-
- should 'render processing with error' do
- Kalibro::Processing.expects(:request).with(:has_ready_processing, {:repository_id => @repository_id}).returns({:exists => false})
- Kalibro::Processing.expects(:request).with(:last_processing, :repository_id => @repository_id).returns({:processing => @processing_with_error_hash})
- get :processing, :profile => @profile.identifier, :repository_id => @repository_id
- assert_response :success
- assert_equal @processing_with_error_hash[:state], assigns(:processing).state
- #TODO How to assert from view? assert_select('h3', 'ERROR')
- end
-
- should 'test project result without date' do
- Kalibro::Processing.expects(:request).with(:has_ready_processing, {:repository_id => @repository_id}).returns({:exists => true})
- Kalibro::Processing.expects(:request).with(:last_ready_processing, {:repository_id => @repository_id}).returns({:processing => @processing_hash})
- get :processing, :profile => @profile.identifier, :repository_id => @repository_id
- assert_response :success
- assert_select('h4', 'Last Result')
- end
-
- should 'test project results from a specific date' do
- Kalibro::Processing.expects(:request).with(:has_processing_after, {:repository_id => @repository_id, :date => @processing.date}).returns({:exists => true})
- Kalibro::Processing.expects(:request).with(:first_processing_after, :repository_id => @repository_id, :date => @processing.date).returns({:processing => @processing_hash})
- get :processing, :profile => @profile.identifier, :repository_id => @repository_id, :date => @processing.date
- assert_response :success
- assert_select('h4', 'Last Result')
- end
-
-end
diff --git a/plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb b/plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb
deleted file mode 100644
index f470297..0000000
--- a/plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-require 'test_helper'
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/processing_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/throwable_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/repository_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/project_content_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures"
-
-class MezuroPluginRepositoryControllerTest < ActionController::TestCase
-
- def setup
- @controller = MezuroPluginRepositoryController.new
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- @profile = fast_create(Community)
-
- @configuration = ConfigurationFixtures.configuration
- @repository_types = RepositoryFixtures.types
- @all_configurations = ConfigurationFixtures.all
- @repository = RepositoryFixtures.repository
- @repository_hash = RepositoryFixtures.hash
- @content = MezuroPlugin::ProjectContent.new(:profile => @profile, :name => name)
- @content.expects(:send_project_to_service).returns(nil)
- @content.save
- end
-
- should 'set variables to create a new repository' do
- Kalibro::Repository.expects(:repository_types).returns(@repository_types)
- Kalibro::Configuration.expects(:all).returns(@all_configurations)
-
- get :new, :profile => @profile.identifier, :id => @content.id
-
- assert_equal @content.id, assigns(:project_content).id
- assert_equal @repository_types, assigns(:repository_types)
- assert_equal @all_configurations.first.name, assigns(:configuration_select).first.first
- assert_equal @all_configurations.first.id, assigns(:configuration_select).first.last
- assert_response :success
- end
-
- should 'save a repository' do
- Kalibro::Repository.expects(:new).returns(@repository)
- @repository.expects(:save).with(@content.project_id).returns(true)
- @repository.expects(:process)
- get :save, :profile => @profile.identifier, :id => @content.id, :repository => @repository_hash
- assert @repository.errors.empty?
- assert_response :redirect
- end
-
- should 'not save a repository' do
- @repository.errors = [Exception.new]
- Kalibro::Repository.expects(:new).returns(@repository)
- @repository.expects(:save).with(@content.project_id).returns(false)
- get :save, :profile => @profile.identifier, :id => @content.id, :repository => @repository_hash
- assert !@repository.errors.empty?
- assert_response :redirect
- end
-
- should 'set variables to edit a repository' do
- Kalibro::Repository.expects(:repository_types).returns(@repository_types)
- Kalibro::Configuration.expects(:all).returns(@all_configurations)
- Kalibro::Repository.expects(:repositories_of).with(@content.project_id).returns([@repository])
-
- get :edit, :profile => @profile.identifier, :id => @content.id, :repository_id => @repository.id
-
- assert_equal @content.id, assigns(:project_content).id
- assert_equal @repository_types, assigns(:repository_types)
- assert_equal @all_configurations.first.name, assigns(:configuration_select).first.first
- assert_equal @all_configurations.first.id, assigns(:configuration_select).first.last
- assert_equal @repository, assigns(:repository)
- assert_response :success
- end
-
- should 'set variables to show a repository' do
- Kalibro::Repository.expects(:repositories_of).with(@content.project_id).returns([@repository])
- Kalibro::Configuration.expects(:find).with(@repository.configuration_id).returns(@configuration)
-
- get :show, :profile => @profile.identifier, :id => @content.id, :repository_id => @repository.id
-
- assert_equal @content.id, assigns(:project_content).id
- assert_equal @repository, assigns(:repository)
- assert_equal @configuration.name, assigns(:configuration_name)
- assert_response :success
- end
-
- should 'destroy a repository' do
- Kalibro::Repository.expects(:new).with(:id => @repository.id.to_s).returns(@repository)
- @repository.expects(:destroy)
- get :destroy, :profile => @profile.identifier, :id => @content.id, :repository_id => @repository.id
-
- assert @repository.errors.empty?
- assert_response :redirect
- end
-
- should 'not destroy a repository' do
- @repository.errors = [Exception.new]
- Kalibro::Repository.expects(:new).with(:id => @repository.id.to_s).returns(@repository)
- @repository.expects(:destroy)
- get :destroy, :profile => @profile.identifier, :id => @content.id, :repository_id => @repository.id
-
- #TODO verify if it is redirected to the right page
- assert_response :redirect
- end
-end
diff --git a/plugins/mezuro/test/unit/kalibro/base_tool_test.rb b/plugins/mezuro/test/unit/kalibro/base_tool_test.rb
deleted file mode 100644
index 3ca3b76..0000000
--- a/plugins/mezuro/test/unit/kalibro/base_tool_test.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require "test_helper"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/base_tool_fixtures"
-
-class BaseToolTest < ActiveSupport::TestCase
-
- def setup
- @hash = BaseToolFixtures.base_tool_hash
- @base_tool = BaseToolFixtures.base_tool
- end
-
- should 'create base tool from hash' do
- assert_equal @hash[:name], Kalibro::BaseTool.new(@hash).name
- end
-
- should 'get base tool names' do
- names = ['Analizo', 'Checkstyle']
- Kalibro::BaseTool.expects(:request).with(:all_base_tool_names).returns({:base_tool_name => names})
- assert_equal names, Kalibro::BaseTool.all_names
- end
-
- should 'get base tool by name' do
- request_body = {:base_tool_name => @base_tool.name}
- Kalibro::BaseTool.expects(:request).with(:get_base_tool, request_body).returns({:base_tool => @hash})
- assert_equal @base_tool.name, Kalibro::BaseTool.find_by_name(@base_tool.name).name
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/compound_metric_test.rb b/plugins/mezuro/test/unit/kalibro/compound_metric_test.rb
deleted file mode 100644
index 3573f8e..0000000
--- a/plugins/mezuro/test/unit/kalibro/compound_metric_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/compound_metric_fixtures"
-
-class CompoundMetricTest < ActiveSupport::TestCase
-
- def setup
- @hash = CompoundMetricFixtures.compound_metric_hash
- @metric = CompoundMetricFixtures.compound_metric
- end
-
- should 'create compound metric from hash' do
- assert_equal @hash[:script], Kalibro::CompoundMetric.new(@hash).script
- end
-
- should 'convert compound metric to hash' do
- assert_equal @hash, @metric.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/compound_metric_with_error_test.rb b/plugins/mezuro/test/unit/kalibro/compound_metric_with_error_test.rb
deleted file mode 100644
index 9fb8c34..0000000
--- a/plugins/mezuro/test/unit/kalibro/compound_metric_with_error_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/compound_metric_with_error_fixtures"
-
-class CompoundMetricWithErrorTest < ActiveSupport::TestCase
-
- def setup
- @hash = CompoundMetricWithErrorFixtures.compound_metric_with_error_hash
- @compound_metric_with_error = CompoundMetricWithErrorFixtures.compound_metric_with_error
- end
-
- should 'create error from hash' do
- assert_equal @hash[:error][:message], Kalibro::CompoundMetricWithError.new(@hash).error.message
- end
-
- should 'convert error to hash' do
- assert_equal @hash, @compound_metric_with_error.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/configuration_test.rb b/plugins/mezuro/test/unit/kalibro/configuration_test.rb
deleted file mode 100644
index 5617f37..0000000
--- a/plugins/mezuro/test/unit/kalibro/configuration_test.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/configuration_fixtures"
-
-class ConfigurationTest < ActiveSupport::TestCase
-
- def setup
- @hash = ConfigurationFixtures.configuration_hash
- @configuration = ConfigurationFixtures.configuration
- @created_configuration = ConfigurationFixtures.created_configuration
- end
-
- should 'initialize configuration' do
- assert_equal @hash[:name], Kalibro::Configuration.new(@hash).name
- end
-
- should 'convert configuration to hash' do
- assert_equal @hash, @configuration.to_hash
- end
-
- should 'answer if configuration exists in kalibro' do
- Kalibro::Configuration.expects(:request).with(:configuration_exists, {:configuration_id => @configuration.id}).returns({:exists => true})
- assert Kalibro::Configuration.exists?(@configuration.id)
- end
-
- should 'find a configuration' do
- Kalibro::Configuration.expects(:request).with(:configuration_exists, {:configuration_id => @configuration.id}).returns({:exists => true})
- Kalibro::Configuration.expects(:request).with(:get_configuration, {:configuration_id => @configuration.id}).returns(:configuration => @hash)
- assert_equal @hash[:name], Kalibro::Configuration.find(@configuration.id).name
- end
-
- should 'return exception when configuration doesnt exist' do
- Kalibro::Configuration.expects(:request).with(:configuration_exists, {:configuration_id => @configuration.id}).returns({:exists => false})
- assert_raise(Kalibro::Errors::RecordNotFound){Kalibro::Configuration.find(@configuration.id)}
- end
-
- should 'get all configurations' do
- Kalibro::Configuration.expects(:request).with(:all_configurations).returns({:configuration => [@hash]})
- assert_equal @hash[:name], Kalibro::Configuration.all.first.name
- end
-
- should 'return true when configuration is saved successfully' do
- id_from_kalibro = 1
- Kalibro::Configuration.expects(:request).with(:save_configuration, {:configuration => @created_configuration.to_hash}).returns(:configuration_id => id_from_kalibro)
- assert @created_configuration.save
- assert_equal id_from_kalibro, @created_configuration.id
- end
-
- should 'return false when configuration is not saved successfully' do
- Kalibro::Configuration.expects(:request).with(:save_configuration, {:configuration => @created_configuration.to_hash}).raises(Exception.new)
- assert !(@created_configuration.save)
- assert_nil @created_configuration.id
- end
-
- should 'remove existent configuration from service' do
- Kalibro::Configuration.expects(:request).with(:delete_configuration, {:configuration_id => @configuration.id})
- @configuration.destroy
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/date_metric_result_test.rb b/plugins/mezuro/test/unit/kalibro/date_metric_result_test.rb
deleted file mode 100644
index 18218c5..0000000
--- a/plugins/mezuro/test/unit/kalibro/date_metric_result_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/date_metric_result_fixtures"
-
-class DateMetricResultTest < ActiveSupport::TestCase
-
- def setup
- @hash = DateMetricResultFixtures.date_metric_result_hash
- @date_metric_result = DateMetricResultFixtures.date_metric_result
- end
-
- should 'create date_metric_result from hash' do
- assert_equal @hash[:metric_result][:id].to_i, Kalibro::DateMetricResult.new(@hash).metric_result.id
- end
-
- should 'convert date_metric_result to hash' do
- assert_equal @hash, @date_metric_result.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/date_module_result_test.rb b/plugins/mezuro/test/unit/kalibro/date_module_result_test.rb
deleted file mode 100644
index 97a482c..0000000
--- a/plugins/mezuro/test/unit/kalibro/date_module_result_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/date_module_result_fixtures"
-
-class DateModuleResultTest < ActiveSupport::TestCase
-
- def setup
- @hash = DateModuleResultFixtures.date_module_result_hash
- @date_module_result = DateModuleResultFixtures.date_module_result
- end
-
- should 'create date_module_result from hash' do
- assert_equal @hash[:module_result][:id].to_i, Kalibro::DateModuleResult.new(@hash).module_result.id
- end
-
- should 'convert date_module_result to hash' do
- assert_equal @hash, @date_module_result.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/error_test.rb b/plugins/mezuro/test/unit/kalibro/error_test.rb
deleted file mode 100644
index 121e14f..0000000
--- a/plugins/mezuro/test/unit/kalibro/error_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/error_fixtures"
-
-class ErrorTest < ActiveSupport::TestCase
-
- def setup
- @hash = ErrorFixtures.error_hash
- @error = ErrorFixtures.error
- end
-
- should 'create error from hash' do
- assert_equal @hash[:message], Kalibro::Error.new(@hash).message
- end
-
- should 'convert error to hash' do
- assert_equal @hash, @error.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/metric_configuration_snapshot_test.rb b/plugins/mezuro/test/unit/kalibro/metric_configuration_snapshot_test.rb
deleted file mode 100644
index a8f1018..0000000
--- a/plugins/mezuro/test/unit/kalibro/metric_configuration_snapshot_test.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_snapshot_fixtures"
-
-class MetricConfigurationSnapshotTest < ActiveSupport::TestCase
-
- def setup
- @hash = MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash
- @hash2 = MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_hash_with_2_elements
- @metric_configuration_snapshot = MetricConfigurationSnapshotFixtures.metric_configuration_snapshot
- @metric_configuration_snapshot2 = MetricConfigurationSnapshotFixtures.metric_configuration_snapshot_with_2_elements
- end
-
- should 'create and convert metric configuration snapshot from hash' do
- assert_equal @hash[:code], Kalibro::MetricConfigurationSnapshot.new(@hash).code
- assert_equal @hash[:weight].to_f, @metric_configuration_snapshot.weight
- end
-
- should 'create and convert metric configuration snapshot from hash with 2 elements' do
- assert_equal @hash2[:code], Kalibro::MetricConfigurationSnapshot.new(@hash2).code
- assert_equal @hash2, @metric_configuration_snapshot2.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/metric_configuration_test.rb b/plugins/mezuro/test/unit/kalibro/metric_configuration_test.rb
deleted file mode 100644
index 2bdbca9..0000000
--- a/plugins/mezuro/test/unit/kalibro/metric_configuration_test.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
-
-class MetricConfigurationTest < ActiveSupport::TestCase
-
- def setup
- @native_metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
- @native_metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash
- @created_metric_configuration = MetricConfigurationFixtures.created_metric_configuration
- end
-
- should 'create metric configuration from hash' do
- metric_configuration = Kalibro::MetricConfiguration.new(@native_metric_configuration_hash)
- assert_equal @native_metric_configuration_hash[:code], metric_configuration.code
- assert_equal @native_metric_configuration_hash[:id].to_i, metric_configuration.id
- assert_equal @native_metric_configuration_hash[:reading_group_id].to_i, metric_configuration.reading_group_id
- end
-
- should 'convert metric configuration to hash' do
- assert_equal @native_metric_configuration_hash, @native_metric_configuration.to_hash
- end
-
- should 'get all metric configurations of a configuration' do
- configuration_id = 13
- request_body = { :configuration_id => configuration_id }
- response_hash = {:metric_configuration => [@native_metric_configuration_hash]}
- Kalibro::MetricConfiguration.expects(:request).with(:metric_configurations_of, request_body).returns(response_hash)
- assert_equal @native_metric_configuration.code, Kalibro::MetricConfiguration.metric_configurations_of(configuration_id).first.code
- end
-
- should 'return true when metric configuration is saved successfully' do
- id_from_kalibro = 1
- configuration_id = @created_metric_configuration.configuration_id
- Kalibro::MetricConfiguration.expects(:request).with(:save_metric_configuration, {:metric_configuration => @created_metric_configuration.to_hash, :configuration_id => configuration_id}).returns(:metric_configuration_id => id_from_kalibro)
- assert @created_metric_configuration.save
- assert_equal id_from_kalibro, @created_metric_configuration.id
- end
-
- should 'return false when metric configuration is not saved successfully' do
- configuration_id = @created_metric_configuration.configuration_id
- Kalibro::MetricConfiguration.expects(:request).with(:save_metric_configuration, {:metric_configuration => @created_metric_configuration.to_hash, :configuration_id => configuration_id}).raises(Exception.new)
- assert !(@created_metric_configuration.save)
- assert_nil @created_metric_configuration.id
- end
-
- should 'destroy metric configuration' do
- Kalibro::MetricConfiguration.expects(:request).with(:delete_metric_configuration, :metric_configuration_id => @native_metric_configuration.id)
- @native_metric_configuration.destroy
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/metric_result_test.rb b/plugins/mezuro/test/unit/kalibro/metric_result_test.rb
deleted file mode 100644
index ff5762c..0000000
--- a/plugins/mezuro/test/unit/kalibro/metric_result_test.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/metric_result_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/date_metric_result_fixtures"
-
-class MetricResultTest < ActiveSupport::TestCase
-
- def setup
- @native_hash = MetricResultFixtures.native_metric_result_hash
- @compound_hash = MetricResultFixtures.compound_metric_result_hash
- @result = MetricResultFixtures.native_metric_result
- end
-
- should 'create metric result from hash' do
- metric_result = Kalibro::MetricResult.new(@native_hash)
- assert_equal @native_hash[:configuration][:code], metric_result.configuration.code
- assert_equal @native_hash[:id].to_i, metric_result.id
- assert_equal @native_hash[:value].to_f, metric_result.value
- end
-
- should 'create metric result with aggregated value from hash' do
- hash = @native_hash
- hash[:aggregated_value] = "2.0"
- hash[:value] = "NaN"
- metric_result = Kalibro::MetricResult.new(hash)
- assert_equal @native_hash[:aggregated_value].to_f, metric_result.value
- end
-
- should 'convert metric result to hash' do
- assert_equal @native_hash, @result.to_hash
- end
-
- should 'return descendant results of a metric result' do
- descendant = [31, 13]
- Kalibro::MetricResult.expects(:request).with(:descendant_results_of, {:metric_result_id => @result.id}).returns({:descendant_result => descendant})
- assert_equal descendant, @result.descendant_results
- end
-
- should 'return metric results of a module result' do
- id = 31
- Kalibro::MetricResult.expects(:request).with(:metric_results_of, {:module_result_id => id}).returns(:metric_result => [@native_hash, @compound_hash])
- assert_equal @native_hash[:id].to_i, Kalibro::MetricResult.metric_results_of(id).first.id
- end
-
- should 'return history of a metric with a module result id' do
- module_result_id = 31
- Kalibro::MetricResult.expects(:request).with(:history_of_metric, {:metric_name => @result.configuration.metric.name, :module_result_id => module_result_id}).returns({:date_metric_result => DateMetricResultFixtures.date_metric_result_hash})
- assert_equal DateMetricResultFixtures.date_metric_result_hash[:metric_result][:id].to_i, Kalibro::MetricResult.history_of(@result.configuration.metric.name, module_result_id).first.metric_result.id
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/metric_test.rb b/plugins/mezuro/test/unit/kalibro/metric_test.rb
deleted file mode 100644
index 11c2759..0000000
--- a/plugins/mezuro/test/unit/kalibro/metric_test.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require "test_helper"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_fixtures"
-
-class MetricTest < ActiveSupport::TestCase
-
- def setup
- @native_hash = MetricFixtures.amloc_hash
- @native = MetricFixtures.amloc
- @compound_hash = MetricFixtures.compound_metric_hash
- @compound = MetricFixtures.compound_metric
- end
-
- should 'create native metric from hash' do
- assert_equal @native_hash[:name], Kalibro::Metric.new(@native_hash).name
- end
-
- should 'convert native metric to hash' do
- assert_equal @native_hash, @native.to_hash
- end
-
- should 'create compound metric from hash' do
- assert_equal @compound_hash[:script], Kalibro::Metric.new(@compound_hash).script
- end
-
- should 'convert compound metric to hash' do
- assert_equal @compound_hash, @compound.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/module_node_test.rb b/plugins/mezuro/test/unit/kalibro/module_node_test.rb
deleted file mode 100644
index c26dfde..0000000
--- a/plugins/mezuro/test/unit/kalibro/module_node_test.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require "test_helper"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/module_node_fixtures"
-
-class ModuleNodeTest < ActiveSupport::TestCase
-
- def setup
- @hash = ModuleNodeFixtures.module_node_hash
- @node = ModuleNodeFixtures.module_node
- end
-
- should 'create module node from hash' do
- assert_equal( @node.child[0].module.name, Kalibro::ModuleNode.new(@hash).child[0].module.name)
- end
-
- should 'convert children hash to array of ModuleNode' do
- assert_equal @hash, @node.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/module_result_test.rb b/plugins/mezuro/test/unit/kalibro/module_result_test.rb
deleted file mode 100644
index 3ee2756..0000000
--- a/plugins/mezuro/test/unit/kalibro/module_result_test.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-require "test_helper"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/module_result_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/date_module_result_fixtures"
-
-class ModuleResultTest < ActiveSupport::TestCase
-
- def setup
- @hash = ModuleResultFixtures.module_result_hash
- @module_result = ModuleResultFixtures.module_result
- end
-
- should 'create module result' do
- module_result = Kalibro::ModuleResult.new(@hash)
- assert_equal @hash[:id].to_i , module_result.id
- assert_equal @hash[:grade].to_f , module_result.grade
- assert_equal @hash[:parent_id].to_i , module_result.parent_id
- end
-
- should 'convert module result to hash' do
- assert_equal @hash, @module_result.to_hash
- end
-
- should 'find module result' do
- response = {:module_result => @hash}
- Kalibro::ModuleResult.expects(:request).with(:get_module_result, {:module_result_id => @module_result.id}).returns(response)
- assert_equal @module_result.grade, Kalibro::ModuleResult.find(@module_result.id).grade
- end
-
- should 'return children of a module result' do
- response = {:module_result => [@hash]}
- Kalibro::ModuleResult.expects(:request).with(:children_of, {:module_result_id => @module_result.id}).returns(response)
- assert @hash[:id], @module_result.children.first.id
- end
-
- should 'return parents of a module result' do
- parent_module_result = ModuleResultFixtures.parent_module_result_hash
- response = {:module_result => parent_module_result}
- Kalibro::ModuleResult.expects(:request).with(:get_module_result, {:module_result_id => @module_result.parent_id}).returns(response)
- parents = @module_result.parents
- assert parent_module_result[:module][:name], parents.first.module.name
- assert parent_module_result[:module][:name], parents.last.module.name
- end
-
- should 'return history of a module result' do
- Kalibro::ModuleResult.expects(:request).with(:history_of_module, {:module_result_id => @module_result.id}).returns({:date_module_result => [DateModuleResultFixtures.date_module_result_hash]})
- assert_equal DateModuleResultFixtures.date_module_result_hash[:module_result][:id].to_i, Kalibro::ModuleResult.history_of(@module_result.id).first.module_result.id
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/module_test.rb b/plugins/mezuro/test/unit/kalibro/module_test.rb
deleted file mode 100644
index d3e4e2e..0000000
--- a/plugins/mezuro/test/unit/kalibro/module_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/module_fixtures"
-
-class ModuleTest < ActiveSupport::TestCase
-
- def setup
- @hash = ModuleFixtures.module_hash
- @module = ModuleFixtures.module
- end
-
- should 'create module from hash' do
- assert_equal @hash[:name], Kalibro::Module.new(@hash).name
- end
-
- should 'convert module to hash' do
- assert_equal @hash, @module.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/native_metric_test.rb b/plugins/mezuro/test/unit/kalibro/native_metric_test.rb
deleted file mode 100644
index 5f6e0bb..0000000
--- a/plugins/mezuro/test/unit/kalibro/native_metric_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/native_metric_fixtures"
-
-class NativeMetricTest < ActiveSupport::TestCase
-
- def setup
- @hash = NativeMetricFixtures.amloc_hash
- @metric = NativeMetricFixtures.amloc
- end
-
- should 'create native metric from hash' do
- assert_equal @hash[:name], Kalibro::NativeMetric.new(@hash).name
- end
-
- should 'convert native metric to hash' do
- assert_equal @hash, @metric.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/process_time_test.rb b/plugins/mezuro/test/unit/kalibro/process_time_test.rb
deleted file mode 100644
index 449e425..0000000
--- a/plugins/mezuro/test/unit/kalibro/process_time_test.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/process_time_fixtures"
-
-class ProcessTimeTest < ActiveSupport::TestCase
-
- def setup
- @hash = ProcessTimeFixtures.process_time_hash
- @process_time = ProcessTimeFixtures.process_time
- end
-
- should 'create process time from hash' do
- assert_equal @hash[:state], Kalibro::ProcessTime.new(@hash).state
- assert_equal @hash[:time].to_i, Kalibro::ProcessTime.new(@hash).time
- end
-
- should 'convert process time to hash' do
- assert_equal @hash, @process_time.to_hash
- end
-
- should 'get time as an integer' do
- assert_equal 1.class, @process_time.time.class
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/processing_test.rb b/plugins/mezuro/test/unit/kalibro/processing_test.rb
deleted file mode 100644
index 22b63a3..0000000
--- a/plugins/mezuro/test/unit/kalibro/processing_test.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/processing_fixtures"
-class ProcessingTest < ActiveSupport::TestCase
-
- def setup
- @hash = ProcessingFixtures.processing_hash
- @processing = ProcessingFixtures.processing
-
- @repository_id = 31
- end
-
- should 'create processing from hash' do
- processing = Kalibro::Processing.new(@hash)
- assert_equal @hash[:results_root_id].to_i, processing.results_root_id
- assert_equal @hash[:process_time].first[:state], processing.process_times.first.state
- assert_equal @hash[:id].to_i, processing.id
- end
-
- should 'convert processing to hash' do
- assert_equal @hash, @processing.to_hash
- end
-
- should 'verify if a repository has a processing' do
- true_repository_id = 31
- false_repository_id = 32
-
- Kalibro::Processing.expects(:request).with(:has_processing, {:repository_id => true_repository_id}).returns({:exists => true})
- Kalibro::Processing.expects(:request).with(:has_processing, {:repository_id => false_repository_id}).returns({:exists => false})
-
- assert Kalibro::Processing.has_processing(true_repository_id)
- assert !Kalibro::Processing.has_processing(false_repository_id)
- end
-
- should 'verify if a repository has a ready processing' do
- true_repository_id = 31
- false_repository_id = 32
-
- Kalibro::Processing.expects(:request).with(:has_ready_processing, {:repository_id => true_repository_id}).returns({:exists => true})
- Kalibro::Processing.expects(:request).with(:has_ready_processing, {:repository_id => false_repository_id}).returns({:exists => false})
-
- assert Kalibro::Processing.has_ready_processing(true_repository_id)
- assert !Kalibro::Processing.has_ready_processing(false_repository_id)
- end
-
- should 'verify if a repository has a processing after a date' do
- true_repository_id = 31
- false_repository_id = 32
-
- Kalibro::Processing.expects(:request).with(:has_processing_after, {:repository_id => true_repository_id, :date => @processing.date}).returns({:exists => true})
- Kalibro::Processing.expects(:request).with(:has_processing_after, {:repository_id => false_repository_id, :date => @processing.date}).returns({:exists => false})
-
- assert Kalibro::Processing.has_processing_after(true_repository_id, @processing.date)
- assert !Kalibro::Processing.has_processing_after(false_repository_id, @processing.date)
- end
-
- should 'verify if a repository has a processing before a date' do
- true_repository_id = 31
- false_repository_id = 32
-
- Kalibro::Processing.expects(:request).with(:has_processing_before, {:repository_id => true_repository_id, :date => @processing.date}).returns({:exists => true})
- Kalibro::Processing.expects(:request).with(:has_processing_before, {:repository_id => false_repository_id, :date => @processing.date}).returns({:exists => false})
-
- assert Kalibro::Processing.has_processing_before(true_repository_id, @processing.date)
- assert !Kalibro::Processing.has_processing_before(false_repository_id, @processing.date)
- end
-
- should 'get last processing state of a repository' do
- Kalibro::Processing.expects(:request).with(:last_processing_state, {:repository_id => @repository_id}).returns({:process_state => @processing.state})
- assert_equal @processing.state, Kalibro::Processing.last_processing_state_of(@repository_id)
- end
-
- should 'get last ready processing of a repository' do
- Kalibro::Processing.expects(:request).with(:last_ready_processing, {:repository_id => @repository_id}).returns({:processing => @hash})
- assert_equal @processing.id, Kalibro::Processing.last_ready_processing_of(@repository_id).id
- end
-
- should 'get first processing of a repository' do
- Kalibro::Processing.expects(:request).with(:first_processing, {:repository_id => @repository_id}).returns({:processing => @hash})
- assert_equal @processing.id, Kalibro::Processing.first_processing_of(@repository_id).id
- end
-
- should 'get last processing of a repository' do
- Kalibro::Processing.expects(:request).with(:last_processing, {:repository_id => @repository_id}).returns({:processing => @hash})
- assert_equal @processing.id, Kalibro::Processing.last_processing_of(@repository_id).id
- end
-
- should 'get first processing after a date of a repository' do
- Kalibro::Processing.expects(:request).with(:first_processing_after, {:repository_id => @repository_id, :date => @processing.date}).returns({:processing => @hash})
- assert_equal @processing.id, Kalibro::Processing.first_processing_after(@repository_id, @processing.date).id
- end
-
- should 'get last processing before a date of a repository' do
- Kalibro::Processing.expects(:request).with(:last_processing_before, {:repository_id => @repository_id, :date => @processing.date}).returns({:processing => @hash})
- assert_equal @processing.id, Kalibro::Processing.last_processing_before(@repository_id, @processing.date).id
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/project_result_test.rb b/plugins/mezuro/test/unit/kalibro/project_result_test.rb
deleted file mode 100644
index 5024db2..0000000
--- a/plugins/mezuro/test/unit/kalibro/project_result_test.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/project_result_fixtures"
-
-class ProjectResultTest < ActiveSupport::TestCase
-
- def setup
- @hash = ProjectResultFixtures.project_result_hash
- @project_result = ProjectResultFixtures.project_result
-
- @project_name = @project_result.project.name
- @date = @project_result.date
- @flag = DateTime.now.sec % 2 == 0 #random choose between true or false
-
- @request = {:project_name => @project_name}
- @request_with_date = {:project_name => @project_name, :date => @date}
- @flag_response = {:has_results => @flag}
- @result_response = {:project_result => @project_result.to_hash}
- end
-
- should 'create project result from hash' do
- assert_equal @project_result.analysis_time, Kalibro::ProjectResult.new(@hash).analysis_time
- end
-
- should 'convert project result to hash' do
- assert_equal @hash, @project_result.to_hash
- end
-
- should 'get last result' do
- Kalibro::ProjectResult.expects(:request).with('ProjectResult',:get_last_result_of, @request).returns(@result_response)
- assert_equal @project_result.analysis_time , Kalibro::ProjectResult.last_result(@project_name).analysis_time
- end
-
- should 'get first result' do
- Kalibro::ProjectResult.expects(:request).with('ProjectResult',:get_first_result_of, @request).returns(@result_response)
- assert_equal @project_result.analysis_time, Kalibro::ProjectResult.first_result(@project_name).analysis_time
- end
-
- should 'get first result after date' do
- Kalibro::ProjectResult.expects(:request).with('ProjectResult',:get_first_result_after, @request_with_date).returns(@result_response)
- assert_equal @project_result.analysis_time, Kalibro::ProjectResult.first_result_after(@project_name, @date).analysis_time
- end
-
- should 'get last result before date' do
- Kalibro::ProjectResult.expects(:request).with('ProjectResult',:get_last_result_before, @request_with_date).returns(@result_response)
- assert_equal @project_result.analysis_time, Kalibro::ProjectResult.last_result_before(@project_name, @date).analysis_time
- end
-
- should 'verify if project has results' do
- Kalibro::ProjectResult.expects(:request).with('ProjectResult',:has_results_for, @request).returns(@flag_response)
- assert_equal @flag, Kalibro::ProjectResult.has_results?(@project_name)
- end
-
- should 'verify if project has results before date' do
- Kalibro::ProjectResult.expects(:request).with('ProjectResult',:has_results_before, @request_with_date).returns(@flag_response)
- assert_equal @flag, Kalibro::ProjectResult.has_results_before?(@project_name, @date)
- end
-
- should 'verify if project has results after date' do
- Kalibro::ProjectResult.expects(:request).with('ProjectResult',:has_results_after, @request_with_date).returns(@flag_response)
- assert_equal @flag, Kalibro::ProjectResult.has_results_after?(@project_name, @date)
- end
-
- should 'retrieve formatted load time' do
- assert_equal '00:00:14', @project_result.formatted_load_time
- end
-
- should 'retrieve formatted analysis time' do
- assert_equal '00:00:01', @project_result.formatted_analysis_time
- end
-
- should 'retrive complex module' do
- assert_equal @hash[:source_tree][:child][0][:child].first, @project_result.node("org.Window").to_hash
- end
-
- should 'return source tree node when nil is given' do
- assert_equal @hash[:source_tree], @project_result.node(nil).to_hash
- end
-
- should 'return source tree node when project name is given' do
- assert_equal @hash[:source_tree], @project_result.node(@project_result.project.name).to_hash
- end
-
- should 'return correct node when module name is given' do
- assert_equal @hash[:source_tree][:child][2], @project_result.node("main").to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/project_test.rb b/plugins/mezuro/test/unit/kalibro/project_test.rb
deleted file mode 100644
index 818b494..0000000
--- a/plugins/mezuro/test/unit/kalibro/project_test.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/project_fixtures"
-
-class ProjectTest < ActiveSupport::TestCase
-
- def setup
- @hash = ProjectFixtures.project_hash
- @project = ProjectFixtures.project
- @created_project = ProjectFixtures.created_project
- end
-
- should 'initialize new project from hash' do
- project = Kalibro::Project.new @hash
- assert_equal @hash[:name], project.name
- assert_equal @hash[:id].to_i, project.id
- end
-
- should 'convert project to hash' do
- hash = @project.to_hash
- assert_equal @project.name, hash[:name]
- end
-
- should 'answer if project exists in kalibro' do
- Kalibro::Project.expects(:request).with(:project_exists, {:project_id => @project.id}).returns({:exists => true})
- assert Kalibro::Project.exists?(@project.id)
- end
-
- should 'find project' do
- Kalibro::Project.expects(:request).with(:project_exists, {:project_id => @project.id}).returns({:exists => true})
- Kalibro::Project.expects(:request).with(:get_project, {:project_id => @project.id}).returns(:project => @hash)
- assert_equal @hash[:name], Kalibro::Project.find(@project.id).name
- end
-
- should 'raise RecordNotFound exception when project doesnt exist' do
- Kalibro::Project.expects(:request).with(:project_exists, {:project_id => @project.id}).returns({:exists => false})
- assert_raise(Kalibro::Errors::RecordNotFound){Kalibro::Project.find(@project.id)}
- end
-
- should 'get all projects when there is only one project' do
- Kalibro::Project.expects(:request).with(:all_projects).returns({:project => @hash})
- assert_equal @hash[:name], Kalibro::Project.all.first.name
- end
-
- should 'get all projects when there are many projects' do
- Kalibro::Project.expects(:request).with(:all_projects).returns({:project => [@hash, @hash]})
- projects = Kalibro::Project.all
- assert_equal @hash[:name], projects.first.name
- assert_equal @hash[:name], projects.last.name
- end
-
- should 'return empty when there are no projects' do
- Kalibro::Project.expects(:request).with(:all_projects).returns({:project => nil})
- assert_equal [], Kalibro::Project.all
- end
-
- should 'return true when project is saved successfully' do
- id_from_kalibro = 1
- Kalibro::Project.expects(:request).with(:save_project, {:project => @created_project.to_hash}).returns(:project_id => id_from_kalibro)
- assert @created_project.save
- assert_equal id_from_kalibro, @created_project.id
- end
-
- should 'return false when project is not saved successfully' do
- Kalibro::Project.expects(:request).with(:save_project, {:project => @created_project.to_hash}).raises(Exception.new)
- assert !(@created_project.save)
- assert_nil @created_project.id
- end
-
- should 'remove existent project from service' do
- Kalibro::Project.expects(:request).with(:delete_project, {:project_id => @project.id})
- @project.destroy
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/range_snapshot_test.rb b/plugins/mezuro/test/unit/kalibro/range_snapshot_test.rb
deleted file mode 100644
index 2b9a42d..0000000
--- a/plugins/mezuro/test/unit/kalibro/range_snapshot_test.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/range_snapshot_fixtures"
-
-class RangeSnapshotTest < ActiveSupport::TestCase
-
- def setup
- @hash = RangeSnapshotFixtures.range_snapshot_hash
- @range_snapshot_with_infinite_range_hash = RangeSnapshotFixtures.range_snapshot_with_infinite_range_hash
- @range_snapshot = RangeSnapshotFixtures.range_snapshot
- @range_snapshot_with_infinite_range = RangeSnapshotFixtures.range_snapshot_with_infinite_range
- end
-
- should 'create range_snapshot from hash' do
- range_snapshot = Kalibro::RangeSnapshot.new(@hash)
- assert_equal @hash[:comments], range_snapshot.comments
- assert_equal @hash[:beginning].to_f, range_snapshot.beginning
- assert_equal @hash[:end].to_f, range_snapshot.end
- assert_equal @hash[:grade].to_f, range_snapshot.grade
- end
-
- should 'create range_snapshot from hash with infinity values' do
- range_snapshot = Kalibro::RangeSnapshot.new(@range_snapshot_with_infinite_range_hash)
- assert_equal -1.0/0, range_snapshot.beginning
- assert_equal 1.0/0, range_snapshot.end
- end
-
- should 'convert range_snapshot to hash' do
- assert_equal @hash, @range_snapshot.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/range_test.rb b/plugins/mezuro/test/unit/kalibro/range_test.rb
deleted file mode 100644
index a605c2b..0000000
--- a/plugins/mezuro/test/unit/kalibro/range_test.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/range_fixtures"
-
-class RangeTest < ActiveSupport::TestCase
-
- def setup
- @hash = RangeFixtures.range_hash
- @range = RangeFixtures.range
- @created_range = RangeFixtures.created_range
- end
-
- should 'create range from hash' do
- assert_equal @hash[:comments], Kalibro::Range.new(@hash).comments
- end
-
- should 'convert range to hash' do
- assert_equal @hash, @range.to_hash
- end
-
- should 'get ranges of a metric configuration' do
- metric_configuration_id = 31
- Kalibro::Range.expects(:request).with(:ranges_of, {:metric_configuration_id => metric_configuration_id}).returns({:range => [@hash]})
- assert_equal @hash[:comments], Kalibro::Range.ranges_of(metric_configuration_id).first.comments
- end
-
- should 'return true when range is saved successfully' do
- id_from_kalibro = 1
- metric_configuration_id = 2
- Kalibro::Range.expects(:request).with(:save_range, {:range => @created_range.to_hash, :metric_configuration_id => metric_configuration_id}).returns(:range_id => id_from_kalibro)
- assert @created_range.save(metric_configuration_id)
- assert_equal id_from_kalibro, @created_range.id
- end
-
- should 'return false when range is not saved successfully' do
- metric_configuration_id = 2
- Kalibro::Range.expects(:request).with(:save_range, {:range => @created_range.to_hash, :metric_configuration_id => metric_configuration_id}).raises(Exception.new)
- assert !(@created_range.save(metric_configuration_id))
- assert_nil @created_range.id
- end
-
- should 'destroy range by id' do
- Kalibro::Range.expects(:request).with(:delete_range, {:range_id => @range.id})
- @range.destroy
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/reading_group_test.rb b/plugins/mezuro/test/unit/kalibro/reading_group_test.rb
deleted file mode 100644
index 814595a..0000000
--- a/plugins/mezuro/test/unit/kalibro/reading_group_test.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-require "test_helper"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_group_fixtures"
-
-class ReadingGroupTest < ActiveSupport::TestCase
-
- def setup
- @hash = ReadingGroupFixtures.reading_group_hash
- @reading_group = ReadingGroupFixtures.reading_group
- @created_reading_group = ReadingGroupFixtures.created_reading_group
- end
-
- should 'create reading group from hash' do
- assert_equal @hash[:name], Kalibro::ReadingGroup.new(@hash).name
- assert_equal @hash[:id].to_i, Kalibro::ReadingGroup.new(@hash).id
- end
-
- should 'convert reading group to hash' do
- assert_equal @hash, @reading_group.to_hash
- end
-
- should 'verify existence of reading group' do
- fake_id = 0
- Kalibro::ReadingGroup.expects(:request).with(:reading_group_exists, {:group_id => fake_id}).returns({:exists => false})
- Kalibro::ReadingGroup.expects(:request).with(:reading_group_exists, {:group_id => @hash[:id].to_i}).returns({:exists => true})
- assert !Kalibro::ReadingGroup.exists?(fake_id)
- assert Kalibro::ReadingGroup.exists?(@hash[:id].to_i)
- end
-
- should 'get reading group' do
- Kalibro::ReadingGroup.expects(:request).with(:reading_group_exists, {:group_id => @hash[:id]}).returns({:exists => true})
- Kalibro::ReadingGroup.expects(:request).with(:get_reading_group, {:group_id => @hash[:id]}).
- returns({:reading_group => @hash})
- assert_equal @hash[:name], Kalibro::ReadingGroup.find(@hash[:id]).name
- end
-
- should 'get all reading groups when there is only one reading group' do
- Kalibro::ReadingGroup.expects(:request).with(:all_reading_groups).returns({:reading_group => @hash})
- assert_equal @hash[:name], Kalibro::ReadingGroup.all.first.name
- end
-
- should 'get all reading groups when there are many reading groups' do
- Kalibro::ReadingGroup.expects(:request).with(:all_reading_groups).returns({:reading_group => [@hash, @hash]})
- reading_groups = Kalibro::ReadingGroup.all
- assert_equal @hash[:name], reading_groups.first.name
- assert_equal @hash[:name], reading_groups.last.name
- end
-
- should 'return empty when there are no reading groups' do
- Kalibro::ReadingGroup.expects(:request).with(:all_reading_groups).returns({:reading_group => nil})
- assert_equal [], Kalibro::ReadingGroup.all
- end
-
- should 'get reading group of a metric configuration' do
- id = 31
- Kalibro::ReadingGroup.expects(:request).with(:reading_group_of, {:metric_configuration_id => id}).returns({:reading_group => @hash})
- assert_equal @hash[:name], Kalibro::ReadingGroup.reading_group_of(id).name
- end
-
- should 'return true when reading group is saved successfully' do
- id_from_kalibro = 1
- Kalibro::ReadingGroup.expects(:request).with(:save_reading_group, {:reading_group => @created_reading_group.to_hash}).returns(:reading_group_id => id_from_kalibro)
- assert @created_reading_group.save
- assert_equal id_from_kalibro, @created_reading_group.id
- end
-
- should 'return false when reading group is not saved successfully' do
- Kalibro::ReadingGroup.expects(:request).with(:save_reading_group, {:reading_group => @created_reading_group.to_hash}).raises(Exception.new)
- assert !(@created_reading_group.save)
- assert_nil @created_reading_group.id
- end
-
- should 'destroy reading group by id' do
- Kalibro::ReadingGroup.expects(:request).with(:delete_reading_group, {:group_id => @reading_group.id})
- @reading_group.destroy
- end
-
-end
-
diff --git a/plugins/mezuro/test/unit/kalibro/reading_test.rb b/plugins/mezuro/test/unit/kalibro/reading_test.rb
deleted file mode 100644
index 0149b47..0000000
--- a/plugins/mezuro/test/unit/kalibro/reading_test.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require "test_helper"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_fixtures"
-
-class ReadingTest < ActiveSupport::TestCase
-
- def setup
- @hash = ReadingFixtures.reading_hash
- @reading = ReadingFixtures.reading
- @created_reading = ReadingFixtures.created_reading
- end
-
- should 'create reading from hash' do
- assert_equal @hash[:label], Kalibro::Reading.new(@hash).label
- assert_equal @hash[:id].to_i, Kalibro::Reading.new(@hash).id
- assert_equal @hash[:grade].to_f, Kalibro::Reading.new(@hash).grade
- end
-
- should 'convert reading to hash' do
- assert_equal @hash, @reading.to_hash
- end
-
- should 'get reading' do
- Kalibro::Reading.expects(:request).with(:get_reading, {:reading_id => @hash[:id]}).
- returns({:reading => @hash})
- assert_equal @hash[:label], Kalibro::Reading.find(@hash[:id]).label
- end
-
- should 'get reading of a range' do
- range_id = 31
- Kalibro::Reading.expects(:request).with(:reading_of, {:range_id => range_id}).returns({:reading => @hash})
- assert_equal @hash[:label], Kalibro::Reading.reading_of(range_id).label
- end
-
- should 'get readings of a reading group' do
- reading_group_id = 31
- Kalibro::Reading.expects(:request).with(:readings_of, {:group_id => reading_group_id}).returns({:reading => [@hash]})
- assert_equal @hash[:label], Kalibro::Reading.readings_of(reading_group_id).first.label
- end
-
- should 'return true when reading is saved successfully' do
- id_from_kalibro = 1
- Kalibro::Reading.expects(:request).with(:save_reading, {:group_id => @created_reading.group_id, :reading => @created_reading.to_hash}).returns(:reading_id => id_from_kalibro)
- assert @created_reading.save
- assert_equal id_from_kalibro, @created_reading.id
- end
-
- should 'return false when reading is not saved successfully' do
- Kalibro::Reading.expects(:request).with(:save_reading, {:group_id => @created_reading.group_id, :reading => @created_reading.to_hash}).raises(Exception.new)
- assert !(@created_reading.save)
- assert_nil @created_reading.id
- end
-
- should 'destroy reading by id' do
- Kalibro::Reading.expects(:request).with(:delete_reading, {:reading_id => @reading.id})
- @reading.destroy
- end
-
-end
-
diff --git a/plugins/mezuro/test/unit/kalibro/repository_test.rb b/plugins/mezuro/test/unit/kalibro/repository_test.rb
deleted file mode 100644
index 3a0862e..0000000
--- a/plugins/mezuro/test/unit/kalibro/repository_test.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/repository_fixtures"
-
-class RepositoryTest < ActiveSupport::TestCase
-
- def setup
- @hash = RepositoryFixtures.repository_hash
- @repository = RepositoryFixtures.repository
- @created_repository = RepositoryFixtures.created_repository
- end
-
- should 'new repository from hash' do
- repository = Kalibro::Repository.new(@hash)
- assert_equal @hash[:type], repository.type
- assert_equal @hash[:id].to_i, repository.id
- assert_equal @hash[:process_period].to_i, repository.process_period
- assert_equal @hash[:configuration_id].to_i, repository.configuration_id
- end
-
- should 'convert repository to hash' do
- assert_equal @hash, @repository.to_hash
- end
-
- should 'get supported repository types' do
- types = ['BAZAAR', 'GIT', 'SUBVERSION']
- Kalibro::Repository.expects(:request).with(:supported_repository_types).returns({:supported_type => types})
- assert_equal types, Kalibro::Repository.repository_types
- end
-
- should 'get repositories of a project' do
- project_id = 31
- Kalibro::Repository.expects(:request).with(:repositories_of, {:project_id => project_id}).returns({:repository => [@hash]})
- assert_equal @hash[:name], Kalibro::Repository.repositories_of(project_id).first.name
- end
-
- should 'return true when repository is saved successfully' do
- id_from_kalibro = 1
- Kalibro::Repository.expects(:request).with(:save_repository, {:repository => @created_repository.to_hash, :project_id => @created_repository.project_id}).returns(:repository_id => id_from_kalibro)
- assert @created_repository.save
- assert_equal id_from_kalibro, @created_repository.id
- end
-
- should 'return false when repository is not saved successfully' do
- Kalibro::Repository.expects(:request).with(:save_repository, {:repository => @created_repository.to_hash, :project_id => @created_repository.project_id}).raises(Exception.new)
- assert !(@created_repository.save)
- assert_nil @created_repository.id
- end
-
- should 'destroy repository by id' do
- Kalibro::Repository.expects(:request).with(:delete_repository, {:repository_id => @repository.id})
- @repository.destroy
- end
-
- should 'process repository' do
- Kalibro::Repository.expects(:request).with(:process_repository, {:repository_id => @repository.id});
- @repository.process
- end
-
- should 'cancel processing of a repository' do
- Kalibro::Repository.expects(:request).with(:cancel_processing_of_repository, {:repository_id => @repository.id});
- @repository.cancel_processing_of_repository
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/stack_trace_element_test.rb b/plugins/mezuro/test/unit/kalibro/stack_trace_element_test.rb
deleted file mode 100644
index fb1b4cf..0000000
--- a/plugins/mezuro/test/unit/kalibro/stack_trace_element_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/stack_trace_element_fixtures"
-
-class StackTraceElementTest < ActiveSupport::TestCase
-
- def setup
- @hash = StackTraceElementFixtures.stack_trace_element_hash
- @stack_trace_element = StackTraceElementFixtures.stack_trace_element
- end
-
- should 'create stack trace element from hash' do
- assert_equal @hash[:method_name], Kalibro::StackTraceElement.new(@hash).method_name
- end
-
- should 'convert stack trace element to hash' do
- assert_equal @hash, @stack_trace_element.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/kalibro/throwable_test.rb b/plugins/mezuro/test/unit/kalibro/throwable_test.rb
deleted file mode 100644
index 040805b..0000000
--- a/plugins/mezuro/test/unit/kalibro/throwable_test.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/throwable_fixtures"
-
-class ThrowableTest < ActiveSupport::TestCase
-
- def setup
- @hash = ThrowableFixtures.throwable_hash
- @throwable = ThrowableFixtures.throwable
- end
-
- should 'create throwable from hash' do
- assert_equal @hash[:message], Kalibro::Throwable.new(@hash).message
- end
-
- should 'convert throwable to hash' do
- assert_equal @hash, @throwable.to_hash
- end
-
-end
diff --git a/plugins/mezuro/test/unit/mezuro_plugin/configuration_content_test.rb b/plugins/mezuro/test/unit/mezuro_plugin/configuration_content_test.rb
deleted file mode 100644
index 5fe286b..0000000
--- a/plugins/mezuro/test/unit/mezuro_plugin/configuration_content_test.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/configuration_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/configuration_content_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/range_fixtures"
-
-class ConfigurationContentTest < ActiveSupport::TestCase
-
- def setup
- @configuration = ConfigurationFixtures.configuration
- @content = ConfigurationContentFixtures.configuration_content
- @created_configuration = ConfigurationFixtures.created_configuration
- @content_hash = ConfigurationContentFixtures.configuration_content_hash
- @configuration_hash = {:name => @content_hash[:name], :description => @content_hash[:description], :id => @content_hash[:configuration_id]}
- @created_content = ConfigurationContentFixtures.created_configuration_content
-
- @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
- @range = RangeFixtures.range
- end
-
- should 'be an article' do
- assert_kind_of Article, @content
- end
-
- should 'provide proper short description' do
- assert_equal 'Mezuro configuration', MezuroPlugin::ConfigurationContent.short_description
- end
-
- should 'provide proper description' do
- assert_equal 'Set of metric configurations to interpret a Kalibro project', MezuroPlugin::ConfigurationContent.description
- end
-
- should 'have an html view' do
- assert_not_nil @content.to_html
- end
-
- should 'not save a configuration with an existing cofiguration name in kalibro' do
- Kalibro::Configuration.expects(:all).returns([@configuration])
- @content.send :validate_configuration_name
- assert_equal "Configuration name already exists in Kalibro", @content.errors.on_base
- end
-
- should 'get configuration from service' do
- Kalibro::Configuration.expects(:find).with(@content.configuration_id).returns(@configuration)
- assert_equal @configuration, @content.kalibro_configuration
- end
-
- should 'send configuration to service after saving' do
- @content.expects :send_configuration_to_service
- @content.run_callbacks :before_save
- end
-
- should 'create new configuration' do
- Kalibro::Configuration.expects(:create).with(:name => @created_content.name, :description => @created_content.description, :id => nil).returns(@configuration)
- @created_content.send :send_configuration_to_service
- assert_equal @configuration.id, @created_content.configuration_id
- end
-
- should 'clone configuration' do
- clone_id = @configuration.id
- @content.configuration_to_clone_id = clone_id
- Kalibro::Configuration.expects(:create).with(:id => @content.configuration_id, :name => @content.name, :description => @content.description).returns(@configuration)
- Kalibro::MetricConfiguration.expects(:metric_configurations_of).with(@configuration.id).returns([@metric_configuration])
- Kalibro::MetricConfiguration.expects(:request).returns(:metric_configuration_id => @metric_configuration.id)
- Kalibro::Range.expects(:ranges_of).with(@metric_configuration.id).returns([@range])
- @range.expects(:save).with(@metric_configuration.id).returns(true)
- @content.send :send_configuration_to_service
- end
-
- should 'edit configuration' do
- Kalibro::Configuration.expects(:new).with(@configuration_hash).returns(@configuration)
- @configuration.expects(:save).returns(true)
- @content.send :send_configuration_to_service
- assert_equal @configuration.id, @content.configuration_id
- end
-
- should 'send correct configuration to service but comunication fails' do
- Kalibro::Configuration.expects(:new).with(@configuration_hash).returns(@created_configuration)
- @created_configuration.expects(:save).returns(false)
- @content.send :send_configuration_to_service
- end
-
- should 'remove configuration from service' do
- Kalibro::Configuration.expects(:find).with(@content.configuration_id).returns(@configuration)
- @configuration.expects(:destroy)
- @content.send :remove_configuration_from_service
- end
-
-end
diff --git a/plugins/mezuro/test/unit/mezuro_plugin/helpers/content_viewer_helper_test.rb b/plugins/mezuro/test/unit/mezuro_plugin/helpers/content_viewer_helper_test.rb
deleted file mode 100644
index 3354423..0000000
--- a/plugins/mezuro/test/unit/mezuro_plugin/helpers/content_viewer_helper_test.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require "test_helper"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/metric_configuration_snapshot_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/date_metric_result_fixtures"
-
-class ContentViewerHelperTest < ActiveSupport::TestCase
-
- def setup
- @helper = MezuroPlugin::Helpers::ContentViewerHelper
- end
-
- should 'get the number rounded by two decimal points' do
- assert_equal '4.22', @helper.format_grade('4.22344')
- assert_equal '4.10', @helper.format_grade('4.1')
- assert_equal '4.00', @helper.format_grade('4')
- end
-
- should 'create the periodicity options array' do
- assert_equal [["Not Periodically", 0], ["1 day", 1], ["2 days", 2], ["Weekly", 7], ["Biweekly", 15], ["Monthly", 30]], @helper.periodicity_options
- end
-
- should 'return the correct string for a given periodicity' do
- assert_equal "Not Periodically", @helper.periodicity_option(0)
- assert_equal "1 day", @helper.periodicity_option(1)
- assert_equal "2 days", @helper.periodicity_option(2)
- assert_equal "Weekly", @helper.periodicity_option(7)
- assert_equal "Biweekly", @helper.periodicity_option(15)
- assert_equal "Monthly", @helper.periodicity_option(30)
- end
-
- should 'create the license options array' do
- options = YAML.load_file("#{Rails.root}/plugins/mezuro/licenses.yml")
- options = options.split("; ")
- assert_equal options, @helper.license_options
- end
-
- should 'generate chart from metric result history' do
- chart = "http://chart.apis.google.com/chart?chxt=y,x&chco=c4a000&chf=bg,ls,90,efefef,0.2,ffffff,0.2&chd=s:A9&chl=2011-10-20T18%3A26%3A43%2B00%3A00|2011-10-25T18%3A26%3A43%2B00%3A00&cht=lc&chs=600x180&chxr=0,0.0,5.0"
- metric_history = DateMetricResultFixtures.score_history
-
- assert_equal chart, @helper.generate_chart(metric_history)
- end
-
- should 'format time to show a sentence' do
- assert_equal 'less than 5 seconds', @helper.format_time(0)
- assert_equal 'less than 5 seconds', @helper.format_time(4999)
- assert_equal 'less than 10 seconds', @helper.format_time(5000)
- assert_equal '1 minute', @helper.format_time(70000)
- assert_equal 'about 2 hours', @helper.format_time(7000000)
- end
-
- should 'format metric name for metric configuration snapshot' do
- metric_configuration_snapshot = MetricConfigurationSnapshotFixtures.metric_configuration_snapshot
- assert_equal 'AverageMethodLOC', @helper.format_name(metric_configuration_snapshot)
- end
-
- should 'create aggregation options array' do
- assert_equal [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"],
- ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]], @helper.aggregation_options
- end
-
- should 'create scope options' do
- assert_equal [["Software", "SOFTWARE"], ["Package", "PACKAGE"], ["Class", "CLASS"], ["Method", "METHOD"]], @helper.scope_options
- end
-
-end
diff --git a/plugins/mezuro/test/unit/mezuro_plugin/helpers/module_result_helper_test.rb b/plugins/mezuro/test/unit/mezuro_plugin/helpers/module_result_helper_test.rb
deleted file mode 100644
index 63d84ec..0000000
--- a/plugins/mezuro/test/unit/mezuro_plugin/helpers/module_result_helper_test.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require "test_helper"
-
-class ModuleResultHelperTest < ActiveSupport::TestCase
-
- should 'return last module name when receive a string' do
- name = 'Class'
- assert_equal name, MezuroPlugin::Helpers::ModuleResultHelper.module_name(name)
- end
-
- should 'return last module name when receive an array of strings' do
- name = ['Class', 'Module']
- assert_equal name.last, MezuroPlugin::Helpers::ModuleResultHelper.module_name(name)
- end
-
-end
diff --git a/plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb b/plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb
deleted file mode 100644
index 515bf53..0000000
--- a/plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require "test_helper"
-
-require "#{Rails.root}/plugins/mezuro/test/fixtures/project_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/project_content_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/processing_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/module_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/module_result_fixtures"
-require "#{Rails.root}/plugins/mezuro/test/fixtures/date_metric_result_fixtures"
-
-class ProjectContentTest < ActiveSupport::TestCase
-
- def setup
- @project_content = ProjectContentFixtures.project_content
- @project = ProjectFixtures.project
- @repository = RepositoryFixtures.repository
- @processing = ProcessingFixtures.processing
- @date = @processing.date
- @module = ModuleFixtures.module
- @module_result = ModuleResultFixtures.module_result
- @date_metric_result = DateMetricResultFixtures.date_metric_result
- end
-
- should 'provide proper short description' do
- assert_equal 'Mezuro project', MezuroPlugin::ProjectContent.short_description
- end
-
- should 'provide proper description' do
- assert_equal 'Software project tracked by Kalibro', MezuroPlugin::ProjectContent.description
- end
-
- should 'have an html view' do
- assert_not_nil @project_content.to_html
- end
-
- should 'get project from service' do
- Kalibro::Project.expects(:find).with(@project.id).returns(@project)
- assert_equal @project, @project_content.project
- end
-
- should 'add error to base when the project does not exist' do
- Kalibro::Project.expects(:find).with(@project.id).raises(Kalibro::Errors::RecordNotFound)
- assert_nil @project_content.errors[:base]
- @project_content.project
- assert_not_nil @project_content.errors[:base]
- end
-
- should 'get repositories of the project from service' do
- Kalibro::Repository.expects(:repositories_of).with(@project.id).returns([@repository])
- assert_equal [@repository], @project_content.repositories
- end
-
- should 'add error to base when getting the repositories of a project that does not exist' do
- Kalibro::Repository.expects(:repositories_of).with(@project.id).raises(Kalibro::Errors::RecordNotFound)
- assert_nil @project_content.errors[:base]
- @project_content.repositories
- assert_not_nil @project_content.errors[:base]
- end
-
-end
diff --git a/plugins/mezuro/test/unit/mezuro_plugin/reading_group_content_test.rb b/plugins/mezuro/test/unit/mezuro_plugin/reading_group_content_test.rb
deleted file mode 100644
index 8305807..0000000
--- a/plugins/mezuro/test/unit/mezuro_plugin/reading_group_content_test.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require "test_helper"
-
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_group_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_fixtures"
-require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/reading_group_content_fixtures"
-
-class ReadingGroupContentTest < ActiveSupport::TestCase
-
- def setup
- @reading_group_content = ReadingGroupContentFixtures.reading_group_content
- @reading_group = ReadingGroupFixtures.reading_group
- @reading = ReadingFixtures.reading
- end
-
- should 'provide proper short description' do
- assert_equal 'Mezuro reading group', MezuroPlugin::ReadingGroupContent.short_description
- end
-
- should 'provide proper description' do
- assert_equal 'Set of thresholds to interpret metric results', MezuroPlugin::ReadingGroupContent.description
- end
-
- should 'have an html view' do
- assert_not_nil @reading_group_content.to_html
- end
-
- should 'get reading_group from service' do
- Kalibro::ReadingGroup.expects(:find).with(@reading_group.id).returns(@reading_group)
- assert_equal @reading_group, @reading_group_content.reading_group
- end
-
- should 'add error to base when the reading_group does not exist' do
- Kalibro::ReadingGroup.expects(:find).with(@reading_group.id).raises(Kalibro::Errors::RecordNotFound)
- assert_nil @reading_group_content.errors[:base]
- @reading_group_content.reading_group
- assert_not_nil @reading_group_content.errors[:base]
- end
-
- should 'get readings of the reading_group from service' do
- Kalibro::Reading.expects(:readings_of).with(@reading_group.id).returns([@reading])
- assert_equal [@reading], @reading_group_content.readings
- end
-
- should 'add error to base when getting the readings of a reading_group that does not exist' do
- Kalibro::Reading.expects(:readings_of).with(@reading_group.id).raises(Kalibro::Errors::RecordNotFound)
- assert_nil @reading_group_content.errors[:base]
- @reading_group_content.readings
- assert_not_nil @reading_group_content.errors[:base]
- end
-
-end
diff --git a/plugins/mezuro/test/unit/mezuro_plugin_test.rb b/plugins/mezuro/test/unit/mezuro_plugin_test.rb
deleted file mode 100644
index f8b3a8c..0000000
--- a/plugins/mezuro/test/unit/mezuro_plugin_test.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require "test_helper"
-
-class MezuroPluginTest < ActiveSupport::TestCase
-
- def setup
- @plugin = MezuroPlugin.new
- end
-
- should 'be a noosfero plugin' do
- assert_kind_of Noosfero::Plugin, @plugin
- end
-
- should 'have name' do
- assert_equal 'Mezuro', MezuroPlugin.plugin_name
- end
-
- should 'have description' do
- assert_equal _('A metric analizer plugin.'), MezuroPlugin.plugin_description
- end
-
- should 'have stylesheet' do
- assert @plugin.stylesheet?
- end
-
-end
diff --git a/plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb b/plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb
deleted file mode 100644
index 4f5e3d8..0000000
--- a/plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-
<%= _(MezuroPlugin::ConfigurationContent.short_description) %>
-
-<%
- kalibro_configuration = @article.title.nil? ? nil : @article.kalibro_configuration
- configuration_names_and_ids = @article.configuration_names_and_ids
-%>
-
-<%= error_messages_for 'kalibro_configuration' %>
-
-
-<%= hidden_field_tag 'configuration_content[profile_id]', profile.id %>
-<%= hidden_field_tag 'configuration_id', @article.configuration_id %>
-<%= render :partial => "cms/mezuro_plugin/mezuro_content_form", :locals => {:f => f} %>
-
-
-<%= if kalibro_configuration.nil?
- required labelled_form_field _('Clone Configuration'),
- f.select(:configuration_to_clone_id, configuration_names_and_ids)
-end %>
diff --git a/plugins/mezuro/views/cms/mezuro_plugin/_mezuro_content_form.html.erb b/plugins/mezuro/views/cms/mezuro_plugin/_mezuro_content_form.html.erb
deleted file mode 100644
index 149de85..0000000
--- a/plugins/mezuro/views/cms/mezuro_plugin/_mezuro_content_form.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<%= hidden_field_tag 'id', @article.id %>
-<%= required_fields_message %>
-<%= required f.text_field(:name) %>
-<%= f.text_field :description %>
diff --git a/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb b/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb
deleted file mode 100644
index acce453..0000000
--- a/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
- <%= _(MezuroPlugin::ProjectContent.short_description) %>
-
-<%
- @project = @article.title.nil? ? nil : @article.project
-%>
-
-<%= error_messages_for 'project_content' %>
-
-<%= hidden_field_tag 'project_content[profile_id]', profile.id %>
-<%= hidden_field_tag 'project_id', @article.project_id %>
-<%= render :partial => "cms/mezuro_plugin/mezuro_content_form", :locals => {:f => f} %>
diff --git a/plugins/mezuro/views/cms/mezuro_plugin/_reading_group_content.html.erb b/plugins/mezuro/views/cms/mezuro_plugin/_reading_group_content.html.erb
deleted file mode 100644
index 61fc7e8..0000000
--- a/plugins/mezuro/views/cms/mezuro_plugin/_reading_group_content.html.erb
+++ /dev/null
@@ -1,11 +0,0 @@
- <%= _(MezuroPlugin::ReadingGroupContent.short_description) %>
-
-<%
- reading_group = @article.title.nil? ? nil : @article.reading_group
-%>
-
-<%= error_messages_for 'reading_group_content' %>
-
-<%= hidden_field_tag 'reading_group_content[profile_id]', profile.id %>
-<%= hidden_field_tag 'reading_group_id', (reading_group.id unless reading_group.nil?) %>
-<%= render :partial => "cms/mezuro_plugin/mezuro_content_form", :locals => {:f => f} %>
diff --git a/plugins/mezuro/views/content_viewer/show_configuration.rhtml b/plugins/mezuro/views/content_viewer/show_configuration.rhtml
deleted file mode 100644
index ee63d9e..0000000
--- a/plugins/mezuro/views/content_viewer/show_configuration.rhtml
+++ /dev/null
@@ -1,77 +0,0 @@
-<% @configuration_content = @page
-@kalibro_configuration = @page.kalibro_configuration %>
-
-<% owner = (not user.nil?) && user.id == @profile.id %>
-<% unless @page.errors[:base].nil? %>
- <% if @page.errors[:base] =~ /Kalibro::Errors::RecordNotFound/ %>
- Warning:
-
-
-
-
-
- <%= _('Name') %>
- <%= @kalibro_configuration.name %>
-
-
- <%= _('Description') %>
- <%= @kalibro_configuration.description %>
-
-
- <% if owner %>
- <%= link_to "#{image_tag('/plugins/mezuro/images/plus.png')}Add Metric", :controller => "mezuro_plugin_metric_configuration",
- :profile => @page.profile.identifier,
- :action => "choose_metric",
- :id => @configuration_content.id %>
- <% end %>
-
-
-
-<% end %>
diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml
deleted file mode 100644
index 89824a9..0000000
--- a/plugins/mezuro/views/content_viewer/show_project.rhtml
+++ /dev/null
@@ -1,52 +0,0 @@
-<% @project = @page.project %>
-<% unless @page.errors[:base].nil? %>
-
- <% if @page.errors[:base] == "Kalibro::Errors::RecordNotFound" %>
-
-
- <% @configuration_content.metric_configurations.each do |metric_configuration| %>
-
- Metric Name
- Collector Name
- Metric Code
- Weight
- Aggregation Form
-
- <% if metric_configuration.metric.compound
- edit_action = "edit_compound"
- else
- edit_action = "edit_native"
- end
- %>
-
- <% end %>
- <%= link_to metric_configuration.metric.name, :controller => "mezuro_plugin_metric_configuration", :action => edit_action,
- :metric_configuration_id => metric_configuration.id, :id => @configuration_content.id,
- :profile => @page.profile.identifier %>
- <% if metric_configuration.metric.compound %>
-
- Compound Metric
-
- <% else %>
-
- <%= metric_configuration.base_tool_name %>
-
- <% end %>
- <%= metric_configuration.code %>
- <%= metric_configuration.weight %>
- <%= metric_configuration.aggregation_form %>
- <% if owner %>
- <%= link_to "Remove", :controller => "mezuro_plugin_metric_configuration", :action => "remove",
- :metric_configuration_id => metric_configuration.id, :id => @configuration_content.id,
- :profile => @page.profile.identifier %>
- <% end %>
- Warning:
-
-
-
-
- <%= _('Name') %>
- <%= @project.name %>
-
-
- <%= _('Description') %>
- <%= @project.description %>
-
- <%= _('Repositories') %>
-
- <% @page.repositories.each do |repository| %>
-
-
-
-
- <% end %>
- <%= link_to repository.name, :controller => "mezuro_plugin_repository",
- :profile => @page.profile.identifier,
- :action => "show",
- :id => @page.id,
- :repository_id => repository.id %>
- <%= link_to _('Edit'), {:controller => "mezuro_plugin_repository",
- :profile => @page.profile.identifier,
- :action => "edit",
- :id => @page.id,
- :repository_id => repository.id}, :class=>"button with-text icon-edit" %>
- <%= link_to _('Remove'), {:controller => "mezuro_plugin_repository",
- :profile => @page.profile.identifier,
- :action => "destroy",
- :id => @page.id,
- :repository_id => repository.id}, :class=>"button with-text icon-delete" %>
-
- <%= link_to "#{image_tag('/plugins/mezuro/images/plus.png')}Add Repository", :controller => "mezuro_plugin_repository",
- :profile => @page.profile.identifier,
- :action => "new",
- :id => @page.id %>
-
-<% end %>
diff --git a/plugins/mezuro/views/content_viewer/show_reading_group.rhtml b/plugins/mezuro/views/content_viewer/show_reading_group.rhtml
deleted file mode 100644
index 6743e55..0000000
--- a/plugins/mezuro/views/content_viewer/show_reading_group.rhtml
+++ /dev/null
@@ -1,49 +0,0 @@
-<% @reading_group = @page.reading_group %>
-
-<% unless @page.errors[:base].nil? %>
- <% if @page.errors[:base] == "Kalibro::Errors::RecordNotFound" %>
- Warning:
-
-
-
-
- <%= _('Name') %>
- <%= @reading_group.name %>
-
-
- <%= _('Description') %>
- <%= @reading_group.description %>
-
- <%= _('Readings') %>
-
- <% @page.readings.each do |reading| %>
-
-
-
-
- <% end %>
- <%= link_to reading.label, :controller => "mezuro_plugin_reading",
- :profile => @page.profile.identifier,
- :action => "edit",
- :id => @page.id,
- :reading_id => reading.id %>
- <%= reading.grade %>
-
- <%= link_to _('Remove'), {:controller => "mezuro_plugin_reading",
- :profile => @page.profile.identifier,
- :action => "destroy",
- :id => @page.id,
- :reading_id => reading.id}, :class=>"button with-text icon-delete" %>
-
- <%= link_to "#{image_tag('/plugins/mezuro/images/plus.png')}Add Reading", :controller => "mezuro_plugin_reading",
- :profile => @page.profile.identifier,
- :action => "new",
- :id => @page.id %>
-
-<% end %>
diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/_compound_metric_configuration_form.html.erb b/plugins/mezuro/views/mezuro_plugin_metric_configuration/_compound_metric_configuration_form.html.erb
deleted file mode 100644
index 8c184fe..0000000
--- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/_compound_metric_configuration_form.html.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-<%= hidden_field_tag :id, @configuration_content.id %>
-<%= f.hidden_field :configuration_id, :value => @configuration_content.configuration_id %>
-
-<% f.fields_for :metric do |m| %>
- <%= m.hidden_field :compound, :value => "true" %>
- <%= required labelled_form_field _('Metric Name:'), m.text_field(:name, :value => @metric_configuration.metric.name) %>
- <%= labelled_form_field _('Description:'), m.text_field(:description, :value => @metric_configuration.metric.description) %>
- <%= required labelled_form_field _('Script:'), m.text_area(:script, :rows => 5, :value => @metric_configuration.metric.script) %>
- <%= required labelled_form_field _('Scope:'),
- m.select(:scope, MezuroPlugin::Helpers::ContentViewerHelper.scope_options, :selected => @metric_configuration.metric.scope) %>
-<% end %>
-
-<%= required labelled_form_field _('Code:'), f.text_field(:code) %>
-<%= required labelled_form_field _('Aggregation Form:'),
- f.select(:aggregation_form, MezuroPlugin::Helpers::ContentViewerHelper.aggregation_options) %>
-<%= required labelled_form_field _('Weight:'), f.text_field(:weight) %>
-<%= required labelled_form_field _('Reading Group:'), f.select(:reading_group_id, @reading_group_names_and_ids) %>
-
- An error occured:
-<%= @message %>
diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/_metric_codes.html.erb b/plugins/mezuro/views/mezuro_plugin_metric_configuration/_metric_codes.html.erb
deleted file mode 100644
index 630b914..0000000
--- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/_metric_codes.html.erb
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/_native_metric_configuration_form.rhtml b/plugins/mezuro/views/mezuro_plugin_metric_configuration/_native_metric_configuration_form.rhtml
deleted file mode 100644
index b54bd42..0000000
--- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/_native_metric_configuration_form.rhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<%= hidden_field_tag :id, @configuration_content.id %>
-<%= f.hidden_field :configuration_id, :value => @configuration_content.configuration_id %>
-
-<%= labelled_form_field _('Collector Name:'), f.text_field(:base_tool_name, :readonly => true) %>
-
-<% f.fields_for :metric do |m| %>
- <%= m.hidden_field :compound, :value => "false" %>
- <% @metric_configuration.metric.language.each do |language| %>
- <%= m.hidden_field :language, :multiple => true, :value => language %>
- <% end %>
- <%= m.hidden_field "scope", :value => @metric.scope %>
- <%= required labelled_form_field _('Metric Name:'), m.text_field(:name, :readonly => true, :value => @metric.name) %>
- <%= labelled_form_field _('Description:'), m.text_field(:description, :readonly => true, :value => @metric.description) %>
-<% end %>
-
-<%= required labelled_form_field _('Code:'), f.text_field(:code) %>
-
-<%= required labelled_form_field _('Aggregation Form:'),
-f.select(:aggregation_form, MezuroPlugin::Helpers::ContentViewerHelper.aggregation_options) %>
-
-<%= required labelled_form_field _('Weight:'), f.text_field(:weight) %>
-
-<%= required labelled_form_field _('Reading Group:'),
-f.select(:reading_group_id, @reading_group_names_and_ids) %>
-
-
-
- <% metric_configurations.each do |metric_configuration| %>
-
- Metric Name
- Metric Code
-
- <% end %>
-<%= metric_configuration.metric.name %>
- <%= metric_configuration.code %>
- <%= link_to("#{@configuration_content.name} Configuration", @configuration_content.view_url) %>
-
-<%= link_to "New Compound Metric", :controller => "mezuro_plugin_metric_configuration", :action => "new_compound",
- :id => @configuration_content.id %>
-
-Base Tools:
-<% @base_tools.each do |base_tool| %>
- <%= link_to base_tool.name, "#", :onclick => "jQuery(\"\##{base_tool.name}\").toggle();"%>
-
-
-
-<% end %>
diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/edit_compound.html.erb b/plugins/mezuro/views/mezuro_plugin_metric_configuration/edit_compound.html.erb
deleted file mode 100644
index 0e1589d..0000000
--- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/edit_compound.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-<%= link_to("#{@configuration_content.name} Configuration", @configuration_content.view_url) %>
-
-<% owner = (not user.nil?) && user.id == @profile.id %>
-
-<% form_for :metric_configuration, :url => {:action =>"update", :controller => "mezuro_plugin_metric_configuration"}, :method => :get do |f| %>
- <%= f.hidden_field :id %>
- <%= render :partial => "compound_metric_configuration_form", :locals => {:f => f} %>
-<% end %>
-
-<%= render :partial => "mezuro_plugin_range/ranges", :locals => {:owner => owner} %>
-
-<%= render :partial => "metric_codes", :locals => {:metric_configurations => @metric_configurations} %>
diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/edit_native.html.erb b/plugins/mezuro/views/mezuro_plugin_metric_configuration/edit_native.html.erb
deleted file mode 100644
index 0f5e39b..0000000
--- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/edit_native.html.erb
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-<%= link_to("#{@configuration_content.name} Configuration", @configuration_content.view_url) %>
-
-<% owner = (not user.nil?) && user.id == @profile.id %>
-
-<% if owner %>
- <% form_for :metric_configuration, :url => {:action =>"update", :controller => "mezuro_plugin_metric_configuration"}, :method => :get do |f| %>
- <%= f.hidden_field :id %>
- <%= render :partial => "native_metric_configuration_form", :locals => {:f => f} %>
- <% end %>
-<% else %>
- <%= render :partial => "native_metric_configuration_view" %>
-<% end %>
-
-<%= render :partial => "mezuro_plugin_range/ranges", :locals => {:owner => owner} %>
diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/new_compound.html.erb b/plugins/mezuro/views/mezuro_plugin_metric_configuration/new_compound.html.erb
deleted file mode 100644
index 5a749a3..0000000
--- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/new_compound.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<%= link_to("#{@configuration_content.name} Configuration", @configuration_content.view_url) %>
-
-<% form_for :metric_configuration, :url => {:action =>"create", :controller => "mezuro_plugin_metric_configuration"}, :method => :get do |f| %>
- <%= render :partial => "compound_metric_configuration_form", :locals => {:f => f} %>
-<% end %>
-
-<%= render :partial => "metric_codes", :locals => {:metric_configurations => @metric_configurations} %>
diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/new_native.html.erb b/plugins/mezuro/views/mezuro_plugin_metric_configuration/new_native.html.erb
deleted file mode 100644
index 8b74013..0000000
--- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/new_native.html.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-<%= link_to("#{@configuration_content.name} Configuration", @configuration_content.view_url) %>
-
-<% form_for :metric_configuration, :url => {:action =>"create", :controller => "mezuro_plugin_metric_configuration"}, :method => :get do |f| %>
- <%= render :partial => "native_metric_configuration_form", :locals => {:f => f} %>
-<% end %>
diff --git a/plugins/mezuro/views/mezuro_plugin_module_result/_error_page.html.erb b/plugins/mezuro/views/mezuro_plugin_module_result/_error_page.html.erb
deleted file mode 100644
index 089af13..0000000
--- a/plugins/mezuro/views/mezuro_plugin_module_result/_error_page.html.erb
+++ /dev/null
@@ -1,2 +0,0 @@
- An error occured:
-<%= @message %>
diff --git a/plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml b/plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml
deleted file mode 100644
index 603769c..0000000
--- a/plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
- <% @metric_results.each do |metric_result| %>
- <% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%>
- <% range_snapshots = metric_configuration_snapshot.range_snapshot %>
- <% metric_name = metric_configuration_snapshot.metric.name %>
- <% formatted_name = metric_name.delete("() ") %>
- <% if !range_snapshots.nil? %>
- Metric
- Value
- Weight
- Threshold
-
-
-
- <% end %>
- <% end %>
- <% end %>
- <% end %>
-
diff --git a/plugins/mezuro/views/mezuro_plugin_module_result/_module_result.rhtml b/plugins/mezuro/views/mezuro_plugin_module_result/_module_result.rhtml
deleted file mode 100644
index f0bf1ce..0000000
--- a/plugins/mezuro/views/mezuro_plugin_module_result/_module_result.rhtml
+++ /dev/null
@@ -1,24 +0,0 @@
-<%= render :partial => "source_tree", :locals => {:module_result => @module_result} %>
-<%= metric_name %>
- <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %>
- <%= metric_configuration_snapshot.weight %>
- <% range_snapshots.each do |range_snapshot| %>
- <% if range_snapshot.beginning <= metric_result.value and range_snapshot.end > metric_result.value %>
-
-
- <%= range_snapshot.label %>
-
-
- <%= _"Metric results for: #{MezuroPlugin::Helpers::ModuleResultHelper.module_name(@module_result.module.name)} (#{@module_result.module.granularity})" %>
-
-
-
- <%= render :partial => "metric_results", :locals => {:metric_results => @metric_results, :module_result_id => @module_result.id} %>
-
-
-
-
-
-
-
-
-
-
-
- <%= _('Grade:') %>
- <%= "%.02f" % @module_result.grade %>
-
-
-
- <%= _('Source tree') %>
-<% helper = MezuroPlugin::Helpers::ModuleResultHelper %>
-<% module_name = helper.module_name(module_result.module.name) %>
-<% module_label = "#{module_name} (#{module_result.module.granularity})" %>
-
-
- <% module_result.parents.each do |parent| %>
- /
- <%= helper.module_name parent.module.name %>
-
- <% end %>/ <%= helper.module_name module_name %>
-
-
<%= image_tag('/plugins/mezuro/images/folder.png')%> | -<%= helper.module_name child.module.name %> | -
<%= image_tag('/plugins/mezuro/images/file.png') %> | -- - <%= helper.module_name child.module.name %> - - | -
- <%= "Metric Name:" + @metric.name %> -
- <% f.fields_for :metric do |m| %> - <%= m.hidden_field :name, :value => @metric.name %> -- <%= m.label :description, "Description:" %> - <%= m.text_field "description", :value => @metric.description %> -
-- <%= m.label :scope, "Scope:" %> - <%= m.select :scope, [["Class", "CLASS"]], :selected => @metric.scope %> -
-- <%= m.label :script, "Script:" %> - <%= m.text_area "script", :value => @metric.script %> -
- <% end %> -- <%= f.label :code, "Code:" %> - <%= f.text_field "code" %> -
-- <%= f.label :aggregation_form, "Aggregation Form:" %> - <%= f.select :aggregation_form, [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"], - ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]] %> -
-- <%= f.label :weight, "Weight:" %> - <%= f.text_field :weight %> -
-- <%= f.submit "Save" %> -
-<% end %> - - -- Label - | -- Beginning - | -- End - | -- Grade - | -- Color - | -
- <%= m.label :origin, "Collector Name:" %> - <%= @metric.origin %> - <%= m.hidden_field "origin", :value => @metric.origin %> -
-- <%= m.label :metric_name, "Metric Name:" %> - <%= @metric.name %> - <%= m.hidden_field "name", :value => @metric.name %> -
- - <% m.label :description, "Description:" %> - <% @metric.description %> - <% m.hidden_field "description", :value => @metric.description %> - - <% end %> -- <%= f.label :code, "Code:" %> - <%= @metric_configuration.code %> - <%= f.hidden_field "code", :value => @metric_configuration.code %> -
-- <%= f.label :aggregation_form, "Aggregation Form:" %> - <%= f.select :aggregation_form, [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"], - ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]] %> -
-- <%= f.label :weight, "Weight:" %> - <%= f.text_field "weight", :value => @metric_configuration.weight %> -
- -- <%= f.submit "Save" %> -
-<% end %> - - -- Label - | -- Beginning - | -- End - | -- Grade - | -- Color - | -- | - |
- <%= m.label :name, "Name:" %> - <%= m.text_field "name" %> -
-- <%= m.label :description, "Description:" %> - <%= m.text_field "description" %> -
-- <%= m.label :scope, "Scope:" %> - <%= m.select :scope, [["Class", "CLASS"]] %> -
-- <%= m.label :script, "Script:" %> - <%= m.text_area "script" %> -
- <% end %> -- <%= f.label :code, "Code:" %> - <%= f.text_field "code" %> -
-- <%= f.label :aggregation_form, "Aggregation Form:" %> - <%= f.select :aggregation_form, [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"], - ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]] %> -
-- <%= f.label :weight, "Weight:" %> - <%= f.text_field :weight %> -
-- <%= f.submit "Add" %> -
-<% end %> - -<%= render :partial => "metric_codes", :locals => {:metric_configurations => @metric_configurations} %> diff --git a/plugins/mezuro/views/mezuro_plugin_myprofile/new_metric_configuration.html.erb b/plugins/mezuro/views/mezuro_plugin_myprofile/new_metric_configuration.html.erb deleted file mode 100644 index eb640c7..0000000 --- a/plugins/mezuro/views/mezuro_plugin_myprofile/new_metric_configuration.html.erb +++ /dev/null @@ -1,51 +0,0 @@ - - -- <%= m.label :origin, "Collector Name:" %> - <%= @metric.origin %> - <%= m.hidden_field "origin", :value => @metric.origin %> -
-- <%= m.label :name, "Metric Name:" %> - <%= @metric.name %> - <%= m.hidden_field "name", :value => @metric.name %> -
- - <% m.label :description, "Description:" %> - <% @metric.description %> - <% m.hidden_field "description", :value => @metric.description %> - - <% end %> -- <%= f.label :code, "Code:" %> - <%= f.text_field :code %> -
-- <%= f.label :aggregation_form, "Aggregation Form:" %> - <%= f.select :aggregation_form, [["Average","AVERAGE"], ["Median", "MEDIAN"], ["Maximum", "MAXIMUM"], ["Minimum", "MINIMUM"], - ["Count", "COUNT"], ["Standard Deviation", "STANDARD_DEVIATION"]] %> -
-- <%= f.label :weight, "Weight:" %> - <%= f.text_field :weight %> -
- -- <%= f.submit "Add" %> -
- -<% end %> - diff --git a/plugins/mezuro/views/mezuro_plugin_processing/_error_page.html.erb b/plugins/mezuro/views/mezuro_plugin_processing/_error_page.html.erb deleted file mode 100644 index 55bdf75..0000000 --- a/plugins/mezuro/views/mezuro_plugin_processing/_error_page.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= _('Date') %> | -<%= @processing.date.inspect %> | -
<%= _(process_time.state + ' time') %> | -<%= MezuroPlugin::Helpers::ContentViewerHelper.format_time(process_time.time) %> | -
Click to choose specific date: | -<%= link_to(image_tag('/images/calendar_date_select/calendar.png', :width => 20, :height => 20, :onClick => "$( 'datepicker' ).toggle();"), "javascript:void(0)") %> | -
- <%= "State when error ocurred: #{@processing.state}" %>
-
- <% error = @processing.error %>
- <%= error.message %>
-
- <%= f.label :beginning, "(*) Beginning:" %> - | -- <%= required f.text_field :beginning, :id => "range_beginning" %> <%= link_to('-∞', 'javascript:void(0)', :onClick => "jQuery( '#range_beginning' ).val('-INF');") %> - | -
- <%= f.label :end, "(*) End:" %> - | -- <%= required f.text_field(:end, :id => "range_end") %> <%= link_to('+∞', 'javascript:void(0)', :onClick => "jQuery( '#range_end' ).val('+INF');") %> - | -
- <%= f.label :comments, "(*) Comments:" %> - | -- <%= required f.text_area :comments, :rows => 3 %> - | -
- Label - | -- Beginning - | -- End - | -- Grade - | -- Color - | -
<%= f.submit "Save" %>
diff --git a/plugins/mezuro/views/mezuro_plugin_reading/edit.html.erb b/plugins/mezuro/views/mezuro_plugin_reading/edit.html.erb deleted file mode 100644 index 233dc80..0000000 --- a/plugins/mezuro/views/mezuro_plugin_reading/edit.html.erb +++ /dev/null @@ -1,10 +0,0 @@ - - - - -<%= f.submit "Add" %>
diff --git a/plugins/mezuro/views/mezuro_plugin_repository/edit.html.erb b/plugins/mezuro/views/mezuro_plugin_repository/edit.html.erb deleted file mode 100644 index 0b483e6..0000000 --- a/plugins/mezuro/views/mezuro_plugin_repository/edit.html.erb +++ /dev/null @@ -1,7 +0,0 @@ - - -<%= _('Name') %> | -<%= @repository.name %> | -
<%= _('Description') %> | -<%= @repository.description %> | -
<%= _('License') %> | -<%= @repository.license %> | -
<%= _('Process Period') %> | -<%= MezuroPlugin::Helpers::ContentViewerHelper.periodicity_option(@repository.process_period.to_i) %> | -
<%= _('Type') %> | -<%= @repository.type %> | -
<%= _('Address') %> | -<%= @repository.address %> | -
<%= _('Configuration') %> | -<%= @configuration_name %> | -
<%= _('Status')%> | -
- Retrieving
-
- |
-