Package org.apache.sling.commons.json

Examples of org.apache.sling.commons.json.JSONObject.optString()


        // assert content at new location
        String content = getContent(importedNodeUrl2 + ".3.json", CONTENT_TYPE_JSON);

    JSONObject jsonObj = new JSONObject(content);
    assertNotNull(jsonObj);
    assertNull(jsonObj.optString("propTest", null)); //test property should be gone.

    //assert the imported content is there.
        String expectedJsonContent = getStreamAsString(getClass().getResourceAsStream("/integration-test/servlets/post/importresults.json"));
    assertExpectedJSON(new JSONObject(expectedJsonContent), jsonObj);
    }
View Full Code Here


    assertEquals(1, jsonObject.length());
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);

          int order = aceObject.optInt("order");
          assertEquals(0, order);
View Full Code Here

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
View Full Code Here

    assertNull(deniedArray);

    JSONObject aceObject2 = jsonObject.optJSONObject(testUserId2);
    assertNotNull(aceObject2);

    String principalString2 = aceObject2.optString("principal");
    assertEquals(testUserId2, principalString2);
   
    JSONArray grantedArray2 = aceObject2.optJSONArray("granted");
    assertNotNull(grantedArray2);
    assertEquals(2, grantedArray2.length());
View Full Code Here

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
View Full Code Here

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
View Full Code Here

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
View Full Code Here

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertTrue(grantedArray.length() >= 8);
View Full Code Here

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertTrue(grantedArray.length() >= 11);
View Full Code Here

    JSONObject jsonObject = new JSONObject(json);
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNull(grantedArray);
   
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.