Skip to content

Commit

Permalink
RELEASE 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnybbb committed Dec 29, 2014
1 parent 30cb539 commit 5f36de7
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 119 deletions.
70 changes: 8 additions & 62 deletions build.gradle
Expand Up @@ -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'

Expand Down Expand Up @@ -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 {
Expand All @@ -98,10 +92,6 @@ configure(subprojects) { subproject ->
artifact sourcesJar {
classifier "sources"
}

artifact javadocJar {
classifier "javadoc"
}
}
}
}
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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, " +
Expand All @@ -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"
Expand All @@ -250,7 +202,7 @@ configure(rootProject) {
}

artifacts {
archives docsZip

archives schemaZip
archives distZip
}
Expand Down Expand Up @@ -279,10 +231,4 @@ task updateRootDocs << {
}
}

model {
tasks.generatePomFileForMavenCustomPublication {
destination = file("$buildDir/pom.xml")
}
}

build.dependsOn('updateRootDocs')
6 changes: 3 additions & 3 deletions 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
Expand Down
4 changes: 2 additions & 2 deletions 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
Expand Up @@ -127,7 +127,7 @@ public String getInterests() {
return interests;
}

public String getWants() {
public String getWants() {
return wants;
}

Expand Down Expand Up @@ -186,8 +186,8 @@ public EducationalBackground getEducationalBackground() {
public EmploymentStatus getEmploymentStatus() {
return employmentStatus;
}

public Map<Language, LanguageSkill> getLanguages() {
return languages;
}
return languages;
}
}
Expand Up @@ -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() {
Expand Down
Expand Up @@ -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 {

Expand Down
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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<String> badges = userProfile.getBadges();
assertEquals(1, badges.size());
assertEquals("PREMIUM", badges.get(0));
List<String> badges = userProfile.getBadges();
assertEquals(1, badges.size());
assertEquals("PREMIUM", badges.get(0));

assertThat(userProfile.getPermalink(), is(not(nullValue())));
assertThat(userProfile.getProfessionalExperience(), is(not(nullValue())));
Expand All @@ -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<String> 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<String> 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());
Expand All @@ -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 {
Expand Down

0 comments on commit 5f36de7

Please sign in to comment.