Package org.opensocial

Examples of org.opensocial.Request


    activity.setTitleId("test");

    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));
      Request request = ActivitiesService.createActivity(activity);
      client.send(request);
    } catch (Exception e) {
      fail("Exception occurred while processing request");
    }
  }
View Full Code Here


  @Test
  public void retrieveFromMySpace() {
    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));
      Request request = ActivitiesService.getActivities();
      Response response = client.send(request);

      List<Activity> activities = response.getEntries();
      assertTrue(activities.size() > 0);
    } catch (Exception e) {
View Full Code Here

public class PeopleServiceTest {

  @Test
  public void retrieveWithZeroArguments() {
    Request request = PeopleService.getViewer();

    testCommonAttributes(request);
    testCommonRetrieveAttributes(request);
    assertTrue(request.getComponent(Request.GUID).equals(Service.ME));
    assertTrue(request.getComponent(Request.SELECTOR).equals(Service.SELF));
   
  }
View Full Code Here

      notification.setContent("Hi ${recipient}, here's a notification from " +
          "${canvasUrl}");
      notification.addRecipient("495184236");
      notification.addMediaItem(mediaItem);

      Request request = NotificationsService.createNotification(notification);
      Response response = client.send(request);

      assertTrue(response.getStatusLink() != null);
    } catch (Exception e) {
      fail("Exception occurred while processing request");
View Full Code Here

  }

  @Test
  public void retrieveWithOneArgument() {
    final String id = "03067092798963641994";
    Request request = PeopleService.getUser(id);

    testCommonAttributes(request);
    testCommonRetrieveAttributes(request);
    assertTrue(request.getComponent(Request.GUID).equals(id));
    assertTrue(request.getComponent(Request.SELECTOR).equals(Service.SELF));
  }
View Full Code Here

    assertTrue(request.getComponent(Request.SELECTOR).equals(Service.SELF));
  }

  @Test
  public void retrieveWithTwoArguments() {
    Request request = PeopleService.getFriends();

    testCommonAttributes(request);
    testCommonRetrieveAttributes(request);
    assertTrue(request.getComponent(Request.GUID).equals(Service.ME));
    assertTrue(request.getComponent(Request.SELECTOR).equals(Service.FRIENDS));
  }
View Full Code Here

  private void retrieveSelfFromOrkut(boolean useRest) {
    try {
      Client client = new Client(new OrkutProvider(useRest),
          new OAuth2LeggedScheme(ORKUT_KEY, ORKUT_SECRET, ORKUT_ID));
      Request request = PeopleService.getViewer();
      Response response = client.send(request);

      Person self = response.getEntry();
      assertTrue(self.getId() != null);
      assertTrue(self.getDisplayName() != null);
View Full Code Here

  private void retrieveFriendsFromOrkut(boolean useRest) {
    try {
      Client client = new Client(new OrkutProvider(useRest),
          new OAuth2LeggedScheme(ORKUT_KEY, ORKUT_SECRET, ORKUT_ID));
      Request request = PeopleService.getFriends();
      Response response = client.send(request);

      Person self = response.getEntry();
      assertTrue(self.getId() != null);
      assertTrue(self.getDisplayName() != null);
View Full Code Here

  @Test
  public void retrieveSelfFromGoogle() {
    try {
      Client client = new Client(new GoogleProvider(),
          new OAuth2LeggedScheme(GOOGLE_KEY, GOOGLE_SECRET, GOOGLE_ID));
      Request request = PeopleService.getViewer();
      Response response = client.send(request);

      Person self = response.getEntry();
      assertTrue(self.getId() != null);
      assertTrue(self.getDisplayName() != null);
View Full Code Here

  @Test
  public void retrieveSelfFromMySpace() {
    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));
      Request request = PeopleService.getViewer();
      Response response = client.send(request);

      Person self = response.getEntry();
      assertTrue(self.getId() != null);
      assertTrue(self.getDisplayName() != null);
View Full Code Here

TOP

Related Classes of org.opensocial.Request

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.