01-29-2013 04:46 PM
01-30-2013 01:15 AM
01-30-2013 02:59 AM
/**
* Detailed test of get Parents
*/
public void testGetParents() throws Exception
{
createTestTree();
/**
* Get all parents for the root group ALFRESCO_ADMINISTRATORS groups which has no parents
*/
{
Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + ADMIN_GROUP + "/parents"), Status.STATUS_OK);
JSONObject top = new JSONObject(response.getContentAsString());
logger.debug(response.getContentAsString());
JSONArray data = top.getJSONArray("data");
// Top level group has no parents
assertTrue("top level group has no parents", data.length() == 0);
}
/**
* Get GROUP B Which should be a child of TESTROOT
*/
{
Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + TEST_GROUPB + "/parents"), Status.STATUS_OK);
JSONObject top = new JSONObject(response.getContentAsString());
logger.debug(response.getContentAsString());
JSONArray data = top.getJSONArray("data");
assertTrue(data.length() > 0);
}
/**
* Get GROUP D Which should be a child of GROUPB child of TESTROOT
*/
{
Response response = sendRequest(new GetRequest(URL_GROUPS + "/" + TEST_GROUPD + "/parents?level=ALL"), Status.STATUS_OK);
JSONObject top = new JSONObject(response.getContentAsString());
logger.debug(response.getContentAsString());
JSONArray data = top.getJSONArray("data");
assertTrue(data.length() >= 2);
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.