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

105374: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud)
      105132: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.3)
         104888: Merged DEV to V4.2-BUG-FIX (4.2.5)
            104492: MNT-10962: Versioning for cmis:document not working initially
               - Use default values in the content model for autoVersion.
               - Test to ensure that version properties for node created via CMIS are set wrt contentModel.
               - TCK is now run with autoVersion=false.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@105408 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-06-03 09:00:06 +00:00
parent e20f71ed3e
commit b98c2dc6b0
6 changed files with 37 additions and 6 deletions

View File

@@ -19,6 +19,12 @@
package org.alfresco.rest.api.tests;
import org.alfresco.opencmis.OpenCMISClientContext;
import org.alfresco.repo.dictionary.DictionaryDAO;
import org.alfresco.repo.dictionary.M2Aspect;
import org.alfresco.repo.dictionary.M2Model;
import org.alfresco.repo.dictionary.M2Property;
import org.alfresco.service.namespace.QName;
import org.springframework.context.ApplicationContext;
/**
* Base class for Chemistry OpenCMIS TCK tests.
@@ -35,4 +41,21 @@ public abstract class AbstractEnterpriseOpenCMISTCKTest extends EnterpriseTestAp
{
return TCKEnterpriseTestFixture.getInstance();
}
protected void overrideVersionableAspectProperties(ApplicationContext ctx)
{
final DictionaryDAO dictionaryDAO = (DictionaryDAO) ctx.getBean("dictionaryDAO");
dictionaryDAO.removeModel(QName.createQName("cm:contentmodel"));
M2Model contentModel = M2Model.createModel(getClass().getClassLoader().getResourceAsStream("alfresco/model/contentModel.xml"));
M2Aspect versionableAspect = contentModel.getAspect("cm:versionable");
M2Property prop = versionableAspect.getProperty("cm:initialVersion");
prop.setDefaultValue(Boolean.FALSE.toString());
prop = versionableAspect.getProperty("cm:autoVersion");
prop.setDefaultValue(Boolean.FALSE.toString());
prop = versionableAspect.getProperty("cm:autoVersionOnUpdateProps");
prop.setDefaultValue(Boolean.FALSE.toString());
dictionaryDAO.putModel(contentModel);
}
}