Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

93587: Merged 5.0.N (5.0.1) to HEAD-BUG-FIX (5.1/Cloud)
      93514: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.1)
         93316: Merged DEV to V4.2-BUG-FIX (4.2.5)
            93033 : MNT-13093 : Users cannot add Comments to any documents in Alfresco via Alfresco Mobile App.
               - Include subTypes of desired type to expectedTypes
            93140 : MNT-13093 : Users cannot add Comments to any documents in Alfresco via Alfresco Mobile App.
               - TypeConstraint is changed to check for subClass on demand. Test for the fix


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@94974 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-01-31 12:27:54 +00:00
parent 51d5d85846
commit 9762aeb94f
5 changed files with 131 additions and 63 deletions

View File

@@ -57,6 +57,7 @@ public class TestNodeComments extends EnterpriseTestApi
private NodeRef nodeRef3;
private NodeRef nodeRef4;
private NodeRef cmObjectNodeRef;
private NodeRef customTypeObject;
@Before
public void setup() throws Exception
@@ -132,6 +133,8 @@ public class TestNodeComments extends EnterpriseTestApi
nodes.add(nodeRef);
nodeRef = repoService.createCmObject(site1.getContainerNodeRef("documentLibrary"), "CM Object");
nodes.add(nodeRef);
nodeRef = repoService.createObjectOfCustomType(site1.getContainerNodeRef("documentLibrary"), "Custom type object", "{custom.model}sop");
nodes.add(nodeRef);
return null;
}
@@ -143,6 +146,7 @@ public class TestNodeComments extends EnterpriseTestApi
this.nodeRef3 = nodes.get(3);
this.nodeRef4 = nodes.get(4);
this.cmObjectNodeRef = nodes.get(5);
this.customTypeObject = nodes.get(6);
}
@Test
@@ -200,6 +204,20 @@ public class TestNodeComments extends EnterpriseTestApi
createdComments.put(ret.getId(), ret);
}
// test that it is possible to add comment to custom type node
commentsProxy.createNodeComment(customTypeObject.getId(), new Comment("Custom type node comment", "The Comment"));
try
{
// test that it is not possible to add comment to cm:object node
commentsProxy.createNodeComment(cmObjectNodeRef.getId(), new Comment("CM Object node comment", "The Comment"));
fail();
}
catch(PublicApiException e)
{
assertEquals(HttpStatus.SC_METHOD_NOT_ALLOWED, e.getHttpResponse().getStatusCode());
}
// get comments of the non-folder/non-document nodeRef
try
{