Package org.opensocial.auth

Examples of org.opensocial.auth.OAuth2LeggedScheme


    Random generator = new Random();
    String randomValue1 = String.valueOf(generator.nextInt());
    String randomValue2 = String.valueOf(generator.nextInt());

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

    try {
      Map<String, String> data = new HashMap<String, String>();
      data.put("key1", randomValue1);
      data.put("key2", randomValue2);
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 = ProfileCommentsService.getComments();
      Response response = client.send(request);

      Comment comment = response.getEntry();
      assertTrue(comment.getId() != null);
View Full Code Here

*
*/
public class BaseRequestTest extends AbstractRequestTest {
  @BeforeClass
  public static void init() {
    client = new Client(new OrkutProvider(false), new OAuth2LeggedScheme(
        "consumerKey", "consumerSecret"));
  }
View Full Code Here

  @Test
  public void retrieveMediaItems() {
    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));
      Request request = MediaItemsService.getMediaItems(
          "myspace.com.album.81886");
      Response response = client.send(request);

      List<MediaItem> mediaItems = response.getEntries();
View Full Code Here

  @Test
  public void retrieveMediaItem() {
    try {
      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));
      Request request = MediaItemsService.getMediaItem(
          "myspace.com.mediaItem.image.646364", "myspace.com.album.81886");
      Response response = client.send(request);

      MediaItem mediaItem = response.getEntry();
View Full Code Here

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

      List<Model> categories = response.getEntries();
      assertTrue(categories != null);
View Full Code Here

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

      MediaItem mediaItem = new MediaItem();
      mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
      mediaItem.setAlbumId("myspace.com.album.81886");
      mediaItem.setType("IMAGE");
View Full Code Here

  @Test(expected=RequestException.class)
  public void createMediaItemWithoutAlbumId() throws RequestException,
      IOException {
    Client client = new Client(new MySpaceProvider(),
        new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));

    MediaItem mediaItem = new MediaItem();
    mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
    mediaItem.setType("IMAGE");
    mediaItem.setMimeType("image/gif");
View Full Code Here

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

      MediaItem mediaItem = new MediaItem();
      mediaItem.setId("myspace.com.mediaItem.image.646364");
      mediaItem.setAlbumId("myspace.com.album.81886");
      mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
View Full Code Here

  }

  @Test(expected=RequestException.class)
  public void updateMediaItemWithoutId() throws RequestException, IOException {
    Client client = new Client(new MySpaceProvider(),
        new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));

    MediaItem mediaItem = new MediaItem();
    mediaItem.setAlbumId("myspace.com.album.81886");
    mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
    mediaItem.setType("IMAGE");
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.