diff --git a/build.gradle b/build.gradle index cff6f86..fb18e18 100644 --- a/build.gradle +++ b/build.gradle @@ -7,16 +7,20 @@ buildscript { } dependencies { classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.2' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0' classpath 'com.github.ben-manes:gradle-versions-plugin:0.5-beta-6' } } + + configure(allprojects) { + apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'maven-publish' + apply plugin: 'maven' group = 'org.springframework.social' @@ -68,26 +72,16 @@ configure(subprojects) { subproject -> } } - javadoc { - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED - options.author = true - options.header = project.name - //options.overview = "${projectDir}/src/main/java/overview.html" - } task sourcesJar(type: Jar, dependsOn:classes) { classifier = 'sources' from sourceSets.main.allJava } - task javadocJar(type: Jar) { - classifier = 'javadoc' - from javadoc - } artifacts { archives sourcesJar - archives javadocJar + } publishing { @@ -98,10 +92,6 @@ configure(subprojects) { subproject -> artifact sourcesJar { classifier "sources" } - - artifact javadocJar { - classifier "javadoc" - } } } } @@ -148,42 +138,7 @@ configure(rootProject) { dependencies { // for integration tests } - task api(type: Javadoc) { - group = 'Documentation' - description = 'Generates aggregated Javadoc API documentation.' - title = "${rootProject.description} ${version} API" - options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED - options.author = true - options.header = rootProject.description - options.overview = 'src/api/overview.html' - options.links( - 'http://docs.jboss.org/jbossas/javadoc/4.0.5/connector' - ) - source subprojects.collect { project -> - project.sourceSets.main.allJava - } - destinationDir = new File(buildDir, "api") - classpath = files(subprojects.collect { project -> - project.sourceSets.main.compileClasspath - }) - maxMemory = '1024m' - } - task docsZip(type: Zip) { - group = 'Distribution' - classifier = 'docs' - description = "Builds -${classifier} archive containing api and reference " + - "for deployment at static.springframework.org/spring-social/docs." - - from('src/dist') { - include 'changelog.txt' - } - - from (api) { - into 'api' - } - - } task schemaZip(type: Zip) { group = 'Distribution' @@ -212,7 +167,7 @@ configure(rootProject) { } } - task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) { + task distZip(type: Zip, dependsOn: [schemaZip]) { group = 'Distribution' classifier = 'dist' description = "Builds -${classifier} archive, containing all jars and docs, " + @@ -228,9 +183,6 @@ configure(rootProject) { expand(copyright: new Date().format('yyyy'), version: project.version) } - from(zipTree(docsZip.archivePath)) { - into "${baseDir}/docs" - } from(zipTree(schemaZip.archivePath)) { into "${baseDir}/schema" @@ -250,7 +202,7 @@ configure(rootProject) { } artifacts { - archives docsZip + archives schemaZip archives distZip } @@ -279,10 +231,4 @@ task updateRootDocs << { } } -model { - tasks.generatePomFileForMavenCustomPublication { - destination = file("$buildDir/pom.xml") - } -} - build.dependsOn('updateRootDocs') diff --git a/gradle.properties b/gradle.properties index dfbeb78..744223c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ -version = 1.1.2.BUILD-SNAPSHOT +version = 1.1.2.RELEASE springSocialVersion = 1.1.0.RELEASE hamcrestVersion = 1.3 -jacksonVersion = 2.4.2 +jacksonVersion = 2.4.4 junitVersion = 4.11 -mockitoVersion = 1.9.5 +mockitoVersion = 1.10.17 servletApiVersion = 3.0.1 springVersion = 4.0.5.RELEASE springSecurityVersion = 3.2.3.RELEASE diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ea0aef1..277a500 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Aug 14 18:30:13 CEST 2014 +#Mon Dec 29 10:27:03 CET 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-all.zip diff --git a/spring-social-xing/src/main/java/org/springframework/social/xing/api/XingProfile.java b/spring-social-xing/src/main/java/org/springframework/social/xing/api/XingProfile.java index c655520..7c686d6 100644 --- a/spring-social-xing/src/main/java/org/springframework/social/xing/api/XingProfile.java +++ b/spring-social-xing/src/main/java/org/springframework/social/xing/api/XingProfile.java @@ -127,7 +127,7 @@ public String getInterests() { return interests; } - public String getWants() { + public String getWants() { return wants; } @@ -186,8 +186,8 @@ public EducationalBackground getEducationalBackground() { public EmploymentStatus getEmploymentStatus() { return employmentStatus; } - + public Map getLanguages() { - return languages; - } + return languages; + } } diff --git a/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/ProfileTemplate.java b/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/ProfileTemplate.java index 03b421a..6fe8e94 100644 --- a/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/ProfileTemplate.java +++ b/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/ProfileTemplate.java @@ -54,13 +54,13 @@ class ProfileTemplate extends AbstractTemplate implements ProfileOperations { private ObjectMapper objectMapper; public ProfileTemplate(String xingBaseUrl, RestOperations restOperations, ObjectMapper objectMapper) { - super(xingBaseUrl); + super(xingBaseUrl); this.restOperations = restOperations; this.objectMapper = objectMapper; } public ProfileTemplate(RestOperations restOperations, ObjectMapper objectMapper) { - this(null, restOperations, objectMapper); + this(null, restOperations, objectMapper); } public String getProfileId() { diff --git a/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/XingProfileMixin.java b/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/XingProfileMixin.java index 20f9158..789b97b 100644 --- a/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/XingProfileMixin.java +++ b/spring-social-xing/src/main/java/org/springframework/social/xing/api/impl/json/XingProfileMixin.java @@ -15,15 +15,14 @@ */ package org.springframework.social.xing.api.impl.json; -import java.util.List; -import java.util.Map; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; - import org.springframework.social.xing.api.*; +import java.util.List; +import java.util.Map; + @JsonIgnoreProperties(ignoreUnknown = true) abstract class XingProfileMixin { diff --git a/spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/ProfileTemplateTest.java b/spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/ProfileTemplateTest.java index ea1549d..b88f107 100644 --- a/spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/ProfileTemplateTest.java +++ b/spring-social-xing/src/test/java/org/springframework/social/xing/api/impl/ProfileTemplateTest.java @@ -15,8 +15,6 @@ */ package org.springframework.social.xing.api.impl; -import java.util.List; - import org.hamcrest.CoreMatchers; import org.junit.Test; import org.springframework.core.io.ClassPathResource; @@ -26,6 +24,8 @@ import org.springframework.social.xing.api.FormOfEmployment; import org.springframework.social.xing.api.XingProfile; +import java.util.List; + import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsNull.nullValue; @@ -41,18 +41,18 @@ */ public class ProfileTemplateTest extends AbstractXingApiTest { - @Test - public void getUserProfile() { - mockServer.expect(requestTo(XingTemplate.DEFAULT_BASE_URL + ProfileTemplate.USERS_URL.replaceFirst("\\{id\\}","me"))).andExpect(method(GET)) - .andRespond(withSuccess(new ClassPathResource("testdata/profile.json", getClass()), MediaType.APPLICATION_JSON)); - XingProfile userProfile = xing.profileOperations().getUserProfile(); - assertEquals("6628146_33f97b", userProfile.getId()); - assertEquals("Johannes", userProfile.getFirstName()); - assertEquals("Bühler", userProfile.getLastName()); + @Test + public void getUserProfile() { + mockServer.expect(requestTo(XingTemplate.DEFAULT_BASE_URL + ProfileTemplate.USERS_URL.replaceFirst("\\{id\\}", "me"))).andExpect(method(GET)) + .andRespond(withSuccess(new ClassPathResource("testdata/profile.json", getClass()), MediaType.APPLICATION_JSON)); + XingProfile userProfile = xing.profileOperations().getUserProfile(); + assertEquals("6628146_33f97b", userProfile.getId()); + assertEquals("Johannes", userProfile.getFirstName()); + assertEquals("Bühler", userProfile.getLastName()); - List badges = userProfile.getBadges(); - assertEquals(1, badges.size()); - assertEquals("PREMIUM", badges.get(0)); + List badges = userProfile.getBadges(); + assertEquals(1, badges.size()); + assertEquals("PREMIUM", badges.get(0)); assertThat(userProfile.getPermalink(), is(not(nullValue()))); assertThat(userProfile.getProfessionalExperience(), is(not(nullValue()))); @@ -65,25 +65,25 @@ public void getUserProfile() { assertEquals(2, userProfile.getEducationalBackground().getSchools().size()); assertEquals(3, userProfile.getEducationalBackground().getQualifications().size()); assertEquals("Java Design Patterns Course Certificate", userProfile.getEducationalBackground().getQualifications().get(2)); - - } - - - @Test - public void getFullUserProfile() { - mockServer.expect(requestTo(XingTemplate.DEFAULT_BASE_URL + ProfileTemplate.USERS_URL.replaceFirst("\\{id\\}","me"))).andExpect(method(GET)) - .andRespond(withSuccess(new ClassPathResource("testdata/full_profile.json", getClass()), MediaType.APPLICATION_JSON)); - XingProfile userProfile = xing.profileOperations().getUserProfile(); - assertEquals(4, userProfile.getLanguages().size()); - assertEquals("ACM, GI", userProfile.getOrganisationMember()); - assertEquals("m", userProfile.getGender()); - - List badges = userProfile.getBadges(); - assertEquals(2, badges.size()); - assertEquals("PREMIUM", badges.get(0)); - assertEquals("MODERATOR", badges.get(1)); - - assertEquals("max.mustermann@xing.com", userProfile.getActiveEmail()); + + } + + + @Test + public void getFullUserProfile() { + mockServer.expect(requestTo(XingTemplate.DEFAULT_BASE_URL + ProfileTemplate.USERS_URL.replaceFirst("\\{id\\}", "me"))).andExpect(method(GET)) + .andRespond(withSuccess(new ClassPathResource("testdata/full_profile.json", getClass()), MediaType.APPLICATION_JSON)); + XingProfile userProfile = xing.profileOperations().getUserProfile(); + assertEquals(4, userProfile.getLanguages().size()); + assertEquals("ACM, GI", userProfile.getOrganisationMember()); + assertEquals("m", userProfile.getGender()); + + List badges = userProfile.getBadges(); + assertEquals(2, badges.size()); + assertEquals("PREMIUM", badges.get(0)); + assertEquals("MODERATOR", badges.get(1)); + + assertEquals("max.mustermann@xing.com", userProfile.getActiveEmail()); assertThat(userProfile.getEducationalBackground(), is(not(nullValue()))); assertEquals("1_abcdef", userProfile.getProfessionalExperience().getPrimaryCompany().getId()); assertEquals(Boolean.TRUE, userProfile.getProfessionalExperience().getPrimaryCompany().getUntilNow()); @@ -93,16 +93,16 @@ public void getFullUserProfile() { assertEquals(2, userProfile.getEducationalBackground().getQualifications().size()); assertEquals("PADI AOWD", userProfile.getEducationalBackground().getQualifications().get(1)); assertEquals(4, userProfile.getProfessionalExperience().getCompanies().size()); - - } - - - @Test - public void getProfileId() { - mockServer.expect(requestTo(XingTemplate.DEFAULT_BASE_URL + ProfileTemplate.USERS_URL.replaceFirst("\\{id\\}","me"))).andExpect(method(GET)) - .andRespond(withSuccess(new ClassPathResource("testdata/profile.json", getClass()), MediaType.APPLICATION_JSON)); - assertEquals("6628146_33f97b", xing.profileOperations().getProfileId()); - } + + } + + + @Test + public void getProfileId() { + mockServer.expect(requestTo(XingTemplate.DEFAULT_BASE_URL + ProfileTemplate.USERS_URL.replaceFirst("\\{id\\}", "me"))).andExpect(method(GET)) + .andRespond(withSuccess(new ClassPathResource("testdata/profile.json", getClass()), MediaType.APPLICATION_JSON)); + assertEquals("6628146_33f97b", xing.profileOperations().getProfileId()); + } @Test public void fullProfilFieldsAsString() throws Exception {