Examples of optString()


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

    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

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

    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

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

    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

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

    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

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

    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

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

    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

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

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

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

    JSONObject aceObject = jsonObject.optJSONObject(testUserId);
    assertNotNull(aceObject);
   
    assertEquals(0, aceObject.getInt("order"));

    String principalString = aceObject.optString("principal");
    assertEquals(testUserId, principalString);
   
    JSONArray grantedArray = aceObject.optJSONArray("granted");
    assertNotNull(grantedArray);
    assertEquals("jcr:read", grantedArray.getString(0));
View Full Code Here

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

    if (addGroupAce) {
      aceObject = jsonObject.optJSONObject(testGroupId);
      assertNotNull(aceObject);
     
      principalString = aceObject.optString("principal");
      assertEquals(testGroupId, principalString);

            assertEquals(1, aceObject.getInt("order"));

      grantedArray = aceObject.optJSONArray("granted");
View Full Code Here

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

        request.setResource(contentResource);

        queryPackagerServlet.doPost(request, response);

        final JSONObject actual = new JSONObject(response.getOutput().toString());
        assertEquals("success", actual.optString("status", "error"));
    }


    @Test
    public void testDoPost_preview() throws Exception {
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.