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:
Alan Davis
2016-03-11 21:39:56 +00:00
parent 98a4e139b4
commit 2fc7b70449

View File

@@ -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";
@@ -438,13 +442,21 @@ public class WebDAVMethodTest
{
// LOCK document.
lockMethod.executeImpl();
Thread.sleep(2000);
//wait for the lock to expire up to 5 seconds
int timeout = 5;
while( timeout > 0 && !lockMethod.lockInfo.isExpired())
{
Thread.sleep(1000);
timeout--;
}
// 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;