Package org.opensocial.providers

Examples of org.opensocial.providers.MySpaceProvider


        new Date().getTime());
    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();
View Full Code Here

  @Test
  public void testGetAuthorizationUrl() throws OAuthException,
      URISyntaxException, IOException {
    HttpClientStub httpClient = new HttpClientStub();
    Provider provider = new MySpaceProvider();

    OAuth3LeggedScheme authScheme = new OAuth3LeggedScheme(provider,
        consumerKey, consumerSecret, httpClient);

    httpClient.addResponse(200, OAuth.OAUTH_TOKEN + "=OAUTH_TOKEN&" +
View Full Code Here

  @Test
  public void testGetAuthorizationUrlUnregistered() throws OAuthException,
      URISyntaxException, IOException {
    HttpClientStub httpClient = new HttpClientStub();
    Provider provider = new MySpaceProvider() {
      @Override
      public String getRequestTokenUrl() {
        return null;
      }
    };
View Full Code Here

  @Test
  public void testGetAuthorizationUrlRequestTokenParams() throws
      OAuthException, URISyntaxException, IOException {
    HttpClientStub httpClient = new HttpClientStub();
    Provider provider = new MySpaceProvider();

    provider.addRequestTokenParameter("testKey", "testValue");

    OAuth3LeggedScheme authScheme = new OAuth3LeggedScheme(provider,
        consumerKey, consumerSecret, httpClient);

    httpClient.addResponse(200, OAuth.OAUTH_TOKEN + "=OAUTH_TOKEN&" +
View Full Code Here

  @Test
  public void testRequestAccessToken() throws OAuthException,
      URISyntaxException, IOException {
    HttpClientStub httpClient = new HttpClientStub();
    Provider provider = new MySpaceProvider();

    OAuth3LeggedScheme authScheme = new OAuth3LeggedScheme(provider,
        consumerKey, consumerSecret, httpClient);

    httpClient.addResponse(200, OAuth.OAUTH_TOKEN + "=OAUTH_TOKEN&" +
View Full Code Here

    assertEquals("ACCESS_TOKEN", token.token);
  }

  @Test
  public void testGetHttpMessage() throws RequestException, IOException {
    Provider provider = new MySpaceProvider();
    OAuth3LeggedScheme authScheme = new OAuth3LeggedScheme(provider,
        consumerKey, consumerSecret);
    authScheme.setAccessToken(new OAuth3LeggedScheme.Token("ACCESS_TOKEN",
        "ACCESS_TOKEN_SECRET"));
View Full Code Here

  }

  @Test
  public void testGetHttpMessageSignBodyHash() throws RequestException,
      IOException {
    Provider provider = new MySpaceProvider() {
      @Override
      public boolean getSignBodyHash() {
        return true;
      }
    };
View Full Code Here

  private static final String MYSPACE_ID = "495184236";

  @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");
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();
View Full Code Here

TOP

Related Classes of org.opensocial.providers.MySpaceProvider

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.