diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-20 00:44:14 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-20 00:45:34 +0200 |
commit | 95eabd8a0a1b89c319f3e05cc163b88cc561f00d (patch) | |
tree | d90aa6326b49206eea238f3f11a4c292d49f4ff0 /sonar-server/src/test/resources | |
parent | 2f779df51e9da5b07ad6f837fe1c98eab9fbf439 (diff) | |
download | sonarqube-95eabd8a0a1b89c319f3e05cc163b88cc561f00d.tar.gz sonarqube-95eabd8a0a1b89c319f3e05cc163b88cc561f00d.zip |
SONAR-5007 add RULES_PROFILES.CREATED_AT, UPDATED_AT and RULES_UPDATED_AT
Diffstat (limited to 'sonar-server/src/test/resources')
5 files changed, 96 insertions, 0 deletions
diff --git a/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/feed_created_at_and_updated_at.xml b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/feed_created_at_and_updated_at.xml new file mode 100644 index 00000000000..5f0a7a87f60 --- /dev/null +++ b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/feed_created_at_and_updated_at.xml @@ -0,0 +1,21 @@ +<?xml version='1.0' encoding='UTF-8'?> +<dataset> + + <rules_profiles id="10" name="Sonar Way" language="java" kee="java-sw" parent_kee="[null]" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> + + <!-- oldest to newest changes --> + <active_rule_changes id="122" profile_id="10" profile_version="2" rule_id="1" change_date="2011-12-25 20:20:05.158" + enabled="true" old_severity="[null]" new_severity="1" username="robert"/> + + <active_rule_changes id="123" profile_id="10" profile_version="2" rule_id="1" change_date="2013-05-18 10:20:05.158" + enabled="[null]" old_severity="1" new_severity="4" username="lucie"/> + + <active_rule_changes id="126" profile_id="10" profile_version="3" rule_id="1" change_date="2014-01-24 20:20:05.158" + enabled="[null]" old_severity="[null]" new_severity="[null]" username="tatiana"/> + + <!-- another profile --> + <active_rule_changes id="124" profile_id="11" profile_version="1" rule_id="2" change_date="2011-12-05 20:20:05.158" + enabled="true" old_severity="[null]" new_severity="1" username="Administrator"/> + +</dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/feed_created_at_and_updated_at_result.xml b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/feed_created_at_and_updated_at_result.xml new file mode 100644 index 00000000000..b8edf93bea9 --- /dev/null +++ b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/feed_created_at_and_updated_at_result.xml @@ -0,0 +1,21 @@ +<?xml version='1.0' encoding='UTF-8'?> +<dataset> + + <rules_profiles id="10" name="Sonar Way" language="java" kee="java-sw" parent_kee="[null]" + rules_updated_at="2014-01-24 20:20:05.158" created_at="2011-12-25 20:20:05.158" updated_at="2014-01-24 20:20:05.158"/> + + <!-- oldest to newest changes --> + <active_rule_changes id="122" profile_id="10" profile_version="2" rule_id="1" change_date="2011-12-25 20:20:05.158" + enabled="true" old_severity="[null]" new_severity="1" username="robert"/> + + <active_rule_changes id="123" profile_id="10" profile_version="2" rule_id="1" change_date="2013-05-18 10:20:05.158" + enabled="[null]" old_severity="1" new_severity="4" username="lucie"/> + + <active_rule_changes id="126" profile_id="10" profile_version="3" rule_id="1" change_date="2014-01-24 20:20:05.158" + enabled="[null]" old_severity="[null]" new_severity="[null]" username="tatiana"/> + + <!-- another profile --> + <active_rule_changes id="124" profile_id="11" profile_version="1" rule_id="2" change_date="2011-12-05 20:20:05.158" + enabled="true" old_severity="[null]" new_severity="1" username="Administrator"/> + +</dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/schema.sql b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/schema.sql new file mode 100644 index 00000000000..36fce32a692 --- /dev/null +++ b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/schema.sql @@ -0,0 +1,30 @@ +CREATE TABLE "RULES_PROFILES" ( + "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + "NAME" VARCHAR(100) NOT NULL, + "LANGUAGE" VARCHAR(20), + "KEE" VARCHAR(1000) NOT NULL, + "PARENT_KEE" VARCHAR(1000), + "RULES_UPDATED_AT" TIMESTAMP, + "CREATED_AT" TIMESTAMP, + "UPDATED_AT" TIMESTAMP +); + +CREATE TABLE "ACTIVE_RULE_CHANGES" ( + "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + "USERNAME" VARCHAR(255), + "PROFILE_ID" INTEGER NOT NULL, + "PROFILE_VERSION" INTEGER NOT NULL, + "RULE_ID" INTEGER NOT NULL, + "CHANGE_DATE" TIMESTAMP NOT NULL, + "ENABLED" BOOLEAN, + "OLD_SEVERITY" INTEGER, + "NEW_SEVERITY" INTEGER +); + +CREATE TABLE "ACTIVE_RULE_PARAM_CHANGES" ( + "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), + "ACTIVE_RULE_CHANGE_ID" INTEGER NOT NULL, + "RULES_PARAMETER_ID" INTEGER NOT NULL, + "OLD_VALUE" VARCHAR(4000), + "NEW_VALUE" VARCHAR(4000) + ); diff --git a/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/use_default_dates_when_no_changes.xml b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/use_default_dates_when_no_changes.xml new file mode 100644 index 00000000000..4c01980010c --- /dev/null +++ b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/use_default_dates_when_no_changes.xml @@ -0,0 +1,12 @@ +<?xml version='1.0' encoding='UTF-8'?> +<dataset> + + <rules_profiles id="10" name="Sonar Way" language="java" kee="java-sw" parent_kee="[null]" + rules_updated_at="[null]" created_at="[null]" updated_at="[null]"/> + + + <!-- another profile --> + <active_rule_changes id="124" profile_id="11" profile_version="1" rule_id="2" change_date="2011-12-05 20:20:05.158" + enabled="true" old_severity="[null]" new_severity="1" username="Administrator"/> + +</dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/use_default_dates_when_no_changes_result.xml b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/use_default_dates_when_no_changes_result.xml new file mode 100644 index 00000000000..e1cf4eb6efa --- /dev/null +++ b/sonar-server/src/test/resources/org/sonar/server/db/migrations/v44/FeedQProfileDatesMigrationTest/use_default_dates_when_no_changes_result.xml @@ -0,0 +1,12 @@ +<?xml version='1.0' encoding='UTF-8'?> +<dataset> + + <rules_profiles id="10" name="Sonar Way" language="java" kee="java-sw" parent_kee="[null]" + rules_updated_at="2014-07-03" created_at="2014-07-03" updated_at="2014-07-03"/> + + + <!-- another profile --> + <active_rule_changes id="124" profile_id="11" profile_version="1" rule_id="2" change_date="2011-12-05 20:20:05.158" + enabled="true" old_severity="[null]" new_severity="1" username="Administrator"/> + +</dataset> |