Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)

124819 jvonka: RA-896 - List Node Children filtering - additional fixes & tests, when filtering by isFile &/or isFolder


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126589 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-05-10 11:43:06 +00:00
parent 846f24ed47
commit 4fb66c3f2f
2 changed files with 87 additions and 45 deletions

View File

@@ -1737,6 +1737,14 @@ public class NodeApiTest extends AbstractBaseApiTest
folderAndFileIds.addAll(folderIds);
folderAndFileIds.addAll(fileIds);
List<String> notFileIds = new ArrayList<>(folderCnt+objCnt);
notFileIds.addAll(folderIds);
notFileIds.addAll(objIds);
List<String> notFolderIds = new ArrayList<>(fileCnt+objCnt);
notFolderIds.addAll(fileIds);
notFolderIds.addAll(objIds);
Paging paging = getPaging(0, Integer.MAX_VALUE);
// no filtering
@@ -1814,6 +1822,22 @@ public class NodeApiTest extends AbstractBaseApiTest
nodes = RestApiUtil.parseRestApiEntries(response.getJsonResponse(), Node.class);
checkNodeIds(nodes, objIds);
// filtering, via where clause - not files
params = new HashMap<>();
params.put("where", "(isFile=false)");
response = getAll(myChildrenUrl, user1, paging, params, 200);
nodes = RestApiUtil.parseRestApiEntries(response.getJsonResponse(), Node.class);
checkNodeIds(nodes, notFileIds);
// filtering, via where clause - not folders
params = new HashMap<>();
params.put("where", "(isFolder=false)");
response = getAll(myChildrenUrl, user1, paging, params, 200);
nodes = RestApiUtil.parseRestApiEntries(response.getJsonResponse(), Node.class);
checkNodeIds(nodes, notFolderIds);
// -ve - node cannot be both a file and a folder
params = new HashMap<>();
params.put("where", "(isFile=true AND isFolder=true)");