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.AbstractVersionTestnonVersionableNode, nonVersionableNodeType, propertyValue, versionableNode, versionableNodeType
 - 
Fields inherited from class org.apache.jackrabbit.test.AbstractJCRTestisReadOnly, 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 SummaryConstructors Constructor Description VersionTest()
 - 
Method SummaryAll 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.AbstractVersionTestcreateVersionableNode, getNumberOfVersions
 - 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTestcheckSupportedOption, 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.TestCaseassertEquals, 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- 
setUpprotected void setUp() throws Exception- Overrides:
- setUpin class- AbstractVersionTest
- Throws:
- Exception
 
 - 
tearDownprotected void tearDown() throws Exception- Overrides:
- tearDownin class- AbstractVersionTest
- Throws:
- Exception
 
 - 
testAcceptpublic void testAccept() throws ExceptionTests ifVersion.accept(ItemVisitor)accepts a ItemVisitor and if the right Node is provided to that visitor.- Throws:
- Exception
 
 - 
testAddMixinpublic void testAddMixin() throws ExceptionTests ifVersion.addMixin(String)throws aConstraintViolationException- Throws:
- Exception
 
 - 
testAddNodepublic void testAddNode() throws ExceptionTests ifVersion.addNode(String)andVersion.addNode(String, String)throw aConstraintViolationException- Throws:
- Exception
 
 - 
testCanAddMixinpublic void testCanAddMixin() throws ExceptionTests ifVersion.canAddMixin(String)returnsfalse- Throws:
- Exception
 
 - 
testCancelMergepublic void testCancelMerge() throws ExceptionTests ifVersion.cancelMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testCancelMergeJcr2public void testCancelMergeJcr2() throws ExceptionTests ifVersion.cancelMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testCheckinpublic void testCheckin() throws ExceptionTests ifVersion.checkin()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testCheckinJcr2public void testCheckinJcr2() throws ExceptionTests ifVersion.checkin()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testCheckoutpublic void testCheckout() throws ExceptionTests ifVersion.checkout()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testCheckoutJcr2public void testCheckoutJcr2() throws ExceptionTests ifVersion.checkout()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testDoneMergepublic void testDoneMerge() throws ExceptionTests ifVersion.doneMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testDoneMergeJcr2public void testDoneMergeJcr2() throws ExceptionTests ifVersion.doneMerge(Version)throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testGetAncestorpublic void testGetAncestor() throws ExceptionTests ifVersion.getAncestor(int)returns the right ancestor- Throws:
- Exception
 
 - 
testGetBaseVersionpublic void testGetBaseVersion() throws ExceptionTests ifVersion.getBaseVersion()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testGetBaseVersionJcr2public void testGetBaseVersionJcr2() throws ExceptionTests ifVersion.getBaseVersion()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testGetCorrespondingNodePathpublic void testGetCorrespondingNodePath() throws ExceptionTests ifVersion.getCorrespondingNodePath(String)returns the right path- Throws:
- Exception
 
 - 
testGetDepthpublic void testGetDepth() throws ExceptionTests ifVersion.getDepth()returns the right depth- Throws:
- Exception
 
 - 
testGetIndexpublic void testGetIndex() throws ExceptionTests ifVersion.getIndex()returns the right index- Throws:
- Exception
 
 - 
testGetLockpublic void testGetLock() throws ExceptionTests ifVersion.getLock()throws aLockException- Throws:
- Exception
 
 - 
testGetLockJcr2public void testGetLockJcr2() throws ExceptionTests ifVersion.getLock()throws aLockException- Throws:
- Exception
 
 - 
testGetMixinNodeTypespublic void testGetMixinNodeTypes() throws ExceptionTests ifVersion.getMixinNodeTypes()does not return null.- Throws:
- Exception
 
 - 
testGetNamepublic void testGetName() throws ExceptionTests ifVersion.getName()returns the right name- Throws:
- Exception
 
 - 
testGetNodepublic void testGetNode() throws ExceptionTests ifVersion.getNode(String)returns the right child Node- Throws:
- Exception
 
 - 
testGetNodespublic void testGetNodes() throws ExceptionTests ifVersion.getNodes()andVersion.getNodes(String)returns the right child Node- Throws:
- Exception
 
 - 
testGetParentpublic void testGetParent() throws ExceptionTests ifVersion.getParent()returns the right parent Node- Throws:
- Exception
 
 - 
testGetPathpublic void testGetPath() throws ExceptionTests ifVersion.getPath()returns the right path- Throws:
- Exception
 
 - 
testGetPrimaryItempublic void testGetPrimaryItem() throws ExceptionTests ifVersion.getPrimaryItem()throws aItemNotFoundException- Throws:
- Exception
 
 - 
testGetPrimaryNodeTypepublic void testGetPrimaryNodeType() throws ExceptionTests ifVersion.getPrimaryNodeType()returns the right primary node typent:version- Throws:
- Exception
 
 - 
testGetPropertiespublic void testGetProperties() throws ExceptionTests ifVersion.getProperties()andVersion.getProperties(String)return the right property- Throws:
- Exception
 
 - 
testGetPropertypublic void testGetProperty() throws ExceptionTests ifVersion.getProperty(String)returns the right property- Throws:
- Exception
 
 - 
testGetSessionpublic void testGetSession() throws ExceptionTests ifVersion.getSession()returns the right session- Throws:
- Exception
 
 - 
testGetVersionHistorypublic void testGetVersionHistory() throws ExceptionTests ifVersion.getVersionHistory()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testGetVersionHistoryJcr2public void testGetVersionHistoryJcr2() throws ExceptionTests ifVersion.getVersionHistory()throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testGetUUIDpublic void testGetUUID() throws ExceptionTests ifVersion.getUUID()returns the right UUID- Throws:
- Exception
 
 - 
testHasNodepublic void testHasNode() throws ExceptionTests ifVersion.hasNode(String)returns the rightbooleanvalue- Throws:
- Exception
 
 - 
testHasNodespublic void testHasNodes() throws ExceptionTests ifVersion.hasNodes()returnstrue- Throws:
- Exception
 
 - 
testHasPropertiespublic void testHasProperties() throws ExceptionTests ifVersion.hasProperties()returnstrue- Throws:
- Exception
 
 - 
testHasPropertypublic void testHasProperty() throws ExceptionTests ifVersion.hasProperty(String)returns the rightbooleanvalue- Throws:
- Exception
 
 - 
testHoldsLockpublic void testHoldsLock() throws ExceptionTests ifVersion.holdsLock()returnsfalse- Throws:
- Exception
 
 - 
testHoldsLockJcr2public void testHoldsLockJcr2() throws ExceptionTests ifVersion.holdsLock()returnsfalse- Throws:
- Exception
 
 - 
testIsCheckedOutpublic void testIsCheckedOut() throws ExceptionTests ifVersion.isCheckedOut()returnstrue- Throws:
- Exception
 
 - 
testIsCheckedOutJcr2public void testIsCheckedOutJcr2() throws ExceptionTests ifVersion.isCheckedOut()returnstrue- Throws:
- Exception
 
 - 
testIsLockedpublic void testIsLocked() throws ExceptionTests ifVersion.isLocked()returnsfalse- Throws:
- Exception
 
 - 
testIsLockedJcr2public void testIsLockedJcr2() throws ExceptionTests ifVersion.isLocked()returnsfalse- Throws:
- Exception
 
 - 
testIsModifiedpublic void testIsModified() throws ExceptionTests ifVersion.isModified()returnsfalse- Throws:
- Exception
 
 - 
testIsNewpublic void testIsNew() throws ExceptionTests ifVersion.isNew()returnsfalse- Throws:
- Exception
 
 - 
testIsNodepublic void testIsNode() throws ExceptionTests ifVersion.isNode()returnstrue- Throws:
- Exception
 
 - 
testIsNodeTypepublic void testIsNodeType() throws ExceptionTests ifVersion.isNodeType(String)returns the rightbooleanvalue- Throws:
- Exception
 
 - 
testIsSamepublic void testIsSame() throws ExceptionTests ifVersion.isSame()returns the rightbooleanvalue- Throws:
- Exception
 
 - 
testIsSameJcr2public void testIsSameJcr2() throws ExceptionTests ifVersion.isSame()returns the rightbooleanvalue- Throws:
- Exception
 
 - 
testLockpublic void testLock() throws ExceptionTests ifVersion.lock(boolean, boolean)throws aLockException- Throws:
- Exception
 
 - 
testLockJcr2public void testLockJcr2() throws ExceptionTests ifVersion.lock(boolean, boolean)throws aLockException- Throws:
- Exception
 
 - 
testMergepublic void testMerge() throws ExceptionTests ifVersion.merge(String)throws anConstraintViolationException- Throws:
- Exception
 
 - 
testOrderBeforepublic void testOrderBefore() throws ExceptionTests ifVersion.orderBefore(String, String)throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testRefreshpublic void testRefresh() throws ExceptionTests ifVersion.refresh(boolean)works as expected (do nothing and return quietly)- Throws:
- Exception
 
 - 
testRemovepublic void testRemove() throws ExceptionTests ifVersion.remove()throws anConstraintViolationException- Throws:
- Exception
 
 - 
testRemoveMixinpublic void testRemoveMixin() throws ExceptionTests ifVersion.removeMixin(String)throws anConstraintViolationException- Throws:
- Exception
 
 - 
testRestorepublic void testRestore() throws ExceptionTests ifVersion.restore(String, boolean)andVersion.restore(Version, boolean)throw anUnsupportedRepositoryOperationExceptionandVersion.restore(Version, String, boolean)throws aConstraintViolationException.- Throws:
- Exception
 
 - 
testRestoreJcr2public void testRestoreJcr2() throws ExceptionTests ifVersion.restore(String, boolean)andVersion.restore(Version, boolean)throw anUnsupportedRepositoryOperationExceptionandVersion.restore(Version, String, boolean)throws aConstraintViolationException.- Throws:
- Exception
 
 - 
testRestoreByLabelpublic void testRestoreByLabel() throws ExceptionTests ifVersion.restoreByLabel(String, boolean)throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testRestoreByLabelJcr2public void testRestoreByLabelJcr2() throws ExceptionTests ifVersion.restoreByLabel(String, boolean)throws anUnsupportedRepositoryOperationException- Throws:
- Exception
 
 - 
testSetPropertypublic void testSetProperty() throws ExceptionTests if- Version.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
 
 - 
testUnlockpublic void testUnlock() throws ExceptionTests ifVersion.unlock()throws aLockException- Throws:
- Exception
 
 - 
testUnlockJcr2public void testUnlockJcr2() throws ExceptionTests ifVersion.unlock()throws aLockException- Throws:
- Exception
 
 - 
testUpdatepublic void testUpdate() throws ExceptionTests ifVersionHistory.update(String)throws anConstraintViolationException- Throws:
- Exception
 
 
- 
 
-