Package org.apache.shindig.social.core.model

Examples of org.apache.shindig.social.core.model.PersonImpl


  private BeanJsonConverter beanJsonConverter;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    johnDoe = new PersonImpl("johnDoeId", "Johnny", new NameImpl("John Doe"));
    johnDoe.setPhoneNumbers(Lists.<ListField> newArrayList(new ListFieldImpl("home",
        "+33H000000000"), new ListFieldImpl("mobile", "+33M000000000"), new ListFieldImpl("work",
        "+33W000000000")));

    johnDoe.setAddresses(Lists.<Address> newArrayList(new AddressImpl("My home address")));
View Full Code Here


  @Override
  public void setUp() throws Exception {
    super.setUp();
    Injector injector = Guice.createInjector(new SocialApiTestsGuiceModule());

    johnDoe = new PersonImpl("johnDoeId", "Johnny", new NameImpl("John Doe"));
    johnDoe.setPhoneNumbers(Lists.<ListField> newArrayList(new ListFieldImpl(
        "home", "+33H000000000"), new ListFieldImpl("mobile", "+33M000000000"),
        new ListFieldImpl("work", "+33W000000000")));

    johnDoe.setAddresses(Lists.<Address> newArrayList(new AddressImpl(
View Full Code Here

    name.setAdditionalName("H");
    name.setFamilyName("Digg");
    name.setGivenName("Shin");
    name.setHonorificPrefix("Sir");
    name.setHonorificSuffix("Social Butterfly");
    canonical = new PersonImpl("canonical", "Shin Digg", name);

    canonical.setAboutMe("I have an example of every piece of data");
    canonical.setActivities(Lists.newArrayList("Coding Shindig"));

    Address address = new AddressImpl("PoBox 3565, 1 OpenStandards Way, Apache, CA");
View Full Code Here

  private boolean outputInfo = false;

  @Override
  public void setUp() throws Exception {
    super.setUp();
    johnDoe = new PersonImpl("johnDoeId", "Johnny", new NameImpl("John Doe"));
    johnDoe.setPhoneNumbers(Lists.<ListField>newArrayList(
        new ListFieldImpl("home", "+33H000000000"),
        new ListFieldImpl("mobile", "+33M000000000"),
        new ListFieldImpl("work", "+33W000000000")));
View Full Code Here

    assertEquals(field, Person.Field.fromUrlString(field.toString()));
  }

  @Test
  public void testGetProfileUrl() throws Exception {
    Person person = new PersonImpl();
    assertNull(person.getProfileUrl());

    String address = "hi";
    person.setProfileUrl(address);
    assertEquals(address, person.getProfileUrl());

    assertEquals(address, person.getUrls().get(0).getValue());
    assertEquals(Person.PROFILE_URL_TYPE, person.getUrls().get(0).getType());
    assertNull(person.getUrls().get(0).getLinkText());

    address = "something new";
    person.setProfileUrl(address);
    assertEquals(address, person.getProfileUrl());

    assertEquals(1, person.getUrls().size());
    assertEquals(address, person.getUrls().get(0).getValue());
  }
View Full Code Here

    assertEquals(address, person.getUrls().get(0).getValue());
  }

  @Test
  public void testGetThumbnailUrl() throws Exception {
    Person person = new PersonImpl();
    assertNull(person.getThumbnailUrl());

    String url = "hi";
    person.setThumbnailUrl(url);
    assertEquals(url, person.getThumbnailUrl());

    assertEquals(url, person.getPhotos().get(0).getValue());
    assertEquals(Person.THUMBNAIL_PHOTO_TYPE, person.getPhotos().get(0).getType());

    url = "something new";
    person.setThumbnailUrl(url);
    assertEquals(url, person.getThumbnailUrl());

    assertEquals(1, person.getPhotos().size());
    assertEquals(url, person.getPhotos().get(0).getValue());
  }
View Full Code Here

  @Test
  public void testHandleGetFriendById() throws Exception {
    String path = "/people/john.doe/@friends/jane.doe";
    RestHandler operation = registry.getRestHandler(path, "GET");

    Person person = new PersonImpl();
    List<Person> people = Lists.newArrayList(person);
    RestfulCollection<Person> data = new RestfulCollection<Person>(people);
    // TODO: We aren't passing john.doe to the service yet.
    expect(personService.getPeople(
        eq(ImmutableSet.of(new UserId(UserId.Type.userId, "jane.doe"))),
View Full Code Here

  @Test
  public void testHandleGetSelf() throws Exception {
    String path = "/people/john.doe/@self";
    RestHandler operation = registry.getRestHandler(path, "GET");

    Person data = new PersonImpl();
    expect(personService.getPerson(eq(JOHN_DOE.iterator().next()),
        eq(DEFAULT_FIELDS), eq(token))).andReturn(Futures.immediateFuture(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(),
View Full Code Here

  @Test
  public void testHandleAnonymousUser() throws Exception {
    String path = "/people/-1";
    RestHandler operation = registry.getRestHandler(path, "GET");

    Person data = new PersonImpl();
    expect(personService.getPerson(eq(ANONYMOUS),
        eq(DEFAULT_FIELDS), eq(token))).andReturn(Futures.immediateFuture(data));

    replay();
    assertEquals(data, operation.execute(Maps.<String, String[]>newHashMap(),
View Full Code Here

    String jsonPerson = "{person: {aboutMe: 'A person'}}";

    String path = "/people/john.doe/@self";
    RestHandler operation = registry.getRestHandler(path, "PUT");

    Person person = new PersonImpl();
    expect(converter.convertToObject(eq(jsonPerson), eq(Person.class)))
        .andReturn(person);

    expect(personService.updatePerson(eq(JOHN_DOE.iterator().next()),
        eq(person),
View Full Code Here

TOP

Related Classes of org.apache.shindig.social.core.model.PersonImpl

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.