Examples of Comments


Examples of org.xwiki.rest.model.jaxb.Comments

        String commentsUri = getUriBuilder(CommentsResource.class).build(getWiki(), SPACE_NAME, PAGE_NAME).toString();

        GetMethod getMethod = executeGet(commentsUri);
        Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());

        Comments comments = (Comments) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());

        for (Comment comment : comments.getComments()) {
            checkLinks(comment);
        }
    }
View Full Code Here

Examples of org.xwiki.rest.model.jaxb.Comments

        String commentsUri = getUriBuilder(CommentsResource.class).build(getWiki(), SPACE_NAME, PAGE_NAME).toString();

        GetMethod getMethod = executeGet(commentsUri);
        Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());

        Comments comments = (Comments) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());

        int numberOfComments = comments.getComments().size();

        NameValuePair[] nameValuePairs = new NameValuePair[1];
        nameValuePairs[0] = new NameValuePair("text", "Comment");

        PostMethod postMethod =
            executePostForm(commentsUri, nameValuePairs, TestUtils.ADMIN_CREDENTIALS.getUserName(),
                TestUtils.ADMIN_CREDENTIALS.getPassword());
        Assert.assertEquals(getHttpMethodInfo(postMethod), HttpStatus.SC_CREATED, postMethod.getStatusCode());

        getMethod = executeGet(commentsUri);
        Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());

        comments = (Comments) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());

        Assert.assertEquals(numberOfComments + 1, comments.getComments().size());
    }
View Full Code Here

Examples of org.xwiki.rest.model.jaxb.Comments

        String commentsUri = getUriBuilder(CommentsResource.class).build(getWiki(), SPACE_NAME, PAGE_NAME).toString();

        GetMethod getMethod = executeGet(commentsUri);
        Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());

        Comments comments = (Comments) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());

        int numberOfComments = comments.getComments().size();

        Comment comment = objectFactory.createComment();
        comment.setText("Comment");

        PostMethod postMethod =
            executePostXml(commentsUri, comment, TestUtils.ADMIN_CREDENTIALS.getUserName(),
                TestUtils.ADMIN_CREDENTIALS.getPassword());
        Assert.assertEquals(getHttpMethodInfo(postMethod), HttpStatus.SC_CREATED, postMethod.getStatusCode());

        getMethod = executeGet(commentsUri);
        Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());

        comments = (Comments) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());

        Assert.assertEquals(numberOfComments + 1, comments.getComments().size());
    }
View Full Code Here

Examples of weibo4j.Comments

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    String cids = args[1];
    Comments cm = new Comments();
    try {
      JSONArray comment = cm.getCommentShowBatch(cids);
      Log.logInfo(comment.toString());
    } catch (WeiboException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of weibo4j.Comments

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    String id = args[1];
    Comments cm =new Comments();
    try {
      CommentWapper comment = cm.getCommentById(id);
      for(Comment c : comment.getComments()){
        Log.logInfo(c.toString());
      }
      System.out.println(comment.getTotalNumber());
      System.out.println(comment.getNextCursor());
View Full Code Here

Examples of weibo4j.Comments

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    String cids = args[1];
    Comments cm = new Comments();
    try {
      JSONArray com = cm.destoryCommentBatch(cids);
      Log.logInfo(com.toString());
    } catch (WeiboException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

Examples of weibo4j.Comments

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    Comments cm = new Comments();
    try {
      CommentWapper comment = cm.getCommentToMe();
      for(Comment c :comment.getComments()){
        Log.logInfo(c.toString());
      }
      System.out.println(comment.getTotalNumber());
      System.out.println(comment.getNextCursor());
View Full Code Here

Examples of weibo4j.Comments

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    Comments cm = new Comments();
    try {
      CommentWapper comment = cm.getCommentTimeline();
      for(Comment c : comment.getComments()){
        Log.logInfo(c.toString());
      }
      System.out.println(comment.getTotalNumber());
      System.out.println(comment.getNextCursor());
View Full Code Here

Examples of weibo4j.Comments

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    Comments cm = new Comments();
    try {
      CommentWapper comment = cm.getCommentByMe();
      for(Comment c : comment.getComments()){
        Log.logInfo(c.toString());
      }
      System.out.println(comment.getNextCursor());
      System.out.println(comment.getPreviousCursor());
View Full Code Here

Examples of weibo4j.Comments

  public static void main(String[] args) {
    String access_token = args[0];
    Weibo weibo = new Weibo();
    weibo.setToken(access_token);
    Comments cm = new Comments();
    try {
      CommentWapper comment = cm.getCommentMentions();
      for(Comment c : comment.getComments()){
        Log.logInfo(c.toString());
      }
      System.out.println(comment.getNextCursor());
      System.out.println(comment.getPreviousCursor());
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.