mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
64097: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (4.3.0.BF) 63991: Merged DEV to V4.2-BUG-FIX (4.2.2) 63740: ALF-20389: CMIS webservice gives cast problem - Now, only ContentStreamImpl extensions will be checked for mimetype. Also, unit test was added. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@64354 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
891a3ef8e4
commit
3214f17fe2
@ -54,7 +54,7 @@ public class AlfrescoCmisStreamInterceptor implements MethodInterceptor
|
||||
Object[] arguments = mi.getArguments();
|
||||
for (int i = 0; i < parameterTypes.length; i++)
|
||||
{
|
||||
if (parameterTypes[i].isAssignableFrom(ContentStreamImpl.class))
|
||||
if (arguments[i] instanceof ContentStreamImpl)
|
||||
{
|
||||
ContentStreamImpl contentStream = (ContentStreamImpl) arguments[i];
|
||||
if (contentStream != null)
|
||||
|
@ -78,9 +78,11 @@ import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
|
||||
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
|
||||
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
|
||||
import org.apache.chemistry.opencmis.commons.exceptions.CmisUpdateConflictException;
|
||||
import org.apache.chemistry.opencmis.commons.impl.dataobjects.CmisExtensionElementImpl;
|
||||
import org.apache.chemistry.opencmis.commons.impl.dataobjects.ContentStreamImpl;
|
||||
import org.apache.chemistry.opencmis.commons.impl.dataobjects.ExtensionDataImpl;
|
||||
import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl;
|
||||
import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIdImpl;
|
||||
import org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertyIntegerDefinitionImpl;
|
||||
@ -639,6 +641,37 @@ public class CMISTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
private static class TestContext
|
||||
{
|
||||
private String repositoryId = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user