Class LockTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.lock.LockTest
-
- All Implemented Interfaces:
junit.framework.Test
public class LockTest extends AbstractJCRTest
LockTestcontains the test cases for the lock support in the JCR specification.testrootmust allow child nodes of typenodetypenodetypenodetype which is lockable or allows to add mix:lockable. The node must also allow child nodes with the same node type as itself.nodename1name of a lockable child node of typenodetype.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTest
isReadOnly, jcrBaseVersion, jcrCopiedFrom, jcrCreated, jcrFrozenNode, jcrFrozenUuid, jcrIsCheckedOut, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixShareable, mixSimpleVersionable, mixTitle, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntActivity, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testNodeTypeTestRoot, testPath, testRoot, testRootNode, vf, workspaceName
-
-
Constructor Summary
Constructors Constructor Description LockTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestAddRemoveLockToken()Test lock token functionalityvoidtestCheckedIn()Test if it is possible to lock and unlock a checked-in node.voidtestCheckedInUnlock()Tests if a locked, checked-in node can be unlockedvoidtestGetLock()Test getLockvoidtestGetLockOwner()Test if getLockOwner() returns the same value as returned by Session.getUserId at the time that the lock was placedvoidtestGetLockOwnerProperty()Test if getLockOwner() returns the same value as returned by Session.getUserId at the time that the lock was placedvoidtestGetNode()Test to get the lock holding node of a nodevoidtestIsDeep()Test Lock.isDeep()voidtestIsSessionScoped()Test Lock.isSessionScoped()voidtestLockTransfer()Test locks may be transferred to other sessionvoidtestLogout()Test locks are released when session logs outvoidtestMoveLocked()Tests if move preserves lock state (JIRA issue JCR-207).voidtestNodeLocked()Test session scope: other session may not access nodes that are locked.voidtestOpenScopedLocks()Test open-scoped locksvoidtestParentChildDeepLock()Test parent/child lockvoidtestParentChildLock()Test parent/child lockvoidtestRefresh()Test refreshvoidtestRefreshNotLive()Test refreshvoidtestReorder()Tests if locks are maintained when child nodes are reorderedvoidtestReorder2()Tests if locks are maintained when child nodes are reorderedvoidtestShallowLock()Test if a shallow lock does not lock the child nodes of the locked node.voidtestUnlockSameNameSibling()Tests if unlocking the first of two locked same-name sibling nodes does not unlock the second (JIRA issue JCR-284).-
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureLockingSupported, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getPrefix, getProperty, getProperty, getQualifiedName, getSize, isSupported, needsMixin, run, setUp, tearDown
-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, runBare, runTest, setName, toString
-
-
-
-
Method Detail
-
testAddRemoveLockToken
public void testAddRemoveLockToken() throws ExceptionTest lock token functionality- Throws:
Exception
-
testNodeLocked
public void testNodeLocked() throws ExceptionTest session scope: other session may not access nodes that are locked.- Throws:
Exception
-
testGetNode
public void testGetNode() throws ExceptionTest to get the lock holding node of a node- Throws:
Exception
-
testGetLockOwnerProperty
public void testGetLockOwnerProperty() throws ExceptionTest if getLockOwner() returns the same value as returned by Session.getUserId at the time that the lock was placed- Throws:
Exception
-
testGetLockOwner
public void testGetLockOwner() throws ExceptionTest if getLockOwner() returns the same value as returned by Session.getUserId at the time that the lock was placed- Throws:
Exception
-
testShallowLock
public void testShallowLock() throws ExceptionTest if a shallow lock does not lock the child nodes of the locked node.- Throws:
Exception
-
testCheckedIn
public void testCheckedIn() throws NotExecutableException, RepositoryExceptionTest if it is possible to lock and unlock a checked-in node.
-
testParentChildLock
public void testParentChildLock() throws ExceptionTest parent/child lock- Throws:
Exception
-
testParentChildDeepLock
public void testParentChildDeepLock() throws ExceptionTest parent/child lock- Throws:
Exception
-
testIsDeep
public void testIsDeep() throws RepositoryException, NotExecutableExceptionTest Lock.isDeep()
-
testIsSessionScoped
public void testIsSessionScoped() throws RepositoryException, NotExecutableExceptionTest Lock.isSessionScoped()
-
testLogout
public void testLogout() throws ExceptionTest locks are released when session logs out- Throws:
Exception
-
testLockTransfer
public void testLockTransfer() throws ExceptionTest locks may be transferred to other session- Throws:
Exception
-
testOpenScopedLocks
public void testOpenScopedLocks() throws ExceptionTest open-scoped locks- Throws:
Exception
-
testCheckedInUnlock
public void testCheckedInUnlock() throws ExceptionTests if a locked, checked-in node can be unlocked- Throws:
Exception
-
testReorder
public void testReorder() throws ExceptionTests if locks are maintained when child nodes are reordered- Throws:
Exception
-
testReorder2
public void testReorder2() throws ExceptionTests if locks are maintained when child nodes are reordered- Throws:
Exception
-
testMoveLocked
public void testMoveLocked() throws ExceptionTests if move preserves lock state (JIRA issue JCR-207). A node that has been locked must still appear locked when it has been moved or renamed, regardless whether the changes have already been made persistent.- Throws:
Exception
-
testUnlockSameNameSibling
public void testUnlockSameNameSibling() throws RepositoryException, NotExecutableExceptionTests if unlocking the first of two locked same-name sibling nodes does not unlock the second (JIRA issue JCR-284).
-
-