aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-06-19 09:57:21 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-06-19 09:57:29 +0200
commite60b394562fb7bbd95a8fa334adca7c94a97b02a (patch)
tree47c2e1bbab9e3482417813881e3901fe8f80bc60 /sonar-server
parent62c06ed061a53f4ec45a86f01075e08fff48e864 (diff)
downloadsonarqube-e60b394562fb7bbd95a8fa334adca7c94a97b02a.tar.gz
sonarqube-e60b394562fb7bbd95a8fa334adca7c94a97b02a.zip
Add project key and sub project key in /api/components/app WS
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/component/ws/ComponentAppAction.java8
-rw-r--r--sonar-server/src/main/resources/org/sonar/server/component/ws/components-example-app.json2
-rw-r--r--sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java50
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension_having_permission.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures_when_period_is_set.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_manual_rules.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures_when_period_is_set.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_periods.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules_when_period_is_set.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities_when_period_is_set.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_sub_project_equals_to_project.json1
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tabs.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tests_measure.json2
-rw-r--r--sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_without_sub_project.json1
20 files changed, 64 insertions, 28 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentAppAction.java b/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentAppAction.java
index a024c13319d..0145e00c71f 100644
--- a/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentAppAction.java
+++ b/sonar-server/src/main/java/org/sonar/server/component/ws/ComponentAppAction.java
@@ -173,10 +173,12 @@ public class ComponentAppAction implements RequestHandler {
ComponentDto subProject = (ComponentDto) nullableComponentById(component.subProjectId(), session);
ComponentDto project = (ComponentDto) componentById(component.projectId(), session);
- // Do not display sub project long name if sub project and project are the same
- boolean displaySubProjectLongName = subProject != null && !subProject.getId().equals(project.getId());
+ // Do not display sub project if sub project and project are the same
+ boolean displaySubProject = subProject != null && !subProject.getId().equals(project.getId());
- json.prop("subProjectName", displaySubProjectLongName ? subProject.longName() : null);
+ json.prop("subProject", displaySubProject ? subProject.key() : null);
+ json.prop("subProjectName", displaySubProject ? subProject.longName() : null);
+ json.prop("project", project.key());
json.prop("projectName", project.longName());
json.prop("fav", isFavourite);
diff --git a/sonar-server/src/main/resources/org/sonar/server/component/ws/components-example-app.json b/sonar-server/src/main/resources/org/sonar/server/component/ws/components-example-app.json
index 11e05d39b7a..2d7477b7b3c 100644
--- a/sonar-server/src/main/resources/org/sonar/server/component/ws/components-example-app.json
+++ b/sonar-server/src/main/resources/org/sonar/server/component/ws/components-example-app.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": true,
"canMarkAsFavourite": true,
diff --git a/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java b/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java
index 526cf38ad11..b57ad1616d5 100644
--- a/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/component/ws/ComponentAppActionTest.java
@@ -81,7 +81,7 @@ import static org.mockito.Mockito.*;
@RunWith(MockitoJUnitRunner.class)
public class ComponentAppActionTest {
- static final String PROJECT_KEY = "org.codehaus.sonar:sonar-plugin-api:api";
+ static final String SUB_PROJECT_KEY = "org.codehaus.sonar:sonar-plugin-api";
static final String COMPONENT_KEY = "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/Plugin.java";
@Mock
@@ -142,13 +142,13 @@ public class ComponentAppActionTest {
@Test
public void app() throws Exception {
- MockUserSession.set().setLogin("john").addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().setLogin("john").addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
ComponentDto file = new ComponentDto().setId(10L).setQualifier("FIL").setKey(COMPONENT_KEY).setName("Plugin.java")
.setPath("src/main/java/org/sonar/api/Plugin.java").setSubProjectId(5L).setProjectId(1L);
when(componentDao.getNullableByKey(session, COMPONENT_KEY)).thenReturn(file);
- when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API"));
- when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube"));
+ when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY));
+ when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube").setKey("org.codehaus.sonar:sonar"));
when(propertiesDao.selectByQuery(any(PropertyQuery.class), eq(session))).thenReturn(newArrayList(new PropertyDto()));
WsTester.TestRequest request = tester.newGetRequest("api/components", "app").setParam("key", COMPONENT_KEY);
@@ -162,7 +162,7 @@ public class ComponentAppActionTest {
ComponentDto file = new ComponentDto().setId(1L).setQualifier("TRK").setKey(componentKey).setName("SonarQube").setProjectId(1L);
when(componentDao.getNullableByKey(session, componentKey)).thenReturn(file);
- when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube"));
+ when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube").setKey("org.codehaus.sonar:sonar"));
when(propertiesDao.selectByQuery(any(PropertyQuery.class), eq(session))).thenReturn(newArrayList(new PropertyDto()));
WsTester.TestRequest request = tester.newGetRequest("api/components", "app").setParam("key", componentKey);
@@ -171,12 +171,12 @@ public class ComponentAppActionTest {
@Test
public void app_with_sub_project_equals_to_project() throws Exception {
- MockUserSession.set().setLogin("john").addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().setLogin("john").addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
ComponentDto file = new ComponentDto().setId(10L).setQualifier("FIL").setKey(COMPONENT_KEY).setName("Plugin.java")
.setPath("src/main/java/org/sonar/api/Plugin.java").setSubProjectId(1L).setProjectId(1L);
when(componentDao.getNullableByKey(session, COMPONENT_KEY)).thenReturn(file);
- when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube"));
+ when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube").setKey("org.codehaus.sonar:sonar"));
when(propertiesDao.selectByQuery(any(PropertyQuery.class), eq(session))).thenReturn(newArrayList(new PropertyDto()));
WsTester.TestRequest request = tester.newGetRequest("api/components", "app").setParam("key", COMPONENT_KEY);
@@ -185,7 +185,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_tabs() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
addMeasure(CoreMetrics.COVERAGE_KEY, 1.0);
@@ -198,7 +198,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_measures() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
addMeasure(CoreMetrics.NCLOC_KEY, 200);
@@ -218,7 +218,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_measures_when_period_is_set() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
addPeriod();
@@ -239,7 +239,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_issues_measures() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
Multiset<String> severities = LinkedHashMultiset.create();
@@ -267,7 +267,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_issues_measures_when_period_is_set() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
addPeriod();
@@ -298,13 +298,13 @@ public class ComponentAppActionTest {
@Test
public void app_with_tests_measure() throws Exception {
String componentKey = "org.codehaus.sonar:sonar-server:src/test/java/org/sonar/server/issue/PlanActionTest.java";
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, componentKey);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, componentKey);
ComponentDto file = new ComponentDto().setId(10L).setQualifier("UTS").setKey(componentKey).setName("PlanActionTest.java")
.setPath("src/test/java/org/sonar/server/issue/PlanActionTest.java").setSubProjectId(5L).setProjectId(1L);
when(componentDao.getNullableByKey(session, componentKey)).thenReturn(file);
- when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API"));
- when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube"));
+ when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY));
+ when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube").setKey("org.codehaus.sonar:sonar"));
addMeasure(CoreMetrics.TESTS_KEY, 10);
@@ -317,7 +317,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_periods() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
@@ -332,7 +332,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_severities() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
@@ -347,7 +347,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_severities_when_period_is_set() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
addPeriod();
@@ -362,7 +362,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_rules() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
when(issueService.findRulesByComponent(COMPONENT_KEY, null, session)).thenReturn(
@@ -375,7 +375,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_rules_when_period_is_set() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
@@ -395,7 +395,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_extension() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
when(views.getPages(anyString(), anyString(), anyString(), anyString(), any(String[].class))).thenReturn(
@@ -408,7 +408,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_extension_having_permission() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
when(views.getPages(anyString(), anyString(), anyString(), anyString(), any(String[].class))).thenReturn(
@@ -420,7 +420,7 @@ public class ComponentAppActionTest {
@Test
public void app_with_manual_rules() throws Exception {
- MockUserSession.set().addComponentPermission(UserRole.USER, PROJECT_KEY, COMPONENT_KEY);
+ MockUserSession.set().addComponentPermission(UserRole.USER, SUB_PROJECT_KEY, COMPONENT_KEY);
addComponent();
Result<Rule> result = mock(Result.class);
@@ -438,8 +438,8 @@ public class ComponentAppActionTest {
ComponentDto file = new ComponentDto().setId(10L).setQualifier("FIL").setKey(COMPONENT_KEY).setName("Plugin.java")
.setPath("src/main/java/org/sonar/api/Plugin.java").setSubProjectId(5L).setProjectId(1L);
when(componentDao.getNullableByKey(session, COMPONENT_KEY)).thenReturn(file);
- when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API"));
- when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube"));
+ when(componentDao.getById(5L, session)).thenReturn(new ComponentDto().setId(5L).setLongName("SonarQube :: Plugin API").setKey(SUB_PROJECT_KEY));
+ when(componentDao.getById(1L, session)).thenReturn(new ComponentDto().setId(1L).setLongName("SonarQube").setKey("org.codehaus.sonar:sonar"));
}
private void addPeriod(){
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app.json
index 30715cd97d2..0bc7b8dda36 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": true,
"canMarkAsFavourite": true,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension.json
index 015c2e99a4b..e91a1bb424c 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension_having_permission.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension_having_permission.json
index e74c50f7e01..c2ea499f586 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension_having_permission.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_extension_having_permission.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures.json
index 5d645e3c4c6..cbc1c3f8fe9 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures_when_period_is_set.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures_when_period_is_set.json
index 31da0b9b1dc..ade74eae2dd 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures_when_period_is_set.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_issues_measures_when_period_is_set.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_manual_rules.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_manual_rules.json
index 60a000a0a43..f75d1519346 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_manual_rules.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_manual_rules.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures.json
index efa46c28829..83d040a3682 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures_when_period_is_set.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures_when_period_is_set.json
index cc34de25f9d..60e51356b2c 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures_when_period_is_set.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_measures_when_period_is_set.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_periods.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_periods.json
index ce54c1e87ce..474d13fb1ec 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_periods.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_periods.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules.json
index d9172f38383..e745fe5b119 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules_when_period_is_set.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules_when_period_is_set.json
index ad8444c8ef2..65ac58302ff 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules_when_period_is_set.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_rules_when_period_is_set.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities.json
index 807a1671257..b490b411ef6 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities_when_period_is_set.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities_when_period_is_set.json
index 53401307052..d98a9f3634d 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities_when_period_is_set.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_severities_when_period_is_set.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_sub_project_equals_to_project.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_sub_project_equals_to_project.json
index 2eaadf88663..c535c2ac6d1 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_sub_project_equals_to_project.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_sub_project_equals_to_project.json
@@ -3,6 +3,7 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "project" : "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": true,
"canMarkAsFavourite": true,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tabs.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tabs.json
index 9b3f2515f80..3009fb3d416 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tabs.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tabs.json
@@ -3,7 +3,9 @@
"path": "src/main/java/org/sonar/api/Plugin.java",
"name": "Plugin.java",
"q": "FIL",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tests_measure.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tests_measure.json
index 385d2ba2321..70ed990402d 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tests_measure.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_with_tests_measure.json
@@ -3,7 +3,9 @@
"path": "src/test/java/org/sonar/server/issue/PlanActionTest.java",
"name": "PlanActionTest.java",
"q": "UTS",
+ "subProject": "org.codehaus.sonar:sonar-plugin-api",
"subProjectName": "SonarQube :: Plugin API",
+ "project": "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": false,
"canMarkAsFavourite": false,
diff --git a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_without_sub_project.json b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_without_sub_project.json
index 709353d023b..0449355dfa1 100644
--- a/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_without_sub_project.json
+++ b/sonar-server/src/test/resources/org/sonar/server/component/ws/ComponentAppActionTest/app_without_sub_project.json
@@ -2,6 +2,7 @@
"key": "org.codehaus.sonar:sonar",
"name": "SonarQube",
"q": "TRK",
+ "project" : "org.codehaus.sonar:sonar",
"projectName": "SonarQube",
"fav": true,
"canMarkAsFavourite": true,