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

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


      zipOs.finish();
      zipOs = null;
    }
    public void startDocument(Document doc) throws IOException {
      document = doc;
      jsonDocument = new JsonJavaObject();
      if(itemFlags) {
        jsonDocument.put(FLAGS_FIELD, new JsonJavaObject());
      }
    }
View Full Code Here


    @Test
    public void testConfirmDeleteCommunity() {
        addSnippetParam("CommunityService.communityUuid2", community.getCommunityUuid());
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
        Assert.assertEquals(community.getCommunityUuid(), json.getString("communityUuid"));
       
        community = getCommunity(community.getCommunityUuid(), false);
        if (community != null) {
          String flag = community.getAsString("a:category[@scheme='http://www.ibm.com/xmlns/prod/sn/flags']/@term");
            Assert.assertEquals("Delete community is still available", "deleted", flag);
View Full Code Here

      addSnippetParam("sample.email1", TestEnvironment.getCurrentUserEmail());
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        Assert.assertEquals(20, jsonList.size());
        for (int i=0; i<20; i++) {
            JsonJavaObject json = (JsonJavaObject)jsonList.get(i);
            Assert.assertTrue(json.getInt("profileLoaded") > 0);
        }
    }
View Full Code Here

    @Test
    public void testDeleteCommunityError() {
        addSnippetParam("CommunityService.communityUuid2", "Foo");
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(404, json.getInt("code"));
        Assert.assertEquals("The referenced community does not exist.", json.getString("message"));
    }
View Full Code Here

    @Test
    public void testGetProfile() {

        addSnippetParam("sample.email1", getProperty("sample.userId1"));
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertEquals(getProperty("sample.email1"), json.getString("getEmail"));
    }
View Full Code Here

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

    @Test
    public void testProfileFeedDataHandler() {
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        List jsonList = previewPage.getJsonList();
        Assert.assertEquals(4, jsonList.size());
        JsonJavaObject json = (JsonJavaObject)jsonList.get(0);
        // TODO validate values
    }
View Full Code Here

    @Test
    public void DeleteProfileWithMissingArguments() {       
      addSnippetParam("sample.createProfileId", "");           
     
      JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();       
        Assert.assertEquals(400, json.getInt("code"));      
    }
View Full Code Here

* @date 25 Mar 2013
*/
public class BaseProfileEntryTest extends BaseApiTest {
   
    public void validate(JavaScriptPreviewPage previewPage) {
        JsonJavaObject json = previewPage.getJson();
        validate(json);
    }
View Full Code Here

        addSnippetParam("CommunityService.communityUuid", community.getCommunityUuid());
        addSnippetParam("sample.communityTitle", updatedTitle);
        addSnippetParam("sample.communityContent", updatedContent);
       
        JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
        JsonJavaObject json = previewPage.getJson();
        Assert.assertNull("Unexpected error detected on page", json.getString("code"));
       
        Assert.assertEquals(community.getCommunityUuid(), json.getString("getCommunityUuid"));
        Assert.assertEquals(updatedTitle, json.getString("getTitle"));
        Assert.assertEquals(updatedContent, json.getString("getContent"));
    }
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.