aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/test/json
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-07-08 13:38:29 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-07-08 14:08:00 +0200
commitbfef505c8a0de560805234643f6ee8b58d37d04a (patch)
tree9ccf94044ea5e802946d6309589d440cf9afd2d0 /server/sonar-web/src/test/json
parent7a4939f74f1bc53203eb99945182adeb7ab750da (diff)
downloadsonarqube-bfef505c8a0de560805234643f6ee8b58d37d04a.tar.gz
sonarqube-bfef505c8a0de560805234643f6ee8b58d37d04a.zip
SONAR-6697 add tests
Diffstat (limited to 'server/sonar-web/src/test/json')
-rw-r--r--server/sonar-web/src/test/json/custom-measures-spec/metrics.json64
-rw-r--r--server/sonar-web/src/test/json/custom-measures-spec/search-big-1.json53
-rw-r--r--server/sonar-web/src/test/json/custom-measures-spec/search-big-2.json53
-rw-r--r--server/sonar-web/src/test/json/custom-measures-spec/search-created.json122
-rw-r--r--server/sonar-web/src/test/json/custom-measures-spec/search-deleted.json76
-rw-r--r--server/sonar-web/src/test/json/custom-measures-spec/search-updated.json99
-rw-r--r--server/sonar-web/src/test/json/custom-measures-spec/search.json99
7 files changed, 566 insertions, 0 deletions
diff --git a/server/sonar-web/src/test/json/custom-measures-spec/metrics.json b/server/sonar-web/src/test/json/custom-measures-spec/metrics.json
new file mode 100644
index 00000000000..fe8cee9801c
--- /dev/null
+++ b/server/sonar-web/src/test/json/custom-measures-spec/metrics.json
@@ -0,0 +1,64 @@
+{
+ "metrics": [
+ {
+ "id": "155",
+ "key": "burned_budget",
+ "type": "FLOAT",
+ "name": "Burned budget",
+ "domain": "Management",
+ "direction": 0,
+ "qualitative": false,
+ "hidden": false,
+ "custom": true
+ },
+ {
+ "id": "156",
+ "key": "business_value",
+ "type": "FLOAT",
+ "name": "Business value",
+ "domain": "Management",
+ "direction": 1,
+ "qualitative": true,
+ "hidden": false,
+ "custom": true
+ },
+ {
+ "id": "159",
+ "key": "dist",
+ "type": "DISTRIB",
+ "name": "Distribution",
+ "description": "",
+ "domain": "",
+ "direction": 0,
+ "qualitative": false,
+ "hidden": false,
+ "custom": true
+ },
+ {
+ "id": "160",
+ "key": "rating",
+ "type": "RATING",
+ "name": "Rating",
+ "description": "",
+ "domain": "",
+ "direction": 0,
+ "qualitative": false,
+ "hidden": false,
+ "custom": true
+ },
+ {
+ "id": "157",
+ "key": "team_size",
+ "type": "INT",
+ "name": "Team size",
+ "domain": "Management",
+ "direction": 0,
+ "qualitative": false,
+ "hidden": false,
+ "custom": true
+ }
+ ],
+ "total": 5,
+ "p": 1,
+ "ps": 100
+}
diff --git a/server/sonar-web/src/test/json/custom-measures-spec/search-big-1.json b/server/sonar-web/src/test/json/custom-measures-spec/search-big-1.json
new file mode 100644
index 00000000000..831b4835987
--- /dev/null
+++ b/server/sonar-web/src/test/json/custom-measures-spec/search-big-1.json
@@ -0,0 +1,53 @@
+{
+ "customMeasures": [
+ {
+ "id": "5",
+ "value": "1.0",
+ "description": "",
+ "metric": {
+ "id": "160",
+ "key": "rating",
+ "type": "RATING",
+ "name": "Rating",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:41+0200",
+ "updatedAt": "2015-07-08T12:27:41+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "4",
+ "value": "1",
+ "description": "",
+ "metric": {
+ "id": "159",
+ "key": "dist",
+ "type": "DISTRIB",
+ "name": "Distribution",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:22+0200",
+ "updatedAt": "2015-07-08T12:26:22+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ }
+ ],
+ "total": 4,
+ "p": 1,
+ "ps": 2
+}
diff --git a/server/sonar-web/src/test/json/custom-measures-spec/search-big-2.json b/server/sonar-web/src/test/json/custom-measures-spec/search-big-2.json
new file mode 100644
index 00000000000..53f42bd1b01
--- /dev/null
+++ b/server/sonar-web/src/test/json/custom-measures-spec/search-big-2.json
@@ -0,0 +1,53 @@
+{
+ "customMeasures": [
+ {
+ "id": "3",
+ "value": "35",
+ "description": "",
+ "metric": {
+ "id": "157",
+ "key": "team_size",
+ "type": "INT",
+ "name": "Team size",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:13:15+0200",
+ "updatedAt": "2015-07-08T12:13:15+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "1",
+ "value": "3.2000123E7",
+ "description": "Description...",
+ "metric": {
+ "id": "155",
+ "key": "burned_budget",
+ "type": "FLOAT",
+ "name": "Burned budget",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T09:21:50+0200",
+ "updatedAt": "2015-07-08T12:25:37+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ }
+ ],
+ "total": 4,
+ "p": 2,
+ "ps": 2
+}
diff --git a/server/sonar-web/src/test/json/custom-measures-spec/search-created.json b/server/sonar-web/src/test/json/custom-measures-spec/search-created.json
new file mode 100644
index 00000000000..b118b9be11b
--- /dev/null
+++ b/server/sonar-web/src/test/json/custom-measures-spec/search-created.json
@@ -0,0 +1,122 @@
+{
+ "customMeasures": [
+ {
+ "id": "6",
+ "value": "17.0",
+ "description": "example",
+ "metric": {
+ "id": "156",
+ "key": "business_value",
+ "type": "FLOAT",
+ "name": "Business value",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T13:21:51+0200",
+ "updatedAt": "2015-07-08T13:21:51+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "5",
+ "value": "1.0",
+ "description": "",
+ "metric": {
+ "id": "160",
+ "key": "rating",
+ "type": "RATING",
+ "name": "Rating",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:41+0200",
+ "updatedAt": "2015-07-08T12:27:41+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "4",
+ "value": "1",
+ "description": "",
+ "metric": {
+ "id": "159",
+ "key": "dist",
+ "type": "DISTRIB",
+ "name": "Distribution",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:22+0200",
+ "updatedAt": "2015-07-08T12:26:22+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "3",
+ "value": "35",
+ "description": "",
+ "metric": {
+ "id": "157",
+ "key": "team_size",
+ "type": "INT",
+ "name": "Team size",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:13:15+0200",
+ "updatedAt": "2015-07-08T12:13:15+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "1",
+ "value": "3.2000123E7",
+ "description": "Description...",
+ "metric": {
+ "id": "155",
+ "key": "burned_budget",
+ "type": "FLOAT",
+ "name": "Burned budget",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T09:21:50+0200",
+ "updatedAt": "2015-07-08T12:25:37+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ }
+ ],
+ "total": 5,
+ "p": 1,
+ "ps": 100
+}
diff --git a/server/sonar-web/src/test/json/custom-measures-spec/search-deleted.json b/server/sonar-web/src/test/json/custom-measures-spec/search-deleted.json
new file mode 100644
index 00000000000..e2a82e74804
--- /dev/null
+++ b/server/sonar-web/src/test/json/custom-measures-spec/search-deleted.json
@@ -0,0 +1,76 @@
+{
+ "customMeasures": [
+ {
+ "id": "4",
+ "value": "1",
+ "description": "",
+ "metric": {
+ "id": "159",
+ "key": "dist",
+ "type": "DISTRIB",
+ "name": "Distribution",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:22+0200",
+ "updatedAt": "2015-07-08T12:26:22+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "3",
+ "value": "35",
+ "description": "",
+ "metric": {
+ "id": "157",
+ "key": "team_size",
+ "type": "INT",
+ "name": "Team size",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:13:15+0200",
+ "updatedAt": "2015-07-08T12:13:15+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "1",
+ "value": "3.2000123E7",
+ "description": "Description...",
+ "metric": {
+ "id": "155",
+ "key": "burned_budget",
+ "type": "FLOAT",
+ "name": "Burned budget",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T09:21:50+0200",
+ "updatedAt": "2015-07-08T12:25:37+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ }
+ ],
+ "total": 3,
+ "p": 1,
+ "ps": 100
+}
diff --git a/server/sonar-web/src/test/json/custom-measures-spec/search-updated.json b/server/sonar-web/src/test/json/custom-measures-spec/search-updated.json
new file mode 100644
index 00000000000..60c0a9fda98
--- /dev/null
+++ b/server/sonar-web/src/test/json/custom-measures-spec/search-updated.json
@@ -0,0 +1,99 @@
+{
+ "customMeasures": [
+ {
+ "id": "5",
+ "value": "2.0",
+ "description": "new!",
+ "metric": {
+ "id": "160",
+ "key": "rating",
+ "type": "RATING",
+ "name": "Rating",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:41+0200",
+ "updatedAt": "2015-07-08T13:28:04+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "4",
+ "value": "1",
+ "description": "",
+ "metric": {
+ "id": "159",
+ "key": "dist",
+ "type": "DISTRIB",
+ "name": "Distribution",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:22+0200",
+ "updatedAt": "2015-07-08T12:26:22+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "3",
+ "value": "35",
+ "description": "",
+ "metric": {
+ "id": "157",
+ "key": "team_size",
+ "type": "INT",
+ "name": "Team size",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:13:15+0200",
+ "updatedAt": "2015-07-08T12:13:15+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "1",
+ "value": "3.2000123E7",
+ "description": "Description...",
+ "metric": {
+ "id": "155",
+ "key": "burned_budget",
+ "type": "FLOAT",
+ "name": "Burned budget",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T09:21:50+0200",
+ "updatedAt": "2015-07-08T12:25:37+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ }
+ ],
+ "total": 4,
+ "p": 1,
+ "ps": 100
+}
diff --git a/server/sonar-web/src/test/json/custom-measures-spec/search.json b/server/sonar-web/src/test/json/custom-measures-spec/search.json
new file mode 100644
index 00000000000..a0739da9efa
--- /dev/null
+++ b/server/sonar-web/src/test/json/custom-measures-spec/search.json
@@ -0,0 +1,99 @@
+{
+ "customMeasures": [
+ {
+ "id": "5",
+ "value": "1.0",
+ "description": "",
+ "metric": {
+ "id": "160",
+ "key": "rating",
+ "type": "RATING",
+ "name": "Rating",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:41+0200",
+ "updatedAt": "2015-07-08T12:27:41+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "4",
+ "value": "1",
+ "description": "",
+ "metric": {
+ "id": "159",
+ "key": "dist",
+ "type": "DISTRIB",
+ "name": "Distribution",
+ "domain": ""
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:26:22+0200",
+ "updatedAt": "2015-07-08T12:26:22+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "3",
+ "value": "35",
+ "description": "",
+ "metric": {
+ "id": "157",
+ "key": "team_size",
+ "type": "INT",
+ "name": "Team size",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T12:13:15+0200",
+ "updatedAt": "2015-07-08T12:13:15+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ },
+ {
+ "id": "1",
+ "value": "3.2000123E7",
+ "description": "Description...",
+ "metric": {
+ "id": "155",
+ "key": "burned_budget",
+ "type": "FLOAT",
+ "name": "Burned budget",
+ "domain": "Management"
+ },
+ "projectId": "eb294572-a6a4-43cf-acc2-33c2fe37c02e",
+ "projectKey": "backbone",
+ "createdAt": "2015-07-08T09:21:50+0200",
+ "updatedAt": "2015-07-08T12:25:37+0200",
+ "pending": true,
+ "user": {
+ "login": "admin",
+ "name": "Administrator",
+ "email": "",
+ "active": true
+ }
+ }
+ ],
+ "total": 4,
+ "p": 1,
+ "ps": 100
+}