mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
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
This commit is contained in:
@@ -24,6 +24,7 @@ import java.util.concurrent.ConcurrentMap;
|
|||||||
|
|
||||||
import org.alfresco.repo.transaction.TransactionalResourceHelper;
|
import org.alfresco.repo.transaction.TransactionalResourceHelper;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
|
import org.alfresco.util.ParameterCheck;
|
||||||
import org.springframework.dao.ConcurrencyFailureException;
|
import org.springframework.dao.ConcurrencyFailureException;
|
||||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||||
|
|
||||||
@@ -44,6 +45,7 @@ public abstract class AbstractLockStore<T extends ConcurrentMap<NodeRef, LockSta
|
|||||||
@Override
|
@Override
|
||||||
public LockState get(NodeRef nodeRef)
|
public LockState get(NodeRef nodeRef)
|
||||||
{
|
{
|
||||||
|
ParameterCheck.mandatory("nodeRef", nodeRef);
|
||||||
LockState lockState;
|
LockState lockState;
|
||||||
Map<NodeRef, LockState> txMap = getTxMap();
|
Map<NodeRef, LockState> txMap = getTxMap();
|
||||||
if (txMap != null && txMap.containsKey(nodeRef))
|
if (txMap != null && txMap.containsKey(nodeRef))
|
||||||
|
@@ -647,6 +647,11 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
protected void renderPdfDocumentLongRunningTest(AbstractNodeModifyingRunnable nodeModifyingRunnable) throws Exception
|
protected void renderPdfDocumentLongRunningTest(AbstractNodeModifyingRunnable nodeModifyingRunnable) throws Exception
|
||||||
|
{
|
||||||
|
renderPdfDocumentLongRunningTest(nodeModifyingRunnable, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void renderPdfDocumentLongRunningTest(AbstractNodeModifyingRunnable nodeModifyingRunnable, boolean joinNodeModifyingThread) throws Exception
|
||||||
{
|
{
|
||||||
this.setComplete();
|
this.setComplete();
|
||||||
this.endTransaction();
|
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
|
// Give a moment for roll back of rendition and commit of node modification to occur
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
|
|
||||||
|
if (joinNodeModifyingThread)
|
||||||
|
{
|
||||||
|
nodeModifyingThread.join();
|
||||||
|
}
|
||||||
|
|
||||||
// Note that the node modification is retried on failure by RetryingTransactionHelper
|
// Note that the node modification is retried on failure by RetryingTransactionHelper
|
||||||
// and will always succeed after the rendition is complete, but due to the
|
// and will always succeed after the rendition is complete, but due to the
|
||||||
// sleep in AbstractNodeModifyingRunnable isModificationUnblocked will still
|
// sleep in AbstractNodeModifyingRunnable isModificationUnblocked will still
|
||||||
@@ -732,7 +742,7 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
|
|||||||
checkOutCheckInService.checkout(nodeWithDocContent);
|
checkOutCheckInService.checkout(nodeWithDocContent);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
renderPdfDocumentLongRunningTest(new CheckoutRunnable(nodeWithDocContent));
|
renderPdfDocumentLongRunningTest(new CheckoutRunnable(nodeWithDocContent), true);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user