ACE-4513: Merged 5.0.N (5.0.3) to 5.1.N (5.1.1)

116327 amukha: Merged 5.0.2 (5.0.2.5) to 5.0.N (5.0.3)
      116326 amukha: MNT-15091: CLONE - 5.0.2 [Pentest 121015] ZIP extraction code execution
         - Fixed the test to use a classloader to load a test file, not the relative path.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@116331 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alex Mukha
2015-11-05 17:34:51 +00:00
parent 178ba54d18
commit e69303c33c

View File

@@ -23,11 +23,13 @@ import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.action.ActionImpl;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.transform.AbstractContentTransformerTest;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
@@ -50,6 +52,8 @@ import org.junit.Test;
*/
public class ImporterActionExecuterTest
{
private static final String FILE_NAME = "import-archive-test/SuspiciousPathsArchive.zip";
@Test
public void testImportArchiveWithSuspiciousPaths() throws IOException
{
@@ -58,8 +62,10 @@ public class ImporterActionExecuterTest
final NodeService nodeService = serviceRegistry.getNodeService();
final ContentService contentService = serviceRegistry.getContentService();
final RetryingTransactionHelper retryingTransactionHelper = serviceRegistry.getTransactionService().getRetryingTransactionHelper();
final File file = new File("./source/test-resources/import-archive-test/SuspiciousPathsArchive.zip");
URL url = AbstractContentTransformerTest.class.getClassLoader().getResource(FILE_NAME);
final File file = new File(url.getFile());
retryingTransactionHelper.doInTransaction(new RetryingTransactionCallback<Void>()
{