Package org.opensocial.models

Examples of org.opensocial.models.Album


  }

  @Ignore("albumId isn't copied to Request")
  @Test
  public void testAlbumCreate() throws RequestException, IOException {
    Album album = new Album();
    String albumId = "myNewAlbum001";
    String caption = "Happy new Year!";
    String description = "Photos of the new year's party.";
    String thumbnailUrl = "http://thumbnailUrl";
    album.setId(albumId);
    album.setCaption(caption);
    album.setDescription(description);
    album.setThumbnailUrl(thumbnailUrl);
    request = AlbumsService.createAlbum(album);
    assertRequestValid(null, "albums.create", "POST");
    assertRequestComponent("@me", Request.GUID);
    assertRequestComponent("@self", Request.GROUP_ID);
View Full Code Here


  }

  @Ignore("albumId isn't copied to Request")
  @Test
  public void testAlbumUpdate() throws RequestException, IOException {
    Album album = new Album();
    String albumId = "myNewAlbum001";
    String caption = "Happy new Year!";
    String description = "Photos of the new year's party.";
    String thumbnailUrl = "http://thumbnailUrl";
    album.setId(albumId);
    album.setCaption(caption);
    album.setDescription(description);
    album.setThumbnailUrl(thumbnailUrl);
    request = AlbumsService.updateAlbum(album);
    assertRequestValid(null, "albums.update", "PUT");
    assertRequestComponent("@me", Request.GUID);
    assertRequestComponent("@self", Request.GROUP_ID);
View Full Code Here

      Client client = new Client(new MySpaceProvider(),
          new OAuth2LeggedScheme(MYSPACE_KEY, MYSPACE_SECRET, MYSPACE_ID));
      Request request = AlbumsService.getAlbum("myspace.com.album.81886");
      Response response = client.send(request);

      Album album = response.getEntry();
      assertTrue(album != null);
      assertTrue(album.getId().equals("myspace.com.album.81886"));
      assertTrue(album.getThumbnailUrl() != null);
      assertTrue(album.getCaption() != null);
    } catch (Exception e) {
      fail("Exception occurred while processing request");
    }
  }
View Full Code Here

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

      Album album = new Album();
      album.setCaption("value");
      album.setDescription("my description goes here");

      Request request = AlbumsService.createAlbum(album);
      Response response = client.send(request);

      assertTrue(response.getStatusLink() != null);
View Full Code Here

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

      Album album = new Album();
      album.setId("myspace.com.album.81886");
      album.setCaption("This is my updated caption");
      album.setDescription("my description goes here");

      Request request = AlbumsService.updateAlbum(album);
      Response response = client.send(request);

      assertTrue(response.getStatusLink() != null);
View Full Code Here

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

    Album album = new Album();
    album.setCaption("This is my updated caption");
    album.setDescription("my description goes here");

    Request request = AlbumsService.updateAlbum(album);
  }
View Full Code Here

TOP

Related Classes of org.opensocial.models.Album

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.