static final String PROPERTY_ORGANIZATION_URL = "organizationUrl";
static final String PROPERTY_DATE = "date";
static final String PROPERTY_STATUS = "status";
- static final String OBJECT_URLS = "urls";
static final String PROPERTY_HOMEPAGE = "homepage";
- static final String PROPERTY_ISSUE_TRACKER = "issueTracker";
+ static final String PROPERTY_ISSUE_TRACKER_URL = "issueTrackerUrl";
static final String OBJECT_ARTIFACT = "artifact";
static final String PROPERTY_URL = "url";
static final String PROPERTY_TERMS_AND_CONDITIONS_URL = "termsAndConditionsUrl";
writeMetadata(jsonWriter, pluginMetadata);
- writeUrls(jsonWriter, pluginMetadata);
-
writeArtifact(jsonWriter, pluginMetadata);
jsonWriter.endObject();
jsonWriter.prop(PROPERTY_LICENSE, pluginMetadata.getLicense());
jsonWriter.prop(PROPERTY_ORGANIZATION_NAME, pluginMetadata.getOrganization());
jsonWriter.prop(PROPERTY_ORGANIZATION_URL, pluginMetadata.getOrganizationUrl());
- }
-
- public void writeUrls(JsonWriter jsonWriter, PluginMetadata pluginMetadata) {
- jsonWriter.name(OBJECT_URLS);
- jsonWriter.beginObject();
jsonWriter.prop(PROPERTY_HOMEPAGE, pluginMetadata.getHomepage());
- jsonWriter.prop(PROPERTY_ISSUE_TRACKER, pluginMetadata.getIssueTrackerUrl());
- jsonWriter.endObject();
+ jsonWriter.prop(PROPERTY_ISSUE_TRACKER_URL, pluginMetadata.getIssueTrackerUrl());
}
public void writeArtifact(JsonWriter jsonWriter, PluginMetadata pluginMetadata) {
"license": "GNU LGPL 3",
"organizationName": "SonarSource",
"organizationUrl": "http://www.sonarsource.com",
- "urls": {
- "homepage": "http://redirect.sonarsource.com/plugins/scmgit.html",
- "issueTracker": "http://jira.codehaus.org/browse/SONARSCGIT"
- },
+ "homepage": "http://redirect.sonarsource.com/plugins/scmgit.html",
+ "issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCGIT",
"artifact": {
"name": "sonar-scm-git-plugin-1.0.jar"
}
"license": "GNU LGPL 3",
"organizationName": "SonarSource",
"organizationUrl": "http://www.sonarsource.com",
- "urls": {
- "homepage": "http://redirect.sonarsource.com/plugins/java.html",
- "issueTracker": "http://jira.codehaus.org/browse/SONARJAVA"
- },
+ "homepage": "http://redirect.sonarsource.com/plugins/java.html",
+ "issueTrackerUrl": "http://jira.codehaus.org/browse/SONARJAVA",
"artifact": {
"name": "sonar-java-plugin-3.0.jar"
}
"license": "GNU LGPL 3",
"organizationName": "SonarSource",
"organizationUrl": "http://www.sonarsource.com",
- "urls": {
- "homepage": "http://redirect.sonarsource.com/plugins/scmsvn.html",
- "issueTracker": "http://jira.codehaus.org/browse/SONARSCSVN"
- },
+ "homepage": "http://redirect.sonarsource.com/plugins/scmsvn.html",
+ "issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCSVN",
"artifact": {
"name": "sonar-scm-svn-plugin-1.0.jar"
}
"license": "GNU LGPL 3",
"organizationName": "SonarSource",
"organizationUrl": "http://www.sonarsource.com",
- "urls": {
- "homepage": "http://redirect.sonarsource.com/plugins/scmgit.html",
- "issueTracker": "http://jira.codehaus.org/browse/SONARSCGIT"
- },
+ "homepage": "http://redirect.sonarsource.com/plugins/scmgit.html",
+ "issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCGIT",
"artifact": {
"name": "sonar-scm-git-plugin-1.0.jar"
}
"license": "GNU LGPL 3",
"organizationName": "SonarSource",
"organizationUrl": "http://www.sonarsource.com",
- "urls": {
- "homepage": "http://redirect.sonarsource.com/plugins/java.html",
- "issueTracker": "http://jira.codehaus.org/browse/SONARJAVA"
- },
+ "homepage": "http://redirect.sonarsource.com/plugins/java.html",
+ "issueTrackerUrl": "http://jira.codehaus.org/browse/SONARJAVA",
"artifact": {
"name": "sonar-java-plugin-3.0.jar"
}
"license": "GNU LGPL 3",
"organizationName": "SonarSource",
"organizationUrl": "http://www.sonarsource.com",
- "urls": {
- "homepage": "http://redirect.sonarsource.com/plugins/scmsvn.html",
- "issueTracker": "http://jira.codehaus.org/browse/SONARSCSVN"
- },
+ "homepage": "http://redirect.sonarsource.com/plugins/scmsvn.html",
+ "issueTrackerUrl": "http://jira.codehaus.org/browse/SONARSCSVN",
"artifact": {
"name": "sonar-scm-svn-plugin-1.0.jar"
}
" \"license\": \"license_hey\"," +
" \"organizationName\": \"org_name\"," +
" \"organizationUrl\": \"org_url\"," +
- " \"urls\":" +
- " {" +
- " \"homepage\": \"homepage_url\"," +
- " \"issueTracker\": \"issueTracker_url\"" +
- " }," +
+ " \"homepage\": \"homepage_url\"," +
+ " \"issueTrackerUrl\": \"issueTracker_url\"," +
" \"artifact\":" +
" {" +
" \"name\": \"some.jar\"" +
" \"license\": \"GNU LGPL 3\"," +
" \"organizationName\": \"SonarSource\"," +
" \"organizationUrl\": \"http://www.sonarsource.com\"," +
- " \"urls\": {" +
- " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
- " \"issueTracker\": \"http://jira.codehaus.org/browse/SONARSCGIT\"" +
- " }," +
+ " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
+ " \"issueTrackerUrl\": \"http://jira.codehaus.org/browse/SONARSCGIT\"," +
" \"artifact\": {" +
" \"name\": \"sonar-scm-git-plugin-1.0.jar\"" +
" }" +
" \"license\": \"GNU LGPL 3\"," +
" \"organizationName\": \"SonarSource\"," +
" \"organizationUrl\": \"http://www.sonarsource.com\"," +
- " \"urls\": {" +
- " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
- " \"issueTracker\": \"http://jira.codehaus.org/browse/SONARSCGIT\"" +
- " }," +
+ " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
+ " \"issueTrackerUrl\": \"http://jira.codehaus.org/browse/SONARSCGIT\"," +
" \"artifact\": {" +
" \"name\": \"sonar-scm-git-plugin-1.0.jar\"" +
" }" +
" \"license\": \"GNU LGPL 3\"," +
" \"organizationName\": \"SonarSource\"," +
" \"organizationUrl\": \"http://www.sonarsource.com\"," +
- " \"urls\": {" +
- " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
- " \"issueTracker\": \"http://jira.codehaus.org/browse/SONARSCGIT\"" +
- " }," +
+ " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
+ " \"issueTrackerUrl\": \"http://jira.codehaus.org/browse/SONARSCGIT\"," +
" \"artifact\": {" +
" \"name\": \"sonar-scm-git-plugin-1.0.jar\"" +
" }" +
" \"license\": \"GNU LGPL 3\"," +
" \"organizationName\": \"SonarSource\"," +
" \"organizationUrl\": \"http://www.sonarsource.com\"," +
- "}");
- }
-
- @Test
- public void verify_properties_written_by_writeUrls() throws Exception {
- jsonWriter.beginObject();
- underTest.writeUrls(jsonWriter, GIT_PLUGIN_METADATA);
- jsonWriter.endObject();
-
- jsonWriter.close();
- assertJson(response.outputAsString()).setStrictArrayOrder(true).isSimilarTo("{" +
- " \"urls\": {" +
- " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
- " \"issueTracker\": \"http://jira.codehaus.org/browse/SONARSCGIT\"" +
- " }," +
+ " \"homepage\": \"http://redirect.sonarsource.com/plugins/scmgit.html\"," +
+ " \"issueTrackerUrl\": \"http://jira.codehaus.org/browse/SONARSCGIT\"," +
"}");
}