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

122184 jvonka: Nodes (FileFolder) API - remove test workaround (based on fix for ACE-5114)
   - re: list children nodeType filtering - exact match with no sub-types - if super-type does not exist
   - for example: where=(nodeType='cm:link includeSubTypes')
   RA-811, ACE-5114


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126460 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jamal Kaabi-Mofrad
2016-05-10 11:03:29 +00:00
parent 0bf34f2694
commit e35223c712

View File

@@ -1486,17 +1486,7 @@ public class NodeApiTest extends AbstractBaseApiTest
// filtering, via where clause (nodeType + optionally including sub-types)
// note: subtle issue - in order to filter by "cm:link" the qname must have been created in the DB (in a write txn)
// otherwise query will not match a missing qname (hmm). Workaround here by forcing the create of an explicit "cm:link".
// create link (dangling here)
nodeName = "link 3";
nodeType = "cm:link";
nodeResp = createNode(user1, f2Id, nodeName, nodeType, props);
String n3Id = nodeResp.getId();
List<String> linkIds = Arrays.asList(n1Id, n2Id, n3Id);
List<String> linkIds = Arrays.asList(n1Id, n2Id);
Map<String, String> params = new HashMap<>();
params.put("where", "(nodeType='cm:link')");
@@ -1505,7 +1495,7 @@ public class NodeApiTest extends AbstractBaseApiTest
response = getAll(getChildrenUrl(f2Id), user1, paging, params, 200);
List<Node> nodes = jacksonUtil.parseEntries(response.getJsonResponse(), Node.class);
assertEquals(1, nodes.size());
assertEquals(0, nodes.size());
// filter by including sub-types - note: includesubtypes is case-insensitive
@@ -1516,7 +1506,7 @@ public class NodeApiTest extends AbstractBaseApiTest
response = getAll(getChildrenUrl(f2Id), user1, paging, params, 200);
nodes = jacksonUtil.parseEntries(response.getJsonResponse(), Node.class);
assertEquals(3, nodes.size());
assertEquals(linkIds.size(), nodes.size());
assertTrue(linkIds.contains(nodes.get(0).getId()));
assertTrue(linkIds.contains(nodes.get(1).getId()));
@@ -1527,7 +1517,7 @@ public class NodeApiTest extends AbstractBaseApiTest
response = getAll(getChildrenUrl(f2Id), user1, paging, params, 200);
nodes = jacksonUtil.parseEntries(response.getJsonResponse(), Node.class);
assertEquals(3, nodes.size());
assertEquals(linkIds.size(), nodes.size());
assertTrue(linkIds.contains(nodes.get(0).getId()));
assertTrue(linkIds.contains(nodes.get(1).getId()));