Package com.sola.instagram

Examples of com.sola.instagram.InstagramSession


import org.junit.Test;

public class InstagramSessionTest {

  private InstagramSession getNewSession() {
    InstagramSession sess = new InstagramSession(new AccessToken(Constants.ACCESS_TOKEN));
    //sess.setHttpProxy("180.180.121.156", 8080);
    return sess;
  }
View Full Code Here


    getNewSession().getUserById(Constants.VALID_USER_ID);
  }
  @Test
  public void testGetRecentPublishedMedia() throws Exception {
    InstagramSession session = this.getNewSession();
    PaginatedCollection<Media> media = session.getRecentPublishedMedia(Constants.VALID_USER_ID);
    int i = 0;
    for(Media _media: media) {
      System.out.println(_media);
      if(i++ == 50) {
        break;
View Full Code Here

    System.out.print(authUrl);
  }
 
  @Test
  public void testGetFeed() throws Exception, JSONException {
    InstagramSession session = this.getNewSession();
    /*
     * Test that no Exception is thrown for a valid page number
     */
    PaginatedCollection<Media> media = session.getFeed()
    int i = 0;
    for(Media _media: media) {
      System.out.println(_media);
      if(i++ == 50) {
        break;
View Full Code Here

    }     
  }

  @Test
  public void testGetLikedMedia() throws Exception {
    InstagramSession session = this.getNewSession();
    session.getLikedMedia();
  }
View Full Code Here

    System.out.print(getNewSession().searchUsersByName(Constants.VALID_USERNAME));
  }

  @Test
  public void testGetFollows() throws Exception {
    InstagramSession session = this.getNewSession();

    PaginatedCollection<User> follows = session.getFollows(Constants.VALID_USER_ID);
    for(User user: follows) {
      System.out.println(user);
    }
  }
View Full Code Here

    }
  }

  @Test
  public void testGetFollowers() throws Exception {
    InstagramSession session = this.getNewSession();
    PaginatedCollection<User> followers = session.getFollowers(Constants.VALID_USER_ID);
    for(User user: followers) {
      System.out.println(user);
    }   
  }
View Full Code Here

  @Test
  public void testModifyRelationship() throws Exception {
    /*
     * Test that no Exception is thrown for a valid user id
     */
    InstagramSession session = getNewSession();
    Relationship.Action action = null;
    if (session.getRelationshipWith(Constants.VALID_USER_ID)
        .getOutgoingStatus() == Relationship.OutgoingStatus.FOLLOWS)
      action = Relationship.Action.UNFOLLOW;
    else
      action = Relationship.Action.FOLLOW;
    //assertTrue(session.modifyRelationship(Constants.VALID_USER_ID, action));
View Full Code Here

  public void testPostComment() throws Exception {
    /*
     * Test that no Exception is thrown for a valid user id
     */
    Random rand = new Random(19580427);
    InstagramSession session = getNewSession();
    Media media = session.getPopularMedia().get(rand.nextInt() % 10);
    //Comment comment = session.postComment(media.getId(), "nice pic");
  }
View Full Code Here

  @Test
  public void testRemoveComment() throws Exception,
      InterruptedException {
    Random rand = new Random(19580427);
    InstagramSession session = getNewSession();
    Media media = session.getPopularMedia().get(rand.nextInt() % 10);
    //Comment comment = session.postComment(media.getId(), "nice pic");
    //Thread.sleep(5);
    /*
     * Test that no Exception is thrown for a valid comment id
     */
 
View Full Code Here

  }

  @Test
  public void testLikingAndUnlikingMedia() throws Exception {
    Random rand = new Random(19580427);
    InstagramSession session = getNewSession();
    Media media = session.getPopularMedia().get(rand.nextInt() % 10);
    session.likeMedia(media.getId());
    session.removeMediaLike(media.getId());
  }
View Full Code Here

TOP

Related Classes of com.sola.instagram.InstagramSession

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.