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
LockTest
contains the test cases for the lock support in the JCR specification.testroot
must allow child nodes of typenodetype
nodetype
nodetype which is lockable or allows to add mix:lockable. The node must also allow child nodes with the same node type as itself.nodename1
name 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 void
testAddRemoveLockToken()
Test lock token functionalityvoid
testCheckedIn()
Test if it is possible to lock and unlock a checked-in node.void
testCheckedInUnlock()
Tests if a locked, checked-in node can be unlockedvoid
testGetLock()
Test getLockvoid
testGetLockOwner()
Test if getLockOwner() returns the same value as returned by Session.getUserId at the time that the lock was placedvoid
testGetLockOwnerProperty()
Test if getLockOwner() returns the same value as returned by Session.getUserId at the time that the lock was placedvoid
testGetNode()
Test to get the lock holding node of a nodevoid
testIsDeep()
Test Lock.isDeep()void
testIsSessionScoped()
Test Lock.isSessionScoped()void
testLockTransfer()
Test locks may be transferred to other sessionvoid
testLogout()
Test locks are released when session logs outvoid
testMoveLocked()
Tests if move preserves lock state (JIRA issue JCR-207).void
testNodeLocked()
Test session scope: other session may not access nodes that are locked.void
testOpenScopedLocks()
Test open-scoped locksvoid
testParentChildDeepLock()
Test parent/child lockvoid
testParentChildLock()
Test parent/child lockvoid
testRefresh()
Test refreshvoid
testRefreshNotLive()
Test refreshvoid
testReorder()
Tests if locks are maintained when child nodes are reorderedvoid
testReorder2()
Tests if locks are maintained when child nodes are reorderedvoid
testShallowLock()
Test if a shallow lock does not lock the child nodes of the locked node.void
testUnlockSameNameSibling()
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 Exception
Test lock token functionality- Throws:
Exception
-
testNodeLocked
public void testNodeLocked() throws Exception
Test session scope: other session may not access nodes that are locked.- Throws:
Exception
-
testGetNode
public void testGetNode() throws Exception
Test to get the lock holding node of a node- Throws:
Exception
-
testGetLockOwnerProperty
public void testGetLockOwnerProperty() throws Exception
Test 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 Exception
Test 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 Exception
Test if a shallow lock does not lock the child nodes of the locked node.- Throws:
Exception
-
testCheckedIn
public void testCheckedIn() throws NotExecutableException, RepositoryException
Test if it is possible to lock and unlock a checked-in node.
-
testParentChildLock
public void testParentChildLock() throws Exception
Test parent/child lock- Throws:
Exception
-
testParentChildDeepLock
public void testParentChildDeepLock() throws Exception
Test parent/child lock- Throws:
Exception
-
testIsDeep
public void testIsDeep() throws RepositoryException, NotExecutableException
Test Lock.isDeep()
-
testIsSessionScoped
public void testIsSessionScoped() throws RepositoryException, NotExecutableException
Test Lock.isSessionScoped()
-
testLogout
public void testLogout() throws Exception
Test locks are released when session logs out- Throws:
Exception
-
testLockTransfer
public void testLockTransfer() throws Exception
Test locks may be transferred to other session- Throws:
Exception
-
testOpenScopedLocks
public void testOpenScopedLocks() throws Exception
Test open-scoped locks- Throws:
Exception
-
testCheckedInUnlock
public void testCheckedInUnlock() throws Exception
Tests if a locked, checked-in node can be unlocked- Throws:
Exception
-
testReorder
public void testReorder() throws Exception
Tests if locks are maintained when child nodes are reordered- Throws:
Exception
-
testReorder2
public void testReorder2() throws Exception
Tests if locks are maintained when child nodes are reordered- Throws:
Exception
-
testMoveLocked
public void testMoveLocked() throws Exception
Tests 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, NotExecutableException
Tests if unlocking the first of two locked same-name sibling nodes does not unlock the second (JIRA issue JCR-284).
-
-