Examples of DoubanMailFeedObj


Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

    }
    if (maxResult != null) {
      params.add(new BasicNameValuePair("max-results", "" + maxResult));
    }
    String url = RequestUrls.DOUBAN_MAIL_PREFIX + "/inbox";
    DoubanMailFeedObj result = this.client.getResponse(url, params, DoubanMailFeedObj.class, true);
    return result;
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

    }
    if (maxResult != null) {
      params.add(new BasicNameValuePair("max-results", "" + maxResult));
    }
    String url = RequestUrls.DOUBAN_MAIL_PREFIX + "/outbox";
    DoubanMailFeedObj result = this.client.getResponse(url, params, DoubanMailFeedObj.class, true);
    return result;
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

    }
    if (maxResult != null) {
      params.add(new BasicNameValuePair("max-results", "" + maxResult));
    }
    String url = RequestUrls.DOUBAN_MAIL_PREFIX + "/inbox/unread";
    DoubanMailFeedObj result = this.client.getResponse(url, params, DoubanMailFeedObj.class, true);
    return result;
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

    List<DoubanMailEntryObj> entries = new ArrayList<DoubanMailEntryObj>();
    for (long id : ids) {
      DoubanMailEntryObj entry = generateOnlyAttribute("" + id, true);
      entries.add(entry);
    }
    DoubanMailFeedObj feed = new DoubanMailFeedObj();
    feed.setEntries(entries);
    String url = RequestUrls.DOUBAN_MAIL_PREFIX + "/";
    try {
      int responseCode = this.client.putResponseCodeOnly(url, feed, true);
      if (responseCode != StatusCode.HTTP_STATUS_ACCEPTED) {
        return false;
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

    List<DoubanMailEntryObj> entries = new ArrayList<DoubanMailEntryObj>();
    for (long id : ids) {
      DoubanMailEntryObj entry = generateOnlyAttribute("" + id, false);
      entries.add(entry);
    }
    DoubanMailFeedObj feed = new DoubanMailFeedObj();
    feed.setEntries(entries);
    String url = RequestUrls.DOUBAN_MAIL_PREFIX + "/delete";
    try {
      int responseCode = this.client.postResponseCodeOnly(url, feed, true);
      if (responseCode != StatusCode.HTTP_STATUS_OK) {
        return false;
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

   * Test of getMailsFromInbox method, of class DoubanMailService.
   */
  public void testGetMailsFromInbox_0args() throws Exception {
    System.out.println("getMailsFromInbox");
    DoubanMailService instance = new DoubanMailService(accessToken);
    DoubanMailFeedObj result = instance.getMailsFromInbox();
    for (DoubanMailEntryObj mail : result.getEntries()) {
      System.out.println("title : " + mail.getTitle());
      System.out.println("author : " + mail.getAuthor().getName());
    }
    assertTrue(result.getEntries().size() > 0);
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

  public void testGetMailsFromInbox_Integer_Integer() throws Exception {
    System.out.println("getMailsFromInbox");
    Integer startIndex = 0;
    Integer maxResult = 2;
    DoubanMailService instance = new DoubanMailService(accessToken);
    DoubanMailFeedObj result = instance.getMailsFromInbox(startIndex, maxResult);
    assertEquals(result.getEntries().size(), 2);
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

   * Test of getMailsFromOutbox method, of class DoubanMailService.
   */
  public void testGetMailsFromOutbox_0args() throws Exception {
    System.out.println("getMailsFromOutbox");
    DoubanMailService instance = new DoubanMailService(accessToken);
    DoubanMailFeedObj result = instance.getMailsFromOutbox();
    for (DoubanMailEntryObj mail : result.getEntries()) {
      System.out.println("title : " + mail.getTitle());
    }
    assertTrue(result.getEntries().size() > 0);
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

  public void testGetMailsFromOutbox_Integer_Integer() throws Exception {
    System.out.println("getMailsFromOutbox");
    Integer startIndex = 0;
    Integer maxResult = 2;
    DoubanMailService instance = new DoubanMailService(accessToken);
    DoubanMailFeedObj result = instance.getMailsFromOutbox(startIndex, maxResult);
    assertEquals(result.getEntries().size(), 2);
  }
View Full Code Here

Examples of com.dongxuexidu.douban4j.model.doumail.DoubanMailFeedObj

   * Test of getUnreadMails method, of class DoubanMailService.
   */
  public void testGetUnreadMails_0args() throws Exception {
    System.out.println("getUnreadMails");
    DoubanMailService instance = new DoubanMailService(accessToken);
    DoubanMailFeedObj result = instance.getUnreadMails();
    assertTrue(result.getEntries() == null || result.getEntries().isEmpty());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.