Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.UsernamePasswordCredentials


        //1. create an initial set of privileges
    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair("principalId", testUserId));
    postParams.add(new NameValuePair("privilege@jcr:all", "granted"));
   
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    postParams = new ArrayList<NameValuePair>();
View Full Code Here


    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair("newPwd", "testNewPwd"));
    postParams.add(new NameValuePair("newPwdConfirm", "testNewPwd"));
   
    Credentials creds = new UsernamePasswordCredentials(testUserId, "testPwd");
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
  }
View Full Code Here

        //1. create an initial set of privileges
    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair("principalId", testUserId));
    postParams.add(new NameValuePair("privilege@jcr:write", "granted"));
   
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    postParams = new ArrayList<NameValuePair>();
View Full Code Here

        //1. create an initial set of privileges
    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair("principalId", testUserId));
    postParams.add(new NameValuePair("privilege@jcr:all", "granted"));
   
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    postParams = new ArrayList<NameValuePair>();
View Full Code Here

        //1. create an initial set of privileges
    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair("principalId", testUserId));
    postParams.add(new NameValuePair("privilege@jcr:all", "granted"));
   
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    postParams = new ArrayList<NameValuePair>();
View Full Code Here

        //1. create an initial set of privileges
    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair("principalId", testUserId));
    postParams.add(new NameValuePair("privilege@jcr:write", "granted"));
   
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    postParams = new ArrayList<NameValuePair>();
View Full Code Here

        //1. create an initial set of privileges
    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair("principalId", testUserId));
    postParams.add(new NameValuePair("privilege@jcr:modifyProperties", "granted"));
   
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    H.assertAuthenticatedPostStatus(creds, postUrl, HttpServletResponse.SC_OK, postParams, null);
   
    postParams = new ArrayList<NameValuePair>();
View Full Code Here

    postParams.add(new NameValuePair("marker", testGroupId));
    assertAuthenticatedAdminPostStatus(postUrl, HttpServletResponse.SC_OK, postParams, null);

    //fetch the group profile json to verify the settings
    String getUrl = HTTP_BASE_URL + "/system/userManager/group/" + testGroupId + ".json";
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    String json = getAuthenticatedContent(creds, getUrl, CONTENT_TYPE_JSON, null, HttpServletResponse.SC_OK);
    assertNotNull(json);
    JSONObject jsonObj = new JSONObject(json);
    assertEquals(testGroupId, jsonObj.getString("marker"));
  }
View Full Code Here

    postParams.add(new NameValuePair("url", "http://www.apache.org"));
    assertAuthenticatedAdminPostStatus(postUrl, HttpServletResponse.SC_OK, postParams, null);

    //fetch the group profile json to verify the settings
    String getUrl = HTTP_BASE_URL + "/system/userManager/group/" + testGroupId + ".json";
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    String json = getAuthenticatedContent(creds, getUrl, CONTENT_TYPE_JSON, null, HttpServletResponse.SC_OK);
    assertNotNull(json);
    JSONObject jsonObj = new JSONObject(json);
    assertEquals(testGroupId, jsonObj.getString("marker"));
    assertEquals("My Test Group", jsonObj.getString("displayName"));
View Full Code Here

    testGroupId = "testGroup" + random.nextInt();
    List<NameValuePair> postParams = new ArrayList<NameValuePair>();
    postParams.add(new NameValuePair(":name", testGroupId));
    postParams.add(new NameValuePair("marker", testGroupId));
    Credentials creds = new UsernamePasswordCredentials("admin", "admin");
    String json = getAuthenticatedPostContent(creds, postUrl, CONTENT_TYPE_JSON, postParams, HttpServletResponse.SC_OK);

    //make sure the json response can be parsed as a JSON object
    JSONObject jsonObj = new JSONObject(json);
    assertNotNull(jsonObj);
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.UsernamePasswordCredentials

Copyright © 2018 www.massapicom. 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.