org.apache.jackrabbit.test.api.lock
Class AbstractLockTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jackrabbit.test.JUnitTest
              extended by org.apache.jackrabbit.test.AbstractJCRTest
                  extended by org.apache.jackrabbit.test.api.lock.AbstractLockTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
DeepLockTest, OpenScopedLockTest, SessionScopedLockTest

public abstract class AbstractLockTest
extends AbstractJCRTest

AbstractLockTest...


Field Summary
protected  javax.jcr.Node childNode
           
protected  javax.jcr.lock.Lock lock
           
protected  javax.jcr.Node lockedNode
           
protected  javax.jcr.lock.LockManager lockMgr
           
 
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, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testPath, testRoot, testRootNode, vf, workspaceName
 
Constructor Summary
AbstractLockTest()
           
 
Method Summary
protected  void assertLockable(javax.jcr.Node n)
           
protected static javax.jcr.lock.LockManager getLockManager(javax.jcr.Session session)
           
protected  String getLockOwner()
           
protected  long getTimeoutHint()
           
protected abstract  boolean isDeep()
           
protected abstract  boolean isSessionScoped()
           
protected  void setUp()
           
protected  void tearDown()
           
 void testGetLockOnChild()
           
 void testGetLockOnNewChild()
           
 void testGetSecondsRemaining()
          Test Lock.getSecondsRemaining()
 void testGetSecondsRemainingAfterUnlock()
          Test Lock.getSecondsRemaining()
 void testHoldsLockChild()
           
 void testHoldsLockNewChild()
           
 void testIsDeep()
          Test Lock.isDeep().
 void testIsLive()
          Test Lock.isLive().
 void testIsLockedChild()
           
 void testIsLockedNewChild()
           
 void testIsLockOwningSession()
          Test Lock.isLockOwningSession()
 void testIsSessionScoped()
          Test Lock.isSessionScoped()
 void testLockExpiration()
          Test expiration of the lock
 void testLockHoldingNode()
          Test Lock.getNode().
 void testLockVisibility()
          A locked node must also be locked if accessed by some other session.
 void testNodeHoldsLocked()
          Test LockManager.holdsLock(String) and Node.holdsLock().
 void testNodeIsLocked()
          Test LockManager.isLocked(String) and Node.isLocked().
 void testRefresh()
          Test Lock.refresh() on a released lock.
 void testRefreshNotLive()
          Test Lock.refresh() on a released lock.
 void testRemoveMixLockableFromLockedNode()
           
 void testUnlock()
          Test if Lock is properly released.
 void testUnlockByOtherSession()
          Test LockManager.unlock(String) for a session that is not lock owner.
 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getProperty, getProperty, getSize, isSupported, needsMixin, run
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
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, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lockMgr

protected javax.jcr.lock.LockManager lockMgr

lockedNode

protected javax.jcr.Node lockedNode

childNode

protected javax.jcr.Node childNode

lock

protected javax.jcr.lock.Lock lock
Constructor Detail

AbstractLockTest

public AbstractLockTest()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class AbstractJCRTest
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class AbstractJCRTest
Throws:
Exception

isSessionScoped

protected abstract boolean isSessionScoped()

isDeep

protected abstract boolean isDeep()

assertLockable

protected void assertLockable(javax.jcr.Node n)
                       throws javax.jcr.RepositoryException,
                              NotExecutableException
Throws:
javax.jcr.RepositoryException
NotExecutableException

getTimeoutHint

protected long getTimeoutHint()
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getLockOwner

protected String getLockOwner()
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getLockManager

protected static javax.jcr.lock.LockManager getLockManager(javax.jcr.Session session)
                                                    throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

testIsDeep

public void testIsDeep()
Test Lock.isDeep().


testIsLive

public void testIsLive()
                throws javax.jcr.RepositoryException
Test Lock.isLive().

Throws:
javax.jcr.RepositoryException

testRefresh

public void testRefresh()
                 throws javax.jcr.RepositoryException
Test Lock.refresh() on a released lock.

Throws:
Exception
javax.jcr.RepositoryException

testRefreshNotLive

public void testRefreshNotLive()
                        throws Exception
Test Lock.refresh() on a released lock.

Throws:
Exception

testLockHoldingNode

public void testLockHoldingNode()
                         throws javax.jcr.RepositoryException
Test Lock.getNode().

Throws:
javax.jcr.RepositoryException - If an execption occurs.

testNodeIsLocked

public void testNodeIsLocked()
                      throws javax.jcr.RepositoryException
Test LockManager.isLocked(String) and Node.isLocked().

Throws:
javax.jcr.RepositoryException - If an execption occurs.

testNodeHoldsLocked

public void testNodeHoldsLocked()
                         throws javax.jcr.RepositoryException
Test LockManager.holdsLock(String) and Node.holdsLock().

Throws:
javax.jcr.RepositoryException - If an execption occurs.

testLockVisibility

public void testLockVisibility()
                        throws javax.jcr.RepositoryException
A locked node must also be locked if accessed by some other session.

Throws:
javax.jcr.RepositoryException

testIsSessionScoped

public void testIsSessionScoped()
Test Lock.isSessionScoped()


testIsLockOwningSession

public void testIsLockOwningSession()
                             throws javax.jcr.RepositoryException
Test Lock.isLockOwningSession()

Throws:
javax.jcr.RepositoryException - If an execption occurs.

testGetSecondsRemaining

public void testGetSecondsRemaining()
                             throws javax.jcr.RepositoryException
Test Lock.getSecondsRemaining()

Throws:
javax.jcr.RepositoryException

testGetSecondsRemainingAfterUnlock

public void testGetSecondsRemainingAfterUnlock()
                                        throws javax.jcr.RepositoryException
Test Lock.getSecondsRemaining()

Throws:
javax.jcr.RepositoryException

testLockExpiration

public void testLockExpiration()
                        throws javax.jcr.RepositoryException,
                               NotExecutableException
Test expiration of the lock

Throws:
javax.jcr.RepositoryException
NotExecutableException

testUnlock

public void testUnlock()
                throws javax.jcr.RepositoryException
Test if Lock is properly released.

Throws:
javax.jcr.RepositoryException

testUnlockByOtherSession

public void testUnlockByOtherSession()
                              throws javax.jcr.RepositoryException,
                                     NotExecutableException
Test LockManager.unlock(String) for a session that is not lock owner.

Throws:
javax.jcr.RepositoryException
NotExecutableException

testIsLockedChild

public void testIsLockedChild()
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

testIsLockedNewChild

public void testIsLockedNewChild()
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

testHoldsLockChild

public void testHoldsLockChild()
                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

testHoldsLockNewChild

public void testHoldsLockNewChild()
                           throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

testGetLockOnChild

public void testGetLockOnChild()
                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

testGetLockOnNewChild

public void testGetLockOnNewChild()
                           throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

testRemoveMixLockableFromLockedNode

public void testRemoveMixLockableFromLockedNode()
                                         throws javax.jcr.RepositoryException,
                                                NotExecutableException
Throws:
javax.jcr.RepositoryException
NotExecutableException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.