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 = StatusMoodsService.getSupportedMoods();
      Response response = client.send(request);

      List<StatusMood> moods = response.getEntries();
      assertTrue(moods != null);
      assertTrue(moods.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.getStatusHistory();
      Response response = client.send(request);

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

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

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

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

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

      Request request = StatusMoodsService.getFriendStatusHistory(
          "myspace.com.person.63129100");
      Response response = client.send(request);

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

      StatusMood statusMood = new StatusMood();
      statusMood.setStatus("Working on the Java SDK");
      statusMood.setMoodId(90);

      Request request = StatusMoodsService.updateStatus(statusMood);
      client.send(request);

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

  public static void setup() {
    Client client = new Client(new OrkutSandboxProvider(),
        new OAuth2LeggedScheme(ORKUT_KEY, ORKUT_SECRET, ORKUT_ID));
    try {
      Request request = AppDataService.updateAppData("java", "rocks");
      client.send(request);
    } catch (Exception e) {
    }
  }

  @Test
View Full Code Here

  private void retrieveFromOrkut(boolean useRest) {
    try {
      Client client = new Client(new OrkutSandboxProvider(useRest),
          new OAuth2LeggedScheme(ORKUT_KEY, ORKUT_SECRET, ORKUT_ID));
      Request request = AppDataService.getAppData();
      Response response = client.send(request);

      AppData data = response.getEntry();
      assertTrue(data.hasField(ORKUT_ID));
    } catch (Exception e) {
      fail("Exception occurred while processing request");
View Full Code Here

    Client client = new Client(new OrkutSandboxProvider(useRest),
        new OAuth2LeggedScheme(ORKUT_KEY, ORKUT_SECRET, ORKUT_ID));

    try {
      Request request = AppDataService.updateAppData("key", randomValue);
      client.send(request);
    } catch (Exception e) {
      fail("Exception occurred while processing update request");
    }

    try {
View Full Code Here

      fail("Exception occurred while processing update request");
    }

    try {
      Request request = AppDataService.getAppData();
      Response response = client.send(request);

      AppData data = response.getEntry();
      assertTrue(data.getDataForUser(ORKUT_ID, "key").equals(randomValue));
    } catch (Exception e) {
      fail("Exception occurred while processing retrieve request");
View Full Code Here

      fail("Exception occurred while processing retrieve request");
    }

    try {
      Request request = AppDataService.deleteAppData("key");
      client.send(request);
    } catch (Exception e) {
      fail("Exception occurred while processing delete request");
    }

    try {
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.