Package com.ibm.commons.util.io.json

Examples of com.ibm.commons.util.io.json.JsonJavaObject


      for (JsonJavaObject reply: replies) {
        Reply replyObj = new Reply();
        replyObj.setContent(reply.getString(ASJsonPath.ReplyContent.getPath()));
        replyObj.setReplyId(reply.getString(ASJsonPath.ReplyId.getPath()));
        replyObj.setUpdated(reply.getString(ASJsonPath.ReplyUpdated.getPath()));
        JsonJavaObject authorObject = reply.getJsonObject(ASJsonPath.ReplyAuthor.getPath());
        replyObj.setAuthorId(authorObject.getString(ASJsonPath.ReplyAuthorId.getPath()));
        replyObj.setAuthorName(authorObject.getString(ASJsonPath.ReplyAuthorName.getPath()));
        replyObj.setAuthorObjectType(authorObject.getString(ASJsonPath.ReplyAuthorObjectType.getPath()));
       
        replyList.add(replyObj);
      }
    }
    return replyList;
View Full Code Here


      ForumTopic forumTopic = createForumTopic(forum, title, title);
      ForumReply forumReply = createForumReply(forumTopic, title, title);
        addSnippetParam("ForumService.replyUuid", forumReply.getReplyUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        Assert.assertEquals(forumReply.getReplyUuid(), json.getString("replyUuid"));
       
        forumReply = getForumReply(forumReply.getTopicUuid(), false);
        Assert.assertNull("Deleted forum topic is still available", forumReply);
    }
View Full Code Here

    @Test
    public void testDeleteForumReplyError() {
      addSnippetParam("ForumService.replyUuid", "Foo");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(404, json.getInt("code"));
        Assert.assertEquals("No existing forum found. Please contact your system administrator.", json.getString("message"));
    }
View Full Code Here

    public void testDeleteForumReplyInvalidArg() {
        setAuthType(AuthType.NONE);
      addSnippetParam("ForumService.replyUuid", "");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(400, json.getInt("code"));
        Assert.assertEquals("Invalid argument, expected replyUuid.", json.getString("message"));
    }
View Full Code Here

    @Test
    public void testDeleteForum() {
      addSnippetParam("ForumService.forumUuid", forum.getForumUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        Assert.assertEquals(forum.getForumUuid(), json.getString("forumUuid"));
       
        forum = null; //getForum(forum.getForumUuid(), false);
        Assert.assertNull("Deleted forum is still available", forum);
    }
View Full Code Here

    @Test
    public void testDeleteForumError() {
      addSnippetParam("ForumService.forumUuid", "Foo");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(404, json.getInt("code"));
        Assert.assertEquals("CLFRV0008E: Error, unable to find object with uuid: Foo", json.getString("message"));
    }
View Full Code Here

    public void testDeleteForumInvalidArg() {
        setAuthType(AuthType.NONE);
      addSnippetParam("ForumService.forumUuid", "");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(400, json.getInt("code"));
        Assert.assertEquals("Invalid argument, expected forumUuid.", json.getString("message"));
    }
View Full Code Here

    }

    @Test
    public void testCreatePost() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNotNull(json.getString("uid"));
    }
View Full Code Here

    }

    @Test
    public void testGetComment() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNotNull(json.getString("uid"));
    }
View Full Code Here

      String title = createForumTopicName();
      ForumTopic forumTopic = createForumTopic(forum, title, title);
        addSnippetParam("ForumService.topicUuid", forumTopic.getTopicUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        Assert.assertEquals(forumTopic.getTopicUuid(), json.getString("topicUuid"));
       
        forumTopic = getForumTopic(forumTopic.getTopicUuid(), false);
        Assert.assertNull("Deleted forum topic is still available", forumTopic);
    }
View Full Code Here

TOP

Related Classes of com.ibm.commons.util.io.json.JsonJavaObject

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.