Package org.opensocial

Examples of org.opensocial.Client.send()


    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


  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) {
      fail("Exception occurred while processing request");
View Full Code Here

          "${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

  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);
    } catch (Exception e) {
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);
    } catch (Exception e) {
View Full Code Here

  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);
    } catch (Exception e) {
View Full Code Here

  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);
    } catch (Exception e) {
View Full Code Here

    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));

      Request request = StatusMoodsService.getStatus();
      Response response = client.send(request);

      StatusMood statusMood = response.getEntry();
      assertTrue(statusMood.getMoodId() != null);
      assertTrue(statusMood.getStatus() != null);
    } catch (Exception e) {
View Full Code Here

    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));

      Request request = StatusMoodsService.getFriendStatuses("@me");
      Response response = client.send(request);

      List<StatusMood> statusMoods = response.getEntries();
      assertTrue(statusMoods != null);
      assertTrue(statusMoods.size() > 0);
    } catch (Exception e) {
View Full Code Here

    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));

      Request request = StatusMoodsService.getSupportedMood(90);
      Response response = client.send(request);

      StatusMood mood = response.getEntry();
      assertTrue(mood.getMoodId() != null);
      assertTrue(mood.getMoodId().equals("90"));
    } catch (Exception e) {
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.