Merged HEAD (5.2) to 5.2.N (5.2.1)

127445 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      127427 jkaabimofrad: RA-1052: Modified the upload API so that the failure of the async request to create a rendition wouldn't fail the upload.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@127475 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandra Leahu
2016-06-01 13:37:58 +00:00
parent 0817d77475
commit 0fe50bd9f0
2 changed files with 30 additions and 10 deletions

View File

@@ -536,23 +536,31 @@ public class RenditionsTest extends AbstractBaseApiTest
assertEquals(RenditionStatus.CREATED, rendition.getStatus());
*/
// -ve - currently we do not support multiple rendition requests on create
/*
* Per RA-1052, the failure of the async request to create a rendition
* should NOT fail the upload.
*/
// Currently we do not support multiple rendition requests on create
reqBody = MultiPartBuilder.create()
.setFileData(new FileData(fileName, file, MimetypeMap.MIMETYPE_PDF))
.setAutoRename(true)
.setRenditions(Arrays.asList(new String[]{"doclib,imgpreview"}))
.build();
post(getNodeChildrenUrl(folder_Id), userId, reqBody.getBody(), null, reqBody.getContentType(), 400);
post(getNodeChildrenUrl(folder_Id), userId, reqBody.getBody(), null, reqBody.getContentType(), 201);
// -ve
// Unknown rendition
reqBody = MultiPartBuilder.create()
.setFileData(new FileData(fileName, file, MimetypeMap.MIMETYPE_PDF))
.setAutoRename(true)
.setRenditions(Arrays.asList(new String[]{"unknown"}))
.build();
post(getNodeChildrenUrl(folder_Id), userId, reqBody.getBody(), null, reqBody.getContentType(), 404);
post(getNodeChildrenUrl(folder_Id), userId, reqBody.getBody(), null, reqBody.getContentType(), 201);
// -ve
// ThumbnailService is disabled
ThumbnailService thumbnailService = applicationContext.getBean("thumbnailService", ThumbnailService.class);
thumbnailService.setThumbnailsEnabled(false);
try
@@ -565,7 +573,7 @@ public class RenditionsTest extends AbstractBaseApiTest
.setRenditions(Arrays.asList(new String[]{"doclib"}))
.build();
post(getNodeChildrenUrl(folder_Id), userId, reqBody.getBody(), null, reqBody.getContentType(), 501);
post(getNodeChildrenUrl(folder_Id), userId, reqBody.getBody(), null, reqBody.getContentType(), 201);
}
finally
{