Examples of optJSONArray()


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

    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
    assertEquals("jcr:read", grantedArray.getString(0));

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(1, deniedArray.length());
    assertEquals("jcr:write", deniedArray.getString(0));
  }
View Full Code Here

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

          assertEquals(0, order);

    String principalString = aceObject.optString("principal");
    assertEquals(testGroupId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
    assertEquals("jcr:read", grantedArray.getString(0));

    JSONArray deniedArray = aceObject.optJSONArray("denied");
View Full Code Here

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

    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(1, grantedArray.length());
    assertEquals("jcr:read", grantedArray.getString(0));

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals("jcr:write", deniedArray.getString(0));
  }
 
  /**
 
View Full Code Here

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

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

    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals(3, grantedArray.length());
    Set<String> grantedPrivilegeNames = new HashSet<String>();
    for (int i=0; i < grantedArray.length(); i++) {
      grantedPrivilegeNames.add(grantedArray.getString(i));
View Full Code Here

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

    }
    H.assertPrivilege(grantedPrivilegeNames, true, "jcr:read");
    H.assertPrivilege(grantedPrivilegeNames, true, "jcr:readAccessControl");
    H.assertPrivilege(grantedPrivilegeNames, true, "jcr:addChildNodes");

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(2, deniedArray.length());
    Set<String> deniedPrivilegeNames = new HashSet<String>();
    for (int i=0; i < deniedArray.length(); i++) {
      deniedPrivilegeNames.add(deniedArray.getString(i));
View Full Code Here

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

    assertNotNull(aceObject2);

    String principalString2 = aceObject2.optString("principal");
    assertEquals(testUserId, principalString2);
   
    JSONArray grantedArray2 = aceObject2.optJSONArray("granted");
    assertNotNull(grantedArray2);
    assertEquals(3, grantedArray2.length());
    Set<String> grantedPrivilegeNames2 = new HashSet<String>();
    for (int i=0; i < grantedArray2.length(); i++) {
      grantedPrivilegeNames2.add(grantedArray2.getString(i));
View Full Code Here

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

    }
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:read");
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:addChildNodes");
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:modifyProperties");

    JSONArray deniedArray2 = aceObject2.optJSONArray("denied");
    assertNotNull(deniedArray2);
    assertEquals(2, deniedArray2.length());
    Set<String> deniedPrivilegeNames2 = new HashSet<String>();
    for (int i=0; i < deniedArray2.length(); i++) {
      deniedPrivilegeNames2.add(deniedArray2.getString(i));
View Full Code Here

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

    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>();
    for (int i=0; i < grantedArray.length(); i++) {
      grantedPrivilegeNames.add(grantedArray.getString(i));
View Full Code Here

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

    for (int i=0; i < grantedArray.length(); i++) {
      grantedPrivilegeNames.add(grantedArray.getString(i));
    }
    H.assertPrivilege(grantedPrivilegeNames, true, "jcr:read");

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNotNull(deniedArray);
    assertEquals(1, deniedArray.length());
    Set<String> deniedPrivilegeNames = new HashSet<String>();
    for (int i=0; i < deniedArray.length(); i++) {
      deniedPrivilegeNames.add(deniedArray.getString(i));
View Full Code Here

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

    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>();
    for (int i=0; i < grantedArray2.length(); i++) {
      grantedPrivilegeNames2.add(grantedArray2.getString(i));
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.