Examples of optJSONArray()


Examples of net.sf.json.JSONObject.optJSONArray()

        try
        {
            JSONObject obj = inRequest.optJSONObject("exclude");
            if (obj != null)
            {
                JSONArray array = obj.optJSONArray("ids");
                if (array != null)
                {
                    List<Long> ids = new ArrayList<Long>();
                    for (int i = 0; i < array.size(); i++)
                    {
View Full Code Here

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

    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    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:write");

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNull(deniedArray);

    JSONObject aceObject2 = jsonObject.optJSONObject(testUserId2);
    assertNotNull(aceObject2);
View Full Code Here

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

    assertNotNull(aceObject2);

    String principalString2 = aceObject2.optString("principal");
    assertEquals(testUserId2, principalString2);
   
    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

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

      grantedPrivilegeNames2.add(grantedArray2.getString(i));
    }
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:write");
    H.assertPrivilege(grantedPrivilegeNames2, true, "jcr:lockManagement");

    JSONArray deniedArray2 = aceObject2.optJSONArray("denied");
    assertNull(deniedArray2);
 
  }

  /**
 
View Full Code Here

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

    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    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:write");

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNull(deniedArray);
  }
 
  /**
   * Test for SLING-2600, Effective ACL servlet returns incorrect information
View Full Code Here

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

    assertNotNull(aceObject);

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    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:all");

    JSONArray deniedArray = aceObject.optJSONArray("denied");
    assertNull(deniedArray);
  }

  /**
   * Test for SLING-2600, Effective ACL servlet returns incorrect information
View Full Code Here

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

    assertNotNull(aceObject);

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