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
VersionTest
covers tests related to the methods of theVersion
class.
-
-
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 void
setUp()
protected void
tearDown()
void
testAccept()
Tests ifVersion.accept(ItemVisitor)
accepts a ItemVisitor and if the right Node is provided to that visitor.void
testAddMixin()
Tests ifVersion.addMixin(String)
throws aConstraintViolationException
void
testAddNode()
Tests ifVersion.addNode(String)
andVersion.addNode(String, String)
throw aConstraintViolationException
void
testCanAddMixin()
Tests ifVersion.canAddMixin(String)
returnsfalse
void
testCancelMerge()
Tests ifVersion.cancelMerge(Version)
throws anUnsupportedRepositoryOperationException
void
testCancelMergeJcr2()
Tests ifVersion.cancelMerge(Version)
throws anUnsupportedRepositoryOperationException
void
testCheckin()
Tests ifVersion.checkin()
throws anUnsupportedRepositoryOperationException
void
testCheckinJcr2()
Tests ifVersion.checkin()
throws anUnsupportedRepositoryOperationException
void
testCheckout()
Tests ifVersion.checkout()
throws anUnsupportedRepositoryOperationException
void
testCheckoutJcr2()
Tests ifVersion.checkout()
throws anUnsupportedRepositoryOperationException
void
testDoneMerge()
Tests ifVersion.doneMerge(Version)
throws anUnsupportedRepositoryOperationException
void
testDoneMergeJcr2()
Tests ifVersion.doneMerge(Version)
throws anUnsupportedRepositoryOperationException
void
testFrozenUUID()
Tests if the jcr:frozenUuid property has the correct typevoid
testGetAncestor()
Tests ifVersion.getAncestor(int)
returns the right ancestorvoid
testGetBaseVersion()
Tests ifVersion.getBaseVersion()
throws anUnsupportedRepositoryOperationException
void
testGetBaseVersionJcr2()
Tests ifVersion.getBaseVersion()
throws anUnsupportedRepositoryOperationException
void
testGetCorrespondingNodePath()
Tests ifVersion.getCorrespondingNodePath(String)
returns the right pathvoid
testGetDepth()
Tests ifVersion.getDepth()
returns the right depthvoid
testGetIndex()
Tests ifVersion.getIndex()
returns the right indexvoid
testGetLock()
Tests ifVersion.getLock()
throws aLockException
void
testGetLockJcr2()
Tests ifVersion.getLock()
throws aLockException
void
testGetMixinNodeTypes()
Tests ifVersion.getMixinNodeTypes()
does not return null.void
testGetName()
Tests ifVersion.getName()
returns the right namevoid
testGetNode()
Tests ifVersion.getNode(String)
returns the right child Nodevoid
testGetNodes()
Tests ifVersion.getNodes()
andVersion.getNodes(String)
returns the right child Nodevoid
testGetParent()
Tests ifVersion.getParent()
returns the right parent Nodevoid
testGetPath()
Tests ifVersion.getPath()
returns the right pathvoid
testGetPrimaryItem()
Tests ifVersion.getPrimaryItem()
throws aItemNotFoundException
void
testGetPrimaryNodeType()
Tests ifVersion.getPrimaryNodeType()
returns the right primary node typent:version
void
testGetProperties()
Tests ifVersion.getProperties()
andVersion.getProperties(String)
return the right propertyvoid
testGetProperty()
Tests ifVersion.getProperty(String)
returns the right propertyvoid
testGetSession()
Tests ifVersion.getSession()
returns the right sessionvoid
testGetUUID()
Tests ifVersion.getUUID()
returns the right UUIDvoid
testGetVersionHistory()
Tests ifVersion.getVersionHistory()
throws anUnsupportedRepositoryOperationException
void
testGetVersionHistoryJcr2()
Tests ifVersion.getVersionHistory()
throws anUnsupportedRepositoryOperationException
void
testHasNode()
Tests ifVersion.hasNode(String)
returns the rightboolean
valuevoid
testHasNodes()
Tests ifVersion.hasNodes()
returnstrue
void
testHasProperties()
Tests ifVersion.hasProperties()
returnstrue
void
testHasProperty()
Tests ifVersion.hasProperty(String)
returns the rightboolean
valuevoid
testHoldsLock()
Tests ifVersion.holdsLock()
returnsfalse
void
testHoldsLockJcr2()
Tests ifVersion.holdsLock()
returnsfalse
void
testIsCheckedOut()
Tests ifVersion.isCheckedOut()
returnstrue
void
testIsCheckedOutJcr2()
Tests ifVersion.isCheckedOut()
returnstrue
void
testIsLocked()
Tests ifVersion.isLocked()
returnsfalse
void
testIsLockedJcr2()
Tests ifVersion.isLocked()
returnsfalse
void
testIsModified()
Tests ifVersion.isModified()
returnsfalse
void
testIsNew()
Tests ifVersion.isNew()
returnsfalse
void
testIsNode()
Tests ifVersion.isNode()
returnstrue
void
testIsNodeType()
Tests ifVersion.isNodeType(String)
returns the rightboolean
valuevoid
testIsSame()
Tests ifVersion.isSame()
returns the rightboolean
valuevoid
testIsSameJcr2()
Tests ifVersion.isSame()
returns the rightboolean
valuevoid
testLock()
Tests ifVersion.lock(boolean, boolean)
throws aLockException
void
testLockJcr2()
Tests ifVersion.lock(boolean, boolean)
throws aLockException
void
testMerge()
Tests ifVersion.merge(String)
throws anConstraintViolationException
void
testOrderBefore()
Tests ifVersion.orderBefore(String, String)
throws anUnsupportedRepositoryOperationException
void
testRefresh()
Tests ifVersion.refresh(boolean)
works as expected (do nothing and return quietly)void
testRemove()
Tests ifVersion.remove()
throws anConstraintViolationException
void
testRemoveMixin()
Tests ifVersion.removeMixin(String)
throws anConstraintViolationException
void
testRestore()
Tests ifVersion.restore(String, boolean)
andVersion.restore(Version, boolean)
throw anUnsupportedRepositoryOperationException
andVersion.restore(Version, String, boolean)
throws aConstraintViolationException
.void
testRestoreByLabel()
Tests ifVersion.restoreByLabel(String, boolean)
throws anUnsupportedRepositoryOperationException
void
testRestoreByLabelJcr2()
Tests ifVersion.restoreByLabel(String, boolean)
throws anUnsupportedRepositoryOperationException
void
testRestoreJcr2()
Tests ifVersion.restore(String, boolean)
andVersion.restore(Version, boolean)
throw anUnsupportedRepositoryOperationException
andVersion.restore(Version, String, boolean)
throws aConstraintViolationException
.void
testSetProperty()
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 aConstraintViolationException
void
testUnlock()
Tests ifVersion.unlock()
throws aLockException
void
testUnlockJcr2()
Tests ifVersion.unlock()
throws aLockException
void
testUpdate()
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:
setUp
in classAbstractVersionTest
- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception
- Overrides:
tearDown
in classAbstractVersionTest
- Throws:
Exception
-
testAccept
public void testAccept() throws Exception
Tests ifVersion.accept(ItemVisitor)
accepts a ItemVisitor and if the right Node is provided to that visitor.- Throws:
Exception
-
testAddMixin
public void testAddMixin() throws Exception
Tests ifVersion.addMixin(String)
throws aConstraintViolationException
- Throws:
Exception
-
testAddNode
public void testAddNode() throws Exception
Tests ifVersion.addNode(String)
andVersion.addNode(String, String)
throw aConstraintViolationException
- Throws:
Exception
-
testCanAddMixin
public void testCanAddMixin() throws Exception
Tests ifVersion.canAddMixin(String)
returnsfalse
- Throws:
Exception
-
testCancelMerge
public void testCancelMerge() throws Exception
Tests ifVersion.cancelMerge(Version)
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testCancelMergeJcr2
public void testCancelMergeJcr2() throws Exception
Tests ifVersion.cancelMerge(Version)
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testCheckin
public void testCheckin() throws Exception
Tests ifVersion.checkin()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testCheckinJcr2
public void testCheckinJcr2() throws Exception
Tests ifVersion.checkin()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testCheckout
public void testCheckout() throws Exception
Tests ifVersion.checkout()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testCheckoutJcr2
public void testCheckoutJcr2() throws Exception
Tests ifVersion.checkout()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testDoneMerge
public void testDoneMerge() throws Exception
Tests ifVersion.doneMerge(Version)
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testDoneMergeJcr2
public void testDoneMergeJcr2() throws Exception
Tests ifVersion.doneMerge(Version)
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testGetAncestor
public void testGetAncestor() throws Exception
Tests ifVersion.getAncestor(int)
returns the right ancestor- Throws:
Exception
-
testGetBaseVersion
public void testGetBaseVersion() throws Exception
Tests ifVersion.getBaseVersion()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testGetBaseVersionJcr2
public void testGetBaseVersionJcr2() throws Exception
Tests ifVersion.getBaseVersion()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testGetCorrespondingNodePath
public void testGetCorrespondingNodePath() throws Exception
Tests ifVersion.getCorrespondingNodePath(String)
returns the right path- Throws:
Exception
-
testGetDepth
public void testGetDepth() throws Exception
Tests ifVersion.getDepth()
returns the right depth- Throws:
Exception
-
testGetIndex
public void testGetIndex() throws Exception
Tests ifVersion.getIndex()
returns the right index- Throws:
Exception
-
testGetLock
public void testGetLock() throws Exception
Tests ifVersion.getLock()
throws aLockException
- Throws:
Exception
-
testGetLockJcr2
public void testGetLockJcr2() throws Exception
Tests ifVersion.getLock()
throws aLockException
- Throws:
Exception
-
testGetMixinNodeTypes
public void testGetMixinNodeTypes() throws Exception
Tests ifVersion.getMixinNodeTypes()
does not return null.- Throws:
Exception
-
testGetName
public void testGetName() throws Exception
Tests ifVersion.getName()
returns the right name- Throws:
Exception
-
testGetNode
public void testGetNode() throws Exception
Tests ifVersion.getNode(String)
returns the right child Node- Throws:
Exception
-
testGetNodes
public void testGetNodes() throws Exception
Tests ifVersion.getNodes()
andVersion.getNodes(String)
returns the right child Node- Throws:
Exception
-
testGetParent
public void testGetParent() throws Exception
Tests ifVersion.getParent()
returns the right parent Node- Throws:
Exception
-
testGetPath
public void testGetPath() throws Exception
Tests ifVersion.getPath()
returns the right path- Throws:
Exception
-
testGetPrimaryItem
public void testGetPrimaryItem() throws Exception
Tests ifVersion.getPrimaryItem()
throws aItemNotFoundException
- Throws:
Exception
-
testGetPrimaryNodeType
public void testGetPrimaryNodeType() throws Exception
Tests ifVersion.getPrimaryNodeType()
returns the right primary node typent:version
- Throws:
Exception
-
testGetProperties
public void testGetProperties() throws Exception
Tests ifVersion.getProperties()
andVersion.getProperties(String)
return the right property- Throws:
Exception
-
testGetProperty
public void testGetProperty() throws Exception
Tests ifVersion.getProperty(String)
returns the right property- Throws:
Exception
-
testGetSession
public void testGetSession() throws Exception
Tests ifVersion.getSession()
returns the right session- Throws:
Exception
-
testGetVersionHistory
public void testGetVersionHistory() throws Exception
Tests ifVersion.getVersionHistory()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testGetVersionHistoryJcr2
public void testGetVersionHistoryJcr2() throws Exception
Tests ifVersion.getVersionHistory()
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testGetUUID
public void testGetUUID() throws Exception
Tests ifVersion.getUUID()
returns the right UUID- Throws:
Exception
-
testHasNode
public void testHasNode() throws Exception
Tests ifVersion.hasNode(String)
returns the rightboolean
value- Throws:
Exception
-
testHasNodes
public void testHasNodes() throws Exception
Tests ifVersion.hasNodes()
returnstrue
- Throws:
Exception
-
testHasProperties
public void testHasProperties() throws Exception
Tests ifVersion.hasProperties()
returnstrue
- Throws:
Exception
-
testHasProperty
public void testHasProperty() throws Exception
Tests ifVersion.hasProperty(String)
returns the rightboolean
value- Throws:
Exception
-
testHoldsLock
public void testHoldsLock() throws Exception
Tests ifVersion.holdsLock()
returnsfalse
- Throws:
Exception
-
testHoldsLockJcr2
public void testHoldsLockJcr2() throws Exception
Tests ifVersion.holdsLock()
returnsfalse
- Throws:
Exception
-
testIsCheckedOut
public void testIsCheckedOut() throws Exception
Tests ifVersion.isCheckedOut()
returnstrue
- Throws:
Exception
-
testIsCheckedOutJcr2
public void testIsCheckedOutJcr2() throws Exception
Tests ifVersion.isCheckedOut()
returnstrue
- Throws:
Exception
-
testIsLocked
public void testIsLocked() throws Exception
Tests ifVersion.isLocked()
returnsfalse
- Throws:
Exception
-
testIsLockedJcr2
public void testIsLockedJcr2() throws Exception
Tests ifVersion.isLocked()
returnsfalse
- Throws:
Exception
-
testIsModified
public void testIsModified() throws Exception
Tests ifVersion.isModified()
returnsfalse
- Throws:
Exception
-
testIsNew
public void testIsNew() throws Exception
Tests ifVersion.isNew()
returnsfalse
- Throws:
Exception
-
testIsNode
public void testIsNode() throws Exception
Tests ifVersion.isNode()
returnstrue
- Throws:
Exception
-
testIsNodeType
public void testIsNodeType() throws Exception
Tests ifVersion.isNodeType(String)
returns the rightboolean
value- Throws:
Exception
-
testIsSame
public void testIsSame() throws Exception
Tests ifVersion.isSame()
returns the rightboolean
value- Throws:
Exception
-
testIsSameJcr2
public void testIsSameJcr2() throws Exception
Tests ifVersion.isSame()
returns the rightboolean
value- Throws:
Exception
-
testLock
public void testLock() throws Exception
Tests ifVersion.lock(boolean, boolean)
throws aLockException
- Throws:
Exception
-
testLockJcr2
public void testLockJcr2() throws Exception
Tests ifVersion.lock(boolean, boolean)
throws aLockException
- Throws:
Exception
-
testMerge
public void testMerge() throws Exception
Tests ifVersion.merge(String)
throws anConstraintViolationException
- Throws:
Exception
-
testOrderBefore
public void testOrderBefore() throws Exception
Tests ifVersion.orderBefore(String, String)
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testRefresh
public void testRefresh() throws Exception
Tests ifVersion.refresh(boolean)
works as expected (do nothing and return quietly)- Throws:
Exception
-
testRemove
public void testRemove() throws Exception
Tests ifVersion.remove()
throws anConstraintViolationException
- Throws:
Exception
-
testRemoveMixin
public void testRemoveMixin() throws Exception
Tests ifVersion.removeMixin(String)
throws anConstraintViolationException
- Throws:
Exception
-
testRestore
public void testRestore() throws Exception
Tests ifVersion.restore(String, boolean)
andVersion.restore(Version, boolean)
throw anUnsupportedRepositoryOperationException
andVersion.restore(Version, String, boolean)
throws aConstraintViolationException
.- Throws:
Exception
-
testRestoreJcr2
public void testRestoreJcr2() throws Exception
Tests ifVersion.restore(String, boolean)
andVersion.restore(Version, boolean)
throw anUnsupportedRepositoryOperationException
andVersion.restore(Version, String, boolean)
throws aConstraintViolationException
.- Throws:
Exception
-
testRestoreByLabel
public void testRestoreByLabel() throws Exception
Tests ifVersion.restoreByLabel(String, boolean)
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testRestoreByLabelJcr2
public void testRestoreByLabelJcr2() throws Exception
Tests ifVersion.restoreByLabel(String, boolean)
throws anUnsupportedRepositoryOperationException
- Throws:
Exception
-
testSetProperty
public void testSetProperty() throws Exception
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)
ConstraintViolationException
- Throws:
Exception
-
testUnlock
public void testUnlock() throws Exception
Tests ifVersion.unlock()
throws aLockException
- Throws:
Exception
-
testUnlockJcr2
public void testUnlockJcr2() throws Exception
Tests ifVersion.unlock()
throws aLockException
- Throws:
Exception
-
testUpdate
public void testUpdate() throws Exception
Tests ifVersionHistory.update(String)
throws anConstraintViolationException
- Throws:
Exception
-
-