Package org.apache.shindig.social.opensocial.model

Examples of org.apache.shindig.social.opensocial.model.Person


        }
    }

    private void populatePerson(Map<String, Person> peopleById, ActivityStreamsObject actor) {
        String id = actor.getId();
        Person person = peopleById.containsKey(id) ? peopleById.get(id) : getPerson(id);
        if(person != null) {
            peopleById.put(id, person);
            actor.setUrl(person.getProfileUrl());
            actor.setDisplayName(person.getDisplayName());
            ActivityStreamsMediaLinkImpl image = new ActivityStreamsMediaLinkImpl();
            image.setUrl(person.getThumbnailUrl());
            actor.setImage(image);
        }
    }
View Full Code Here


            actor.setImage(image);
        }
    }

    private Person getPerson(String id) {
        Person person;
        SecurityToken token = new BasicSecurityToken(null, id, null, null, null, null, null, null, null);
        try {
            person =  personService.getPerson(new UserId(UserId.Type.viewer, id), null, token).get();
        } catch (Exception e) {
            throw new RuntimeException("Unable to retrieve person", e);
View Full Code Here

        assertThat(p.getDrinker(), is(nullValue()));
    }

    @Test
    public void getEmails_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.EMAILS));
        assertThat(p.getEmails().size(), is(equalTo(3)));
        int primaryCount = 0;
        for(ListField field : p.getEmails()) {
            assertThat(isValidEmailField(field), is(true));
            primaryCount += field.getPrimary() != null && field.getPrimary() ? 1 : 0;
        }
        assertThat(primaryCount, is(equalTo(1)));
    }
View Full Code Here

        assertThat(primaryCount, is(equalTo(1)));
    }

    @Test
    public void getEthnicity_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.ETHNICITY, Person.Field.ACTIVITIES));
        assertThat(p.getEthnicity(), is(nullValue()));
    }
View Full Code Here

        assertThat(p.getEthnicity(), is(nullValue()));
    }

    @Test
    public void getFashion_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.FASHION, Person.Field.ACTIVITIES));
        assertThat(p.getFashion(), is(nullValue()));
    }
View Full Code Here

        assertThat(p.getFashion(), is(nullValue()));
    }

    @Test
    public void getFood_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.FOOD, Person.Field.ACTIVITIES));
        assertThat(p.getFood().isEmpty(), is(true));
    }
View Full Code Here

        assertThat(p.getFood().isEmpty(), is(true));
    }

    @Test
    public void getGender_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.GENDER));
        assertThat(p.getGender(), is(equalTo(Person.Gender.female)));
    }
View Full Code Here

        assertThat(p.getGender(), is(equalTo(Person.Gender.female)));
    }

    @Test
    public void getHappiestWhen_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.HAPPIEST_WHEN));
        assertThat(p.getHappiestWhen(), is(nullValue()));
    }
View Full Code Here

        assertThat(p.getHappiestWhen(), is(nullValue()));
    }

    @Test
    public void getHumor_set() {
        Person p = new FieldRestrictingPerson(getTestPerson(), getFieldSet(Person.Field.HUMOR));
        assertThat(p.getHumor(), is(nullValue()));
    }
View Full Code Here

    @Test
    public void getGender_null() {
        org.apache.rave.model.Person testPerson = getTestPerson();
        testPerson.setProperties(new ArrayList<PersonProperty>());
        Person p = new FieldRestrictingPerson(testPerson, getFieldSet(Person.Field.GENDER));
        assertThat(p.getGender(), is(nullValue()));
    }
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.opensocial.model.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.