Package org.opensocial.auth

Examples of org.opensocial.auth.OAuth2LeggedScheme


  private static final String CONSUMER_KEY = "orkut.com:623061448914";
  private static final String CONSUMER_SECRET = "uynAeXiWTisflWX99KU1D2q5";

  @Test(expected = RequestException.class)
  public void testEmptyRequestQueue() throws RequestException, IOException {
    Client client = new Client(new OrkutProvider(), new OAuth2LeggedScheme(
        CONSUMER_KEY, CONSUMER_SECRET, VIEWER_ID));

    Map<String, Request> requests = new HashMap<String, Request>();
    client.send(requests);
  }
View Full Code Here


    client.send(requests);
  }

  @Test(expected = RequestException.class)
  public void testNoEndpointsSet() throws RequestException, IOException {
    Client client = new Client(new Provider(), new OAuth2LeggedScheme(
        CONSUMER_KEY, CONSUMER_SECRET, VIEWER_ID));

    Request request = PeopleService.getViewer();
    client.send(request);
  }
View Full Code Here

    activity.setBody("opensocial-java-client test activity body");
    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);
View Full Code Here

  @Test
  public void create() {
    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));

      MediaItem mediaItem = new MediaItem();
      mediaItem.setUrl("http://api.myspace.com/v1/users/63129100");

      Notification notification = new Notification();
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);
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);
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);
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);
View Full Code Here

  @Test
  public void retrieve() {
    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();
View Full Code Here

TOP

Related Classes of org.opensocial.auth.OAuth2LeggedScheme

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.