Class VersionTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.version.AbstractVersionTest
-
- org.apache.jackrabbit.test.api.version.VersionTest
-
- All Implemented Interfaces:
junit.framework.Test
public class VersionTest extends AbstractVersionTest
VersionTestcovers tests related to the methods of theVersionclass.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.test.api.version.AbstractVersionTest
nonVersionableNode, nonVersionableNodeType, propertyValue, versionableNode, versionableNodeType
-
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 VersionTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()protected voidtearDown()voidtestAccept()Tests ifVersion.accept(ItemVisitor)accepts a ItemVisitor and if the right Node is provided to that visitor.voidtestAddMixin()Tests ifVersion.addMixin(String)throws aConstraintViolationExceptionvoidtestAddNode()Tests ifVersion.addNode(String)andVersion.addNode(String, String)throw aConstraintViolationExceptionvoidtestCanAddMixin()Tests ifVersion.canAddMixin(String)returnsfalsevoidtestCancelMerge()Tests ifVersion.cancelMerge(Version)throws anUnsupportedRepositoryOperationExceptionvoidtestCancelMergeJcr2()Tests ifVersion.cancelMerge(Version)throws anUnsupportedRepositoryOperationExceptionvoidtestCheckin()Tests ifVersion.checkin()throws anUnsupportedRepositoryOperationExceptionvoidtestCheckinJcr2()Tests ifVersion.checkin()throws anUnsupportedRepositoryOperationExceptionvoidtestCheckout()Tests ifVersion.checkout()throws anUnsupportedRepositoryOperationExceptionvoidtestCheckoutJcr2()Tests ifVersion.checkout()throws anUnsupportedRepositoryOperationExceptionvoidtestDoneMerge()Tests ifVersion.doneMerge(Version)throws anUnsupportedRepositoryOperationExceptionvoidtestDoneMergeJcr2()Tests ifVersion.doneMerge(Version)throws anUnsupportedRepositoryOperationExceptionvoidtestFrozenUUID()Tests if the jcr:frozenUuid property has the correct typevoidtestGetAncestor()Tests ifVersion.getAncestor(int)returns the right ancestorvoidtestGetBaseVersion()Tests ifVersion.getBaseVersion()throws anUnsupportedRepositoryOperationExceptionvoidtestGetBaseVersionJcr2()Tests ifVersion.getBaseVersion()throws anUnsupportedRepositoryOperationExceptionvoidtestGetCorrespondingNodePath()Tests ifVersion.getCorrespondingNodePath(String)returns the right pathvoidtestGetDepth()Tests ifVersion.getDepth()returns the right depthvoidtestGetIndex()Tests ifVersion.getIndex()returns the right indexvoidtestGetLock()Tests ifVersion.getLock()throws aLockExceptionvoidtestGetLockJcr2()Tests ifVersion.getLock()throws aLockExceptionvoidtestGetMixinNodeTypes()Tests ifVersion.getMixinNodeTypes()does not return null.voidtestGetName()Tests ifVersion.getName()returns the right namevoidtestGetNode()Tests ifVersion.getNode(String)returns the right child NodevoidtestGetNodes()Tests ifVersion.getNodes()andVersion.getNodes(String)returns the right child NodevoidtestGetParent()Tests ifVersion.getParent()returns the right parent NodevoidtestGetPath()Tests ifVersion.getPath()returns the right pathvoidtestGetPrimaryItem()Tests ifVersion.getPrimaryItem()throws aItemNotFoundExceptionvoidtestGetPrimaryNodeType()Tests ifVersion.getPrimaryNodeType()returns the right primary node typent:versionvoidtestGetProperties()Tests ifVersion.getProperties()andVersion.getProperties(String)return the right propertyvoidtestGetProperty()Tests ifVersion.getProperty(String)returns the right propertyvoidtestGetSession()Tests ifVersion.getSession()returns the right sessionvoidtestGetUUID()Tests ifVersion.getUUID()returns the right UUIDvoidtestGetVersionHistory()Tests ifVersion.getVersionHistory()throws anUnsupportedRepositoryOperationExceptionvoidtestGetVersionHistoryJcr2()Tests ifVersion.getVersionHistory()throws anUnsupportedRepositoryOperationExceptionvoidtestHasNode()Tests ifVersion.hasNode(String)returns the rightbooleanvaluevoidtestHasNodes()Tests ifVersion.hasNodes()returnstruevoidtestHasProperties()Tests ifVersion.hasProperties()returnstruevoidtestHasProperty()Tests ifVersion.hasProperty(String)returns the rightbooleanvaluevoidtestHoldsLock()Tests ifVersion.holdsLock()returnsfalsevoidtestHoldsLockJcr2()Tests ifVersion.holdsLock()returnsfalsevoidtestIsCheckedOut()Tests ifVersion.isCheckedOut()returnstruevoidtestIsCheckedOutJcr2()Tests ifVersion.isCheckedOut()returnstruevoidtestIsLocked()Tests ifVersion.isLocked()returnsfalsevoidtestIsLockedJcr2()Tests ifVersion.isLocked()returnsfalsevoidtestIsModified()Tests ifVersion.isModified()returnsfalsevoidtestIsNew()Tests ifVersion.isNew()returnsfalsevoidtestIsNode()Tests ifVersion.isNode()returnstruevoidtestIsNodeType()Tests ifVersion.isNodeType(String)returns the rightbooleanvaluevoidtestIsSame()Tests ifVersion.isSame()returns the rightbooleanvaluevoidtestIsSameJcr2()Tests ifVersion.isSame()returns the rightbooleanvaluevoidtestLock()Tests ifVersion.lock(boolean, boolean)throws aLockExceptionvoidtestLockJcr2()Tests ifVersion.lock(boolean, boolean)throws aLockExceptionvoidtestMerge()Tests ifVersion.merge(String)throws anConstraintViolationExceptionvoidtestOrderBefore()Tests ifVersion.orderBefore(String, String)throws anUnsupportedRepositoryOperationExceptionvoidtestRefresh()Tests ifVersion.refresh(boolean)works as expected (do nothing and return quietly)voidtestRemove()Tests ifVersion.remove()throws anConstraintViolationExceptionvoidtestRemoveMixin()Tests ifVersion.removeMixin(String)throws anConstraintViolationExceptionvoidtestRestore()Tests ifVersion.restore(String, boolean)andVersion.restore(Version, boolean)throw anUnsupportedRepositoryOperationExceptionandVersion.restore(Version, String, boolean)throws aConstraintViolationException.voidtestRestoreByLabel()Tests ifVersion.restoreByLabel(String, boolean)throws anUnsupportedRepositoryOperationExceptionvoidtestRestoreByLabelJcr2()Tests ifVersion.restoreByLabel(String, boolean)throws anUnsupportedRepositoryOperationExceptionvoidtestRestoreJcr2()Tests ifVersion.restore(String, boolean)andVersion.restore(Version, boolean)throw anUnsupportedRepositoryOperationExceptionandVersion.restore(Version, String, boolean)throws aConstraintViolationException.voidtestSetProperty()Tests ifVersion.setProperty(String, String[])Version.setProperty(String, String[], int)Version.setProperty(String, Value[])Version.setProperty(String, Value[], int)Version.setProperty(String, boolean)Version.setProperty(String, double)Version.setProperty(String, InputStream)Version.setProperty(String, String)Version.setProperty(String, Calendar)Version.setProperty(String, Node)Version.setProperty(String, Value)Version.setProperty(String, long)all throw aConstraintViolationExceptionvoidtestUnlock()Tests ifVersion.unlock()throws aLockExceptionvoidtestUnlockJcr2()Tests ifVersion.unlock()throws aLockExceptionvoidtestUpdate()Tests ifVersionHistory.update(String)throws anConstraintViolationException-
Methods inherited from class org.apache.jackrabbit.test.api.version.AbstractVersionTest
createVersionableNode, getNumberOfVersions
-
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
-
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
-
setUp
protected void setUp() throws Exception- Overrides:
setUpin classAbstractVersionTest- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception- Overrides:
tearDownin classAbstractVersionTest- Throws:
Exception
-
testAccept
public void testAccept() throws ExceptionTests ifVersion.accept(ItemVisitor)accepts a ItemVisitor and if the right Node is provided to that visitor.- Throws:
Exception
-
testAddMixin
public void testAddMixin() throws ExceptionTests ifVersion.addMixin(String)throws aConstraintViolationException- Throws:
Exception
-
testAddNode
public void testAddNode() throws ExceptionTests ifVersion.addNode(String)andVersion.addNode(String, String)throw aConstraintViolationException- Throws:
Exception
-
testCanAddMixin
public void testCanAddMixin() throws ExceptionTests ifVersion.canAddMixin(String)returnsfalse- Throws:
Exception
-
testCancelMerge
public void testCancelMerge() throws ExceptionTests ifVersion.cancelMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testCancelMergeJcr2
public void testCancelMergeJcr2() throws ExceptionTests ifVersion.cancelMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testCheckin
public void testCheckin() throws ExceptionTests ifVersion.checkin()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testCheckinJcr2
public void testCheckinJcr2() throws ExceptionTests ifVersion.checkin()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testCheckout
public void testCheckout() throws ExceptionTests ifVersion.checkout()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testCheckoutJcr2
public void testCheckoutJcr2() throws ExceptionTests ifVersion.checkout()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testDoneMerge
public void testDoneMerge() throws ExceptionTests ifVersion.doneMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testDoneMergeJcr2
public void testDoneMergeJcr2() throws ExceptionTests ifVersion.doneMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testGetAncestor
public void testGetAncestor() throws ExceptionTests ifVersion.getAncestor(int)returns the right ancestor- Throws:
Exception
-
testGetBaseVersion
public void testGetBaseVersion() throws ExceptionTests ifVersion.getBaseVersion()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testGetBaseVersionJcr2
public void testGetBaseVersionJcr2() throws ExceptionTests ifVersion.getBaseVersion()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testGetCorrespondingNodePath
public void testGetCorrespondingNodePath() throws ExceptionTests ifVersion.getCorrespondingNodePath(String)returns the right path- Throws:
Exception
-
testGetDepth
public void testGetDepth() throws ExceptionTests ifVersion.getDepth()returns the right depth- Throws:
Exception
-
testGetIndex
public void testGetIndex() throws ExceptionTests ifVersion.getIndex()returns the right index- Throws:
Exception
-
testGetLock
public void testGetLock() throws ExceptionTests ifVersion.getLock()throws aLockException- Throws:
Exception
-
testGetLockJcr2
public void testGetLockJcr2() throws ExceptionTests ifVersion.getLock()throws aLockException- Throws:
Exception
-
testGetMixinNodeTypes
public void testGetMixinNodeTypes() throws ExceptionTests ifVersion.getMixinNodeTypes()does not return null.- Throws:
Exception
-
testGetName
public void testGetName() throws ExceptionTests ifVersion.getName()returns the right name- Throws:
Exception
-
testGetNode
public void testGetNode() throws ExceptionTests ifVersion.getNode(String)returns the right child Node- Throws:
Exception
-
testGetNodes
public void testGetNodes() throws ExceptionTests ifVersion.getNodes()andVersion.getNodes(String)returns the right child Node- Throws:
Exception
-
testGetParent
public void testGetParent() throws ExceptionTests ifVersion.getParent()returns the right parent Node- Throws:
Exception
-
testGetPath
public void testGetPath() throws ExceptionTests ifVersion.getPath()returns the right path- Throws:
Exception
-
testGetPrimaryItem
public void testGetPrimaryItem() throws ExceptionTests ifVersion.getPrimaryItem()throws aItemNotFoundException- Throws:
Exception
-
testGetPrimaryNodeType
public void testGetPrimaryNodeType() throws ExceptionTests ifVersion.getPrimaryNodeType()returns the right primary node typent:version- Throws:
Exception
-
testGetProperties
public void testGetProperties() throws ExceptionTests ifVersion.getProperties()andVersion.getProperties(String)return the right property- Throws:
Exception
-
testGetProperty
public void testGetProperty() throws ExceptionTests ifVersion.getProperty(String)returns the right property- Throws:
Exception
-
testGetSession
public void testGetSession() throws ExceptionTests ifVersion.getSession()returns the right session- Throws:
Exception
-
testGetVersionHistory
public void testGetVersionHistory() throws ExceptionTests ifVersion.getVersionHistory()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testGetVersionHistoryJcr2
public void testGetVersionHistoryJcr2() throws ExceptionTests ifVersion.getVersionHistory()throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testGetUUID
public void testGetUUID() throws ExceptionTests ifVersion.getUUID()returns the right UUID- Throws:
Exception
-
testHasNode
public void testHasNode() throws ExceptionTests ifVersion.hasNode(String)returns the rightbooleanvalue- Throws:
Exception
-
testHasNodes
public void testHasNodes() throws ExceptionTests ifVersion.hasNodes()returnstrue- Throws:
Exception
-
testHasProperties
public void testHasProperties() throws ExceptionTests ifVersion.hasProperties()returnstrue- Throws:
Exception
-
testHasProperty
public void testHasProperty() throws ExceptionTests ifVersion.hasProperty(String)returns the rightbooleanvalue- Throws:
Exception
-
testHoldsLock
public void testHoldsLock() throws ExceptionTests ifVersion.holdsLock()returnsfalse- Throws:
Exception
-
testHoldsLockJcr2
public void testHoldsLockJcr2() throws ExceptionTests ifVersion.holdsLock()returnsfalse- Throws:
Exception
-
testIsCheckedOut
public void testIsCheckedOut() throws ExceptionTests ifVersion.isCheckedOut()returnstrue- Throws:
Exception
-
testIsCheckedOutJcr2
public void testIsCheckedOutJcr2() throws ExceptionTests ifVersion.isCheckedOut()returnstrue- Throws:
Exception
-
testIsLocked
public void testIsLocked() throws ExceptionTests ifVersion.isLocked()returnsfalse- Throws:
Exception
-
testIsLockedJcr2
public void testIsLockedJcr2() throws ExceptionTests ifVersion.isLocked()returnsfalse- Throws:
Exception
-
testIsModified
public void testIsModified() throws ExceptionTests ifVersion.isModified()returnsfalse- Throws:
Exception
-
testIsNew
public void testIsNew() throws ExceptionTests ifVersion.isNew()returnsfalse- Throws:
Exception
-
testIsNode
public void testIsNode() throws ExceptionTests ifVersion.isNode()returnstrue- Throws:
Exception
-
testIsNodeType
public void testIsNodeType() throws ExceptionTests ifVersion.isNodeType(String)returns the rightbooleanvalue- Throws:
Exception
-
testIsSame
public void testIsSame() throws ExceptionTests ifVersion.isSame()returns the rightbooleanvalue- Throws:
Exception
-
testIsSameJcr2
public void testIsSameJcr2() throws ExceptionTests ifVersion.isSame()returns the rightbooleanvalue- Throws:
Exception
-
testLock
public void testLock() throws ExceptionTests ifVersion.lock(boolean, boolean)throws aLockException- Throws:
Exception
-
testLockJcr2
public void testLockJcr2() throws ExceptionTests ifVersion.lock(boolean, boolean)throws aLockException- Throws:
Exception
-
testMerge
public void testMerge() throws ExceptionTests ifVersion.merge(String)throws anConstraintViolationException- Throws:
Exception
-
testOrderBefore
public void testOrderBefore() throws ExceptionTests ifVersion.orderBefore(String, String)throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testRefresh
public void testRefresh() throws ExceptionTests ifVersion.refresh(boolean)works as expected (do nothing and return quietly)- Throws:
Exception
-
testRemove
public void testRemove() throws ExceptionTests ifVersion.remove()throws anConstraintViolationException- Throws:
Exception
-
testRemoveMixin
public void testRemoveMixin() throws ExceptionTests ifVersion.removeMixin(String)throws anConstraintViolationException- Throws:
Exception
-
testRestore
public void testRestore() throws ExceptionTests ifVersion.restore(String, boolean)andVersion.restore(Version, boolean)throw anUnsupportedRepositoryOperationExceptionandVersion.restore(Version, String, boolean)throws aConstraintViolationException.- Throws:
Exception
-
testRestoreJcr2
public void testRestoreJcr2() throws ExceptionTests ifVersion.restore(String, boolean)andVersion.restore(Version, boolean)throw anUnsupportedRepositoryOperationExceptionandVersion.restore(Version, String, boolean)throws aConstraintViolationException.- Throws:
Exception
-
testRestoreByLabel
public void testRestoreByLabel() throws ExceptionTests ifVersion.restoreByLabel(String, boolean)throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testRestoreByLabelJcr2
public void testRestoreByLabelJcr2() throws ExceptionTests ifVersion.restoreByLabel(String, boolean)throws anUnsupportedRepositoryOperationException- Throws:
Exception
-
testSetProperty
public void testSetProperty() throws ExceptionTests ifVersion.setProperty(String, String[])Version.setProperty(String, String[], int)Version.setProperty(String, Value[])Version.setProperty(String, Value[], int)Version.setProperty(String, boolean)Version.setProperty(String, double)Version.setProperty(String, InputStream)Version.setProperty(String, String)Version.setProperty(String, Calendar)Version.setProperty(String, Node)Version.setProperty(String, Value)Version.setProperty(String, long)
ConstraintViolationException- Throws:
Exception
-
testUnlock
public void testUnlock() throws ExceptionTests ifVersion.unlock()throws aLockException- Throws:
Exception
-
testUnlockJcr2
public void testUnlockJcr2() throws ExceptionTests ifVersion.unlock()throws aLockException- Throws:
Exception
-
testUpdate
public void testUpdate() throws ExceptionTests ifVersionHistory.update(String)throws anConstraintViolationException- Throws:
Exception
-
-