mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged 5.1.N (5.1.1) to HEAD (5.1)
120777 aleahu: MNT-15480 : Intermittent failure WebDAVMethodTest.expiryLockTest() - Increased timeout git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@123629 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -43,6 +43,8 @@ import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.alfresco.util.GUID;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
@@ -79,6 +81,8 @@ public class WebDAVMethodTest
|
||||
private @Mock DeleteMethod deleteMethod;
|
||||
private @Mock UnlockMethod unlockMethod;
|
||||
|
||||
private static Log logger = LogFactory.getLog(WebDAVMethodTest.class);
|
||||
|
||||
public static final String TEST_RUN = System.currentTimeMillis()+"";
|
||||
public static final String TEST_TENANT_DOMAIN = TEST_RUN+".my.test";
|
||||
public static final String DEFAULT_ADMIN_PW = "admin";
|
||||
@@ -435,19 +439,27 @@ public class WebDAVMethodTest
|
||||
public Object execute() throws Throwable
|
||||
{
|
||||
try
|
||||
{
|
||||
// LOCK document.
|
||||
lockMethod.executeImpl();
|
||||
Thread.sleep(2000);
|
||||
{
|
||||
// LOCK document.
|
||||
lockMethod.executeImpl();
|
||||
|
||||
// LOCK against an expired lock.
|
||||
lockMethod.executeImpl();
|
||||
}
|
||||
catch (WebDAVServerException e)
|
||||
//wait for the lock to expire up to 5 seconds
|
||||
int timeout = 5;
|
||||
while( timeout > 0 && !lockMethod.lockInfo.isExpired())
|
||||
{
|
||||
Assert.fail("Document was not locked again, when lock has expired.");
|
||||
Thread.sleep(1000);
|
||||
timeout--;
|
||||
}
|
||||
return null;
|
||||
|
||||
// LOCK against an expired lock.
|
||||
lockMethod.executeImpl();
|
||||
}
|
||||
catch (WebDAVServerException e)
|
||||
{
|
||||
logger.debug(e);
|
||||
Assert.fail("Document was not locked again, when lock has expired.");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user