code.onehippo.org is currently readonly. We are migrating to code.bloomreach.com, please continue working there on Monday 14/12. See: https://docs.bloomreach.com/display/engineering/GitLab

Commit 13719c3a authored by Ard Schrijvers's avatar Ard Schrijvers

REPO-1668 use the correct session because anonymous user is not allowed to...

REPO-1668 use the correct session because anonymous user is not allowed to write the setTimeout properties
parent 57e23fa8
/*
* Copyright 2012-2013 Hippo B.V. (http://www.onehippo.com)
* Copyright 2012-2017 Hippo B.V. (http://www.onehippo.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -18,7 +18,6 @@ package org.onehippo.repository.locking;
import javax.jcr.Node;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import javax.jcr.lock.Lock;
import javax.jcr.lock.LockException;
import javax.jcr.lock.LockManager;
......@@ -100,10 +99,10 @@ public class LockTest extends RepositoryTestCase {
// but the lock is not released by jackrabbit internally
LockManagerDecorator.unwrap(lockManager).getLock("/test").refresh();
Thread.sleep(1001l);
final Session anonSession = session.getRepository().login();
final Session anonSession = session.getRepository().login(CREDENTIALS);
final LockManager anonLockManager = anonSession.getWorkspace().getLockManager();
anonLockManager.lock("/test", false, false, Long.MAX_VALUE, null);
anonLockManager.isLocked("/test");
assertTrue(anonLockManager.isLocked("/test"));
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment