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

68108: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (4.3/Cloud)
      65761: MNT-10430 "CMIS: NPE getting mandatory aspects with browser binding"


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@68396 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-04-30 16:06:04 +00:00
parent 3f70a2c709
commit bb6f6e619e
2 changed files with 32 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import java.util.Set;
import org.alfresco.cmis.client.AlfrescoDocument;
import org.alfresco.cmis.client.AlfrescoFolder;
import org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl;
import org.alfresco.cmis.client.type.AlfrescoType;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMModel;
import org.alfresco.opencmis.CMISDispatcherRegistry.Binding;
@@ -73,6 +74,7 @@ import org.apache.chemistry.opencmis.client.api.FileableCmisObject;
import org.apache.chemistry.opencmis.client.api.Folder;
import org.apache.chemistry.opencmis.client.api.ItemIterable;
import org.apache.chemistry.opencmis.client.api.ObjectId;
import org.apache.chemistry.opencmis.client.api.ObjectType;
import org.apache.chemistry.opencmis.client.api.OperationContext;
import org.apache.chemistry.opencmis.client.api.Property;
import org.apache.chemistry.opencmis.client.api.Relationship;
@@ -1761,4 +1763,32 @@ public class TestCMIS extends EnterpriseTestApi
String content = writer.toString();
assertEquals("Ipsum and so on", content);
}
@Test
public void testMNT10430() throws Exception
{
final TestNetwork network1 = getTestFixture().getRandomNetwork();
String username = "user" + System.currentTimeMillis();
PersonInfo personInfo = new PersonInfo(username, username, username, "password", null, null,
null, null, null, null, null);
TestPerson person1 = network1.createUser(personInfo);
String person1Id = person1.getId();
publicApiClient.setRequestContext(new RequestContext(network1.getId(), person1Id));
CmisSession cmisSession = publicApiClient.createPublicApiCMISSession(Binding.browser, "1.1",
"org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");
ObjectType objectType = cmisSession.getTypeDefinition("D:my:maDoc");
// try and get the mandatory aspects
List<String> mandatoryAspects = ((AlfrescoType)objectType).getMandatoryAspects();
System.out.println("Mandatory Aspects");
for(String mandatoryAspect : mandatoryAspects)
{
System.out.println(mandatoryAspect);
}
assertEquals(1, mandatoryAspects.size());
assertEquals("P:cm:generalclassifiable", mandatoryAspects.get(0));
}
}