From 25d3a86f0b2612753d907002ef48874b7c75b16f Mon Sep 17 00:00:00 2001 From: Alexandra Leahu Date: Fri, 25 Mar 2016 13:13:42 +0000 Subject: [PATCH] Merged 5.0.N (5.0.4) to 5.1.N (5.1.2) 124465 aleahu: Merged V4.2-BUG-FIX (4.2.7) to 5.0.N (5.0.4) 124433 aleahu: Merged V4.2.6 (4.2.6) to V4.2-BUG-FIX (4.2.7) 124363 adragoi: MNT-15846 : The RenditionServiceIntegrationTest.testRenderPdfDocumentLongRunningCheckout fails on DB2 - wait thread to finish checkout git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@124491 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repo/lock/mem/AbstractLockStore.java | 2 ++ .../rendition/RenditionServiceIntegrationTest.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java b/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java index 97158681d9..95ece667c5 100644 --- a/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java +++ b/source/java/org/alfresco/repo/lock/mem/AbstractLockStore.java @@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentMap; import org.alfresco.repo.transaction.TransactionalResourceHelper; import org.alfresco.service.cmr.repository.NodeRef; +import org.alfresco.util.ParameterCheck; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.transaction.support.TransactionSynchronizationManager; @@ -44,6 +45,7 @@ public abstract class AbstractLockStore txMap = getTxMap(); if (txMap != null && txMap.containsKey(nodeRef)) diff --git a/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java b/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java index d1faffdcc6..510f065d39 100644 --- a/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java +++ b/source/test-java/org/alfresco/repo/rendition/RenditionServiceIntegrationTest.java @@ -647,6 +647,11 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest * @throws Exception */ protected void renderPdfDocumentLongRunningTest(AbstractNodeModifyingRunnable nodeModifyingRunnable) throws Exception + { + renderPdfDocumentLongRunningTest(nodeModifyingRunnable, false); + } + + protected void renderPdfDocumentLongRunningTest(AbstractNodeModifyingRunnable nodeModifyingRunnable, boolean joinNodeModifyingThread) throws Exception { this.setComplete(); this.endTransaction(); @@ -697,6 +702,11 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest // Give a moment for roll back of rendition and commit of node modification to occur Thread.sleep(3000); + if (joinNodeModifyingThread) + { + nodeModifyingThread.join(); + } + // Note that the node modification is retried on failure by RetryingTransactionHelper // and will always succeed after the rendition is complete, but due to the // sleep in AbstractNodeModifyingRunnable isModificationUnblocked will still @@ -732,7 +742,7 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest checkOutCheckInService.checkout(nodeWithDocContent); } }; - renderPdfDocumentLongRunningTest(new CheckoutRunnable(nodeWithDocContent)); + renderPdfDocumentLongRunningTest(new CheckoutRunnable(nodeWithDocContent), true); } finally {