Package winterwell.jtwitter.Twitter

Examples of winterwell.jtwitter.Twitter.Status


   *  NONDETERMINISTIC! Had to increase sleep time to make it more reliable.
   * @throws InterruptedException
   */
  public void testDestroyStatus() throws InterruptedException {
    Twitter tw = new Twitter(TEST_USER, TEST_PASSWORD);
    Status s1 = tw.getStatus();
    tw.destroyStatus(s1.getId());
    Status s0 = tw.getStatus();
    assert s0.id != s1.id : "Status id should differ from that of destroyed status";
  }
View Full Code Here


  }

  public void testDestroyStatusBad() {
    // Check security failure
    Twitter tw = new Twitter(TEST_USER, TEST_PASSWORD);
    Status hs = tw.getStatus("winterstein");
    try {
      tw.destroyStatus(hs);
      assert false;
    } catch (Exception ex) {
      // OK
View Full Code Here

  public void testIdenticaAccess() {
    Twitter jtwit = new Twitter(TEST_USER, TEST_PASSWORD);
    jtwit.setAPIRootUrl("http://identi.ca/api");
    char salt = (char) ('A' + new Random().nextInt(48));
    System.out.println(salt);
    Status s1 = null;
    try {
      s1 = jtwit.updateStatus(salt+" Hello to you shiny open source people");
    } catch (TwitterException.Timeout e) {
      // identi.ca has problems
    }
    Status s2 = jtwit.getStatus();
    assert s1.equals(s2) : s2;
  }
View Full Code Here

  /**
   * Test method for {@link winterwell.jtwitter.Twitter#getStatus(int)}.
   */
  public void testGetStatus() {
    Twitter tw = new Twitter(TEST_USER,TEST_PASSWORD);
    Status s = tw.getStatus();
    assert s != null;
    System.out.println(s);

    //    // test no status
    //    tw = new Twitter(ANOther Account);
View Full Code Here

  /**
   * Test method for {@link winterwell.jtwitter.Twitter#getStatus(long)}.
   */
  public void testGetStatusLong() {
    Twitter tw = new Twitter(TEST_USER, TEST_PASSWORD);
    Status s = tw.getStatus();
    Status s2 = tw.getStatus(s.getId());
    assert s.text.equals(s2.text) : "Fetching a status by id should yield correct text";
  }
View Full Code Here

   * Test method for {@link winterwell.jtwitter.Twitter#updateStatus(java.lang.String)}.
   */
  public void testUpdateStatus() {
    Twitter tw = new Twitter(TEST_USER, TEST_PASSWORD);
    String s = "Experimenting (http://winterwell.com at "+new Date().toString()+")";
    Status s2a = tw.updateStatus(s);
    Status s2b = tw.getStatus();
    assert s2b.text.equals(s) : s2b.text;
    assert s2a.id == s2b.id;
    //    assert s2b.source.equals("web") : s2b.source;
  }
View Full Code Here

  }

  public void testUpdateStatusUnicode() {
    Twitter tw = new Twitter(TEST_USER, TEST_PASSWORD);
    String s = "Katten är hemma. Hur mår du? お元気ですか";
    Status s2a = tw.updateStatus(s);
    Status s2b = tw.getStatus();
    assert s2b.text.equals(s) : s2b.text;
    assert s2a.id == s2b.id;
  }
View Full Code Here

TOP

Related Classes of winterwell.jtwitter.Twitter.Status

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.