Search in sources :

Example 1 with ExtensionDataImpl

use of org.apache.chemistry.opencmis.commons.impl.dataobjects.ExtensionDataImpl in project alfresco-repository by Alfresco.

the class CMISTest method testGetRepositoryInfos.

/**
 * ALF-20389 Test Alfresco cmis stream interceptor that checks content stream for mimetype. Only ContentStreamImpl extensions should take palace.
 */
@Test
public void testGetRepositoryInfos() {
    boolean cmisEx = false;
    List<RepositoryInfo> infoDataList = null;
    try {
        infoDataList = withCmisService(new CmisServiceCallback<List<RepositoryInfo>>() {

            @Override
            public List<RepositoryInfo> execute(CmisService cmisService) {
                ExtensionDataImpl result = new ExtensionDataImpl();
                List<CmisExtensionElement> extensions = new ArrayList<CmisExtensionElement>();
                result.setExtensions(extensions);
                return cmisService.getRepositoryInfos(result);
            }
        });
    } catch (CmisRuntimeException e) {
        cmisEx = true;
    }
    assertNotNull(cmisEx ? "CmisRuntimeException was thrown. Please, take a look on ALF-20389" : "No CMIS repository information was retrieved", infoDataList);
}
Also used : CmisExtensionElement(org.apache.chemistry.opencmis.commons.data.CmisExtensionElement) CmisService(org.apache.chemistry.opencmis.commons.server.CmisService) CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) RepositoryInfo(org.apache.chemistry.opencmis.commons.data.RepositoryInfo) ArrayList(java.util.ArrayList) ExtensionDataImpl(org.apache.chemistry.opencmis.commons.impl.dataobjects.ExtensionDataImpl) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 VersionableAspectTest (org.alfresco.repo.version.VersionableAspectTest)1 CmisExtensionElement (org.apache.chemistry.opencmis.commons.data.CmisExtensionElement)1 RepositoryInfo (org.apache.chemistry.opencmis.commons.data.RepositoryInfo)1 CmisRuntimeException (org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException)1 ExtensionDataImpl (org.apache.chemistry.opencmis.commons.impl.dataobjects.ExtensionDataImpl)1 CmisService (org.apache.chemistry.opencmis.commons.server.CmisService)1 Test (org.junit.Test)1