Examples of GroupId


Examples of org.apache.shindig.social.opensocial.spi.GroupId

    }

    @Test
    public void getPeople_friendIsFriendsWith() throws ExecutionException, InterruptedException {
        Set<UserId> ids = getUserIdSet();
        GroupId groupId = new GroupId(GroupId.Type.friends, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId);
        replay(token);

        CollectionOptions options = new CollectionOptions();
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    }

    @Test
    public void getPeople_allIsFriendsWith() throws ExecutionException, InterruptedException {
        Set<UserId> ids = getUserIdSet();
        GroupId groupId = new GroupId(GroupId.Type.all, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId);
        replay(token);

        CollectionOptions options = new CollectionOptions();
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    }

    @Test
    public void getPeople_groupIsFriendsWith() throws ExecutionException, InterruptedException {
        Set<UserId> ids = getUserIdSet();
        GroupId groupId = new GroupId(GroupId.Type.groupId, GROUP_ID);
        String appId = "5";
        expect(token.getAppId()).andReturn(appId).anyTimes();
        replay(token);

        CollectionOptions options = new CollectionOptions();
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    public void getPeople_deleted() throws ExecutionException, InterruptedException {
        String self = ID_1;
        expect(token.getViewerId()).andReturn(self);
        replay(token);
        Set<UserId> ids = getUserIdSet();
        GroupId groupId = new GroupId(GroupId.Type.deleted, GROUP_ID);

        Future<RestfulCollection<Person>> people = service.getPeople(ids, groupId, null, null, token);
    }
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    SpiTestUtil.assertActivityEquals(activity, testActivity);
  }

  @Test
  public void getJohnDoeActivities() throws Exception {
    Future<RestfulCollection<Activity>> result = this.activityServiceDb.getActivities(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), null, ACTIVITY_ALL_FIELDS, new CollectionOptions(), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    RestfulCollection<Activity> activityCollection = result.get();
    assertEquals(1, activityCollection.getTotalResults());
    assertEquals(0, activityCollection.getStartIndex());
    SpiTestUtil.assertActivityEquals(activityCollection.getEntry().get(0), testActivity);
  }
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    SpiTestUtil.assertActivityEquals(activityCollection.getEntry().get(0), testActivity);
  }

  @Test
  public void getJohnDoeFriendsActivities() throws Exception {
    Future<RestfulCollection<Activity>> result = this.activityServiceDb.getActivities(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), null, ACTIVITY_ALL_FIELDS, new CollectionOptions(), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    RestfulCollection<Activity> activityCollection = result.get();
    assertEquals(2, activityCollection.getTotalResults());
    assertEquals(0, activityCollection.getStartIndex());
  }
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

  public void createNewActivityForJohnDoe() throws Exception {
    // Create new activity
    final String title = "hi mom!";
    final String body = "and dad.";
    Activity activity = SpiTestUtil.buildTestActivity("2", "john.doe", title, body);
    this.activityServiceDb.createActivity(new UserId(Type.userId, "john.doe"), new GroupId(GroupId.Type.self, "@self"), "2", ACTIVITY_ALL_FIELDS, activity, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);

    // Check activity was created as expected
    Future<RestfulCollection<Activity>> result = this.activityServiceDb.getActivities(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.self, "@self"), null, ACTIVITY_ALL_FIELDS, new CollectionOptions(), SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    RestfulCollection<Activity> activityCollection = result.get();
    assertEquals(2, activityCollection.getTotalResults());
    assertEquals(0, activityCollection.getStartIndex());
    activity = activityCollection.getEntry().get(1);
    assertEquals(activity.getTitle(), title);
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    collectionOptions.setSortBy("name");
    collectionOptions.setSortOrder(SortOrder.ascending);
    collectionOptions.setMax(20);

    // Get all friends of john.doe
    Future<RestfulCollection<Person>> result = this.personServiceDb.getPeople(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), collectionOptions, Person.Field.ALL_FIELDS, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);

    RestfulCollection<Person> peopleCollection = result.get();
    assertEquals(3, peopleCollection.getTotalResults());
    assertEquals(0, peopleCollection.getStartIndex());
    List<Person> people = peopleCollection.getEntry();
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    collectionOptions.setSortOrder(SortOrder.ascending);
    collectionOptions.setFirst(0);
    collectionOptions.setMax(1);

    // Get first friend of john.doe
    Future<RestfulCollection<Person>> result = this.personServiceDb.getPeople(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), collectionOptions, Person.Field.ALL_FIELDS, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    RestfulCollection<Person> peopleCollection = result.get();
    assertEquals(3, peopleCollection.getTotalResults());
    assertEquals(0, peopleCollection.getStartIndex());
    List<Person> people = peopleCollection.getEntry();
    SpiTestUtil.assertPersonEquals(people.get(0), "george.doe", "George Doe");

    // Get second friend of john.doe
    collectionOptions.setFirst(1);
    result = this.personServiceDb.getPeople(SpiTestUtil.buildUserIds("john.doe"), new GroupId(GroupId.Type.friends, "@friends"), collectionOptions, Person.Field.ALL_FIELDS, SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    peopleCollection = result.get();
    assertEquals(3, peopleCollection.getTotalResults());
    assertEquals(1, peopleCollection.getStartIndex());
    people = peopleCollection.getEntry();
    SpiTestUtil.assertPersonEquals(people.get(0), "jane.doe", "Jane Doe");
View Full Code Here

Examples of org.apache.shindig.social.opensocial.spi.GroupId

    bootstrap.tearDown();
  }

  @Test
  public void getJohnDoeActivityWithAppId1() throws Exception {
    Future<Activity> result = this.activityServiceDb.getActivity(new UserId(Type.userId, "john.doe"), new GroupId(GroupId.Type.self, "@self"), null, ACTIVITY_ALL_FIELDS, "1", SpiTestUtil.DEFAULT_TEST_SECURITY_TOKEN);
    Activity activity = result.get();
    SpiTestUtil.assertActivityEquals(activity, testActivity);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.