From 1233beb56ecc5144547c798e098d0e79c0551a4f Mon Sep 17 00:00:00 2001 From: Constantin Popa Date: Fri, 20 Jan 2017 12:56:40 +0000 Subject: [PATCH] Merged WEBAPP-API (5.2.1) to 5.2.N (5.2.1) 134647 cpopa: APPSREPO-105 : Add an API to download multiple file/folders as a zip - Shy attempt to fix the TestCustomModelExport.testCreateDownload test git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@134672 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/dictionary/CMMDownloadTestUtil.java | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/source/test-java/org/alfresco/repo/dictionary/CMMDownloadTestUtil.java b/source/test-java/org/alfresco/repo/dictionary/CMMDownloadTestUtil.java index 1e93e5c967..badd6bd0e9 100644 --- a/source/test-java/org/alfresco/repo/dictionary/CMMDownloadTestUtil.java +++ b/source/test-java/org/alfresco/repo/dictionary/CMMDownloadTestUtil.java @@ -27,7 +27,7 @@ package org.alfresco.repo.dictionary; import static org.junit.Assert.assertTrue; - + import java.io.File; import java.io.Serializable; import java.util.Collection; @@ -35,9 +35,11 @@ import java.util.Collections; import java.util.List; import java.util.Set; import java.util.TreeSet; - + import org.alfresco.model.ContentModel; import org.alfresco.repo.content.MimetypeMap; +import org.alfresco.repo.security.authentication.AuthenticationUtil; +import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; import org.alfresco.repo.transaction.RetryingTransactionHelper; import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; import org.alfresco.service.cmr.download.DownloadService; @@ -271,15 +273,23 @@ public class CMMDownloadTestUtil return null; } - public DownloadStatus getDownloadStatus(final NodeRef downloadNode) - { - return transactionHelper.doInTransaction(new RetryingTransactionCallback() - { - @Override - public DownloadStatus execute() throws Throwable - { - return downloadService.getDownloadStatus(downloadNode); - } - }); + public DownloadStatus getDownloadStatus(final NodeRef downloadNode) + { + return AuthenticationUtil.runAsSystem(new RunAsWork() + { + @Override + public DownloadStatus doWork() throws Exception + { + return transactionHelper.doInTransaction(new RetryingTransactionCallback() + { + @Override + public DownloadStatus execute() throws Throwable + { + return downloadService.getDownloadStatus(downloadNode); + } + }); + } + }); + } }