Package org.apache.sling.commons.json

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


    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


    assertNotNull(aceObject);

          int order = aceObject.optInt("order");
          assertEquals(0, order);

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

    assertEquals(1, jsonObject2.length());
   
    JSONObject aceObject2 = jsonObject2.optJSONObject(testUserId);
    assertNotNull(aceObject2);

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

    assertEquals(1, jsonObject.length());
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    assertEquals(testUserId, aceObject.optString("principal"));
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
    Set<String> grantedPrivilegeNames = new HashSet<String>();
View Full Code Here

    assertEquals(1, jsonObject2.length());
   
    JSONObject aceObject2 = jsonObject2.optJSONObject(testUserId);
    assertNotNull(aceObject2);
   
    assertEquals(testUserId, aceObject2.optString("principal"));
   
    JSONArray grantedArray2 = aceObject2.optJSONArray("granted");
    assertNotNull(grantedArray2);
    assertEquals(2, grantedArray2.length());
    Set<String> grantedPrivilegeNames2 = new HashSet<String>();
View Full Code Here

    assertEquals(1, jsonObject.length());
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    assertEquals(testUserId, aceObject.optString("principal"));
   
    JSONArray grantedArray = aceObject.getJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
    Set<String> grantedPrivilegeNames = new HashSet<String>();
View Full Code Here

    assertEquals(1, jsonObject.length());

    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    assertEquals(testUserId, aceObject.optString("principal"));
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
    Set<String> grantedPrivilegeNames = new HashSet<String>();
View Full Code Here

    assertEquals(1, jsonObject2.length());
   
    JSONObject aceObject2 = jsonObject2.optJSONObject(testUserId);
    assertNotNull(aceObject2);
   
    assertEquals(testUserId, aceObject2.optString("principal"));
   
    JSONArray grantedArray2 = aceObject2.optJSONArray("granted");
    assertNotNull(grantedArray2);
    assertEquals(1, grantedArray2.length());
    Set<String> grantedPrivilegeNames2 = new HashSet<String>();
View Full Code Here

    assertEquals(1, jsonObject.length());
   
    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    assertEquals(testUserId, aceObject.optString("principal"));
   
    JSONArray grantedArray = aceObject.getJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(4, grantedArray.length());
    Set<String> grantedPrivilegeNames = new HashSet<String>();
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.