From e35223c7126a18193bec80335f668794f89f49c7 Mon Sep 17 00:00:00 2001 From: Jamal Kaabi-Mofrad Date: Tue, 10 May 2016 11:03:29 +0000 Subject: [PATCH] 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 --- .../alfresco/rest/api/tests/NodeApiTest.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java b/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java index 334e5a25da..eb3d6028f9 100644 --- a/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java +++ b/source/test-java/org/alfresco/rest/api/tests/NodeApiTest.java @@ -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 linkIds = Arrays.asList(n1Id, n2Id, n3Id); + List linkIds = Arrays.asList(n1Id, n2Id); Map 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 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()));