Examples of JsonJavaObject


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

    @Test
    public void testDeleteForumTopicError() {
      addSnippetParam("ForumService.topicUuid", "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

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

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

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

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

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

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

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

    }

    @Test
    public void testCreateForum() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        assertForumProperties(json);
    }
View Full Code Here

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

    public void testGetForums() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        Assert.assertFalse(jsonList.isEmpty());
        for (int i=0; i<jsonList.size(); i++) {
            JsonJavaObject json = (JsonJavaObject)jsonList.get(i);
            assertForumGetters(json);
        }
    }
View Full Code Here

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

    }

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

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

        addSnippetParam("ForumService.topicUuid", forumTopic.getTopicUuid());
        addSnippetParam("ForumService.topicTitle", updatedTitle);
        addSnippetParam("ForumService.topicContent", updatedContent);
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
       
        forumTopic = getForumTopic(forumTopic.getTopicUuid(), true);
        Assert.assertEquals(forumTopic.getTopicUuid(), json.getString("getTopicUuid"));
        Assert.assertEquals(updatedTitle, forumTopic.getTitle());
        Assert.assertEquals(updatedContent, StringUtil.trim(forumTopic.getContent()));
    }
View Full Code Here

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

    }

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

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

        addSnippetParam("ForumService.replyUuid", forumReply.getReplyUuid());
        addSnippetParam("ForumService.replyTitle", updatedTitle);
        addSnippetParam("ForumService.replyContent", updatedContent);
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
       
        forumReply = getForumReply(forumReply.getReplyUuid());
        Assert.assertEquals(forumReply.getReplyUuid(), json.getString("getReplyUuid"));
        Assert.assertEquals(updatedTitle, forumReply.getTitle());
        Assert.assertEquals(updatedContent, StringUtil.trim(forumReply.getContent()));
    }
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.