public class VersionHistoryTest extends AbstractVersionTest
VersionHistoryTest provides test methods related to version
history methods and general version history issues.| Modifier and Type | Field and Description |
|---|---|
protected VersionHistory |
vHistory |
nonVersionableNode, nonVersionableNodeType, propertyValue, versionableNode, versionableNodeTypeisReadOnly, 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 and Description |
|---|
VersionHistoryTest() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
setUp() |
protected void |
tearDown() |
void |
testAccept()
Tests if
VersionHistory.accept(ItemVisitor) accepts a
ItemVisitor and if the right Node is provided to that visitor. |
void |
testAddMixin()
Tests if
VersionHistory.addMixin(String) throws a ConstraintViolationException |
void |
testAddNode()
Tests if
VersionHistory.addNode(String) and
VersionHistory.addNode(String, String) throw a ConstraintViolationException |
void |
testAutocreatedRootVersion()
Test if initially there is an auto-created root version present in the
version history.
|
void |
testCanAddMixin()
Tests if
VersionHistory.canAddMixin(String) returns
false |
void |
testCancelMerge()
Tests if
VersionHistory.cancelMerge(Version) throws an
UnsupportedRepositoryOperationException |
void |
testCancelMergeJcr2()
Tests if
VersionHistory.cancelMerge(Version) throws an
UnsupportedRepositoryOperationException |
void |
testCheckin()
Tests if
VersionHistory.checkin() throws an UnsupportedRepositoryOperationException |
void |
testCheckinJcr2()
Tests if
VersionHistory.checkin() throws an UnsupportedRepositoryOperationException |
void |
testCheckout()
Tests if
VersionHistory.checkout() throws an UnsupportedRepositoryOperationException |
void |
testCheckoutJcr2()
Tests if
VersionHistory.checkout() throws an UnsupportedRepositoryOperationException |
void |
testDoneMerge()
Tests if
VersionHistory.doneMerge(Version) throws an UnsupportedRepositoryOperationException |
void |
testDoneMergeJcr2()
Tests if
VersionHistory.doneMerge(Version) throws an UnsupportedRepositoryOperationException |
void |
testGetAllFrozenNodes()
Test that
VersionHistory.getAllFrozenNodes() returns an iterator
containing the frozen nodes of all versions that have been created by
VersionManager.checkpoint(String). |
void |
testGetAllVersions()
Test that
VersionHistory.getAllVersions() returns an iterator
containing the root version and all versions that have been created by
Node.checkin(). |
void |
testGetAllVersionsJcr2()
Test that
VersionHistory.getAllVersions() returns an iterator
containing the root version and all versions that have been created by
Node.checkin(). |
void |
testGetAncestor()
Tests if
VersionHistory.getAncestor(int) returns the right
ancestor |
void |
testGetBaseVersion()
Tests if
VersionHistory.getBaseVersion() throws an UnsupportedRepositoryOperationException |
void |
testGetBaseVersionJcr2()
Tests if
VersionHistory.getBaseVersion() throws an UnsupportedRepositoryOperationException |
void |
testGetCorrespondingNodePath()
Tests if
VersionHistory.getCorrespondingNodePath(String)
returns the right path |
void |
testGetDepth()
Tests if
VersionHistory.getDepth() returns the right depth |
void |
testGetIdentifier()
Tests if
VersionHistory.getIdentifier() returns the right UUID |
void |
testGetIndex()
Tests if
VersionHistory.getIndex() returns the right index |
void |
testGetLock()
Tests if
VersionHistory.getLock() throws an LockException |
void |
testGetLockJcr2()
Tests if
VersionHistory.getLock() throws an LockException |
void |
testGetMixinNodeTypes()
Tests if
VersionHistory.getMixinNodeTypes() does not return
null. |
void |
testGetName()
Tests if
VersionHistory.getName() returns the right name |
void |
testGetNode()
Tests if
VersionHistory.getNode(String) returns the right
child Node |
void |
testGetNodes()
Tests if
VersionHistory.getNodes() and
VersionHistory.getNodes(String) returns the right child
Node |
void |
testGetParent()
Tests if
VersionHistory.getParent() returns the right parent
Node |
void |
testGetPath()
Tests if
VersionHistory.getPath() returns the right path |
void |
testGetPrimaryItem()
Tests if
VersionHistory.getPrimaryItem() throws a ItemNotFoundException |
void |
testGetPrimaryNodeType()
Tests if
VersionHistory.getPrimaryNodeType() returns the
right primary node type nt:versionHistory |
void |
testGetProperties()
Tests if
VersionHistory.getProperties() and
VersionHistory.getProperties(String) return the right
property |
void |
testGetProperty()
Tests if
VersionHistory.getProperty(String) returns the
right property |
void |
testGetReferences()
Tests if
VersionHistory.getReferences() returns the right
reference of the versionable node |
void |
testGetSession()
Tests if
VersionHistory.getSession() returns the right
session |
void |
testGetUUID()
Tests if
VersionHistory.getUUID() returns the right UUID |
void |
testGetVersion()
Test VersionHistory.getVersion(String versionName) if 'versionName' is
the name of an existing version (created by Node.checkin()).
|
void |
testGetVersionHistory()
Tests if
VersionHistory.getVersionHistory() throws an UnsupportedRepositoryOperationException |
void |
testGetVersionHistoryJcr2()
Tests if
VersionHistory.getVersionHistory() throws an UnsupportedRepositoryOperationException |
void |
testGetVersionHistoryOnNonVersionableNode()
Test if UnsupportedRepositoryOperationException is thrown when calling
Node.getVersionHistory() on a non-versionable node.
|
void |
testGetVersionHistoryOnNonVersionableNodeJcr2()
Test if UnsupportedRepositoryOperationException is thrown when calling
Node.getVersionHistory() on a non-versionable node.
|
void |
testHasNode()
Tests if
VersionHistory.hasNode(String) returns the right
boolean value |
void |
testHasNodes()
Tests if
VersionHistory.hasNodes() returns
true |
void |
testHasProperties()
Tests if
VersionHistory.hasProperties() returns
true |
void |
testHasProperty()
Tests if
VersionHistory.hasProperty(String) returns the
right boolean value |
void |
testHoldsLock()
Tests if
VersionHistory.holdsLock() returns
false |
void |
testHoldsLockJcr2()
Tests if
VersionHistory.holdsLock() returns
false |
void |
testInitiallyGetAllLinearVersionsContainsTheRootAndTheBaseVersion()
Test if the iterator returned by
VersionHistory.getAllLinearVersions()
contains both the root and the base version upon creation of the version history. |
void |
testInitiallyGetAllVersionsContainsTheRootVersion()
Test if the iterator returned by
VersionHistory.getAllVersions()
contains the root version upon creation of the version history. |
void |
testInitialNumberOfLinearVersions()
The version history must initially contain two versions (root version +
first test version) - linear variant
|
void |
testInitialNumberOfVersions()
The version history must initially contain two versions (root version +
first test version).
|
void |
testIsCheckedOut()
Tests if
VersionHistory.isCheckedOut() returns
true |
void |
testIsCheckedOutJcr2()
Tests if
VersionHistory.isCheckedOut() returns
true |
void |
testIsLocked()
Tests if
VersionHistory.isLocked() returns
false |
void |
testIsLockedJcr2()
Tests if
VersionHistory.isLocked() returns
false |
void |
testIsModified()
Tests if
VersionHistory.isModified() returns
false |
void |
testIsNew()
Tests if
VersionHistory.isNew() returns false |
void |
testIsNode()
Tests if
VersionHistory.isNode() returns true |
void |
testIsNodeType()
Tests if
VersionHistory.isNodeType(String) returns the right
boolean value |
void |
testIsSame()
Tests if
VersionHistory.isSame() returns the right
boolean value |
void |
testLock()
Tests if
VersionHistory.lock(boolean, boolean) throws a
LockException |
void |
testLockJcr2()
Tests if
VersionHistory.lock(boolean, boolean) throws a
LockException |
void |
testMerge()
Tests if
VersionHistory.merge(String) throws an
ConstraintViolationException |
void |
testOrderBefore()
Tests if
VersionHistory.orderBefore(String, String) throws
an UnsupportedRepositoryOperationException |
void |
testRefresh()
Tests if
VersionHistory.refresh(boolean) works as expected
(do nothing and return quietly) |
void |
testRemove()
Tests if
VersionHistory.remove() throws an ConstraintViolationException |
void |
testRemoveMixin()
Tests if
VersionHistory.removeMixin(String) throws an NoSuchNodeTypeException |
void |
testRestore()
Tests if
VersionHistory.restore(String, boolean) and
VersionHistory.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and VersionHistory.restore(Version,
String, boolean) throws a ConstraintViolationException. |
void |
testRestoreByLabel()
Tests if
VersionHistory.restoreByLabel(String, boolean)
throws an UnsupportedRepositoryOperationException |
void |
testRestoreByLabelJcr2()
Tests if
VersionHistory.restoreByLabel(String, boolean)
throws an UnsupportedRepositoryOperationException |
void |
testRestoreJcr2()
Tests if
VersionHistory.restore(String, boolean) and
VersionHistory.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and VersionHistory.restore(Version,
String, boolean) throws a ConstraintViolationException. |
void |
testSetProperty()
Tests if
VersionHistory.setProperty(String,
String[]) VersionHistory.setProperty(String,
String[], int) VersionHistory.setProperty(String,
Value[]) VersionHistory.setProperty(String,
Value[], int) VersionHistory.setProperty(String,
boolean) VersionHistory.setProperty(String,
double) VersionHistory.setProperty(String,
InputStream) VersionHistory.setProperty(String,
String) VersionHistory.setProperty(String,
Calendar) VersionHistory.setProperty(String,
Node) VersionHistory.setProperty(String,
Value) VersionHistory.setProperty(String,
long) all throw a ConstraintViolationException |
void |
testUnlock()
Tests if
VersionHistory.unlock() throws a LockException |
void |
testUnlockJcr2()
Tests if
VersionHistory.unlock() throws a LockException |
void |
testUpdate()
Tests if
VersionHistory.update(String) throws an
ConstraintViolationException |
createVersionableNode, getNumberOfVersionscheckSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureLockingSupported, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getPrefix, getProperty, getProperty, getQualifiedName, getSize, isSupported, needsMixin, runassertEquals, 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, toStringprotected VersionHistory vHistory
protected void setUp()
throws Exception
setUp in class AbstractVersionTestExceptionprotected void tearDown()
throws Exception
tearDown in class AbstractVersionTestExceptionpublic void testAutocreatedRootVersion()
throws RepositoryException
RepositoryExceptionpublic void testInitialNumberOfVersions()
throws RepositoryException
RepositoryExceptionpublic void testInitialNumberOfLinearVersions()
throws RepositoryException
RepositoryExceptionpublic void testInitiallyGetAllVersionsContainsTheRootVersion()
throws RepositoryException
VersionHistory.getAllVersions()
contains the root version upon creation of the version history.RepositoryExceptionVersionHistory.getRootVersion()public void testInitiallyGetAllLinearVersionsContainsTheRootAndTheBaseVersion()
throws RepositoryException
VersionHistory.getAllLinearVersions()
contains both the root and the base version upon creation of the version history.RepositoryExceptionpublic void testGetAllVersions()
throws RepositoryException
VersionHistory.getAllVersions() returns an iterator
containing the root version and all versions that have been created by
Node.checkin().RepositoryExceptionVersionHistory.getAllVersions()public void testGetAllVersionsJcr2()
throws RepositoryException
VersionHistory.getAllVersions() returns an iterator
containing the root version and all versions that have been created by
Node.checkin().RepositoryExceptionVersionHistory.getAllVersions()public void testGetAllFrozenNodes()
throws RepositoryException
VersionHistory.getAllFrozenNodes() returns an iterator
containing the frozen nodes of all versions that have been created by
VersionManager.checkpoint(String).RepositoryExceptionVersionHistory.getAllFrozenNodes()public void testGetVersionHistoryOnNonVersionableNode()
throws RepositoryException
RepositoryExceptionpublic void testGetVersionHistoryOnNonVersionableNodeJcr2()
throws RepositoryException
RepositoryExceptionpublic void testGetVersion()
throws RepositoryException
RepositoryExceptionVersionHistory.getVersion(String)public void testAccept()
throws Exception
VersionHistory.accept(ItemVisitor) accepts a
ItemVisitor and if the right Node is provided to that visitor.Exceptionpublic void testAddMixin()
throws Exception
VersionHistory.addMixin(String) throws a ConstraintViolationExceptionExceptionpublic void testAddNode()
throws Exception
VersionHistory.addNode(String) and
VersionHistory.addNode(String, String) throw a ConstraintViolationExceptionExceptionpublic void testCanAddMixin()
throws Exception
VersionHistory.canAddMixin(String) returns
falseExceptionpublic void testCancelMerge()
throws Exception
VersionHistory.cancelMerge(Version) throws an
UnsupportedRepositoryOperationExceptionExceptionpublic void testCancelMergeJcr2()
throws Exception
VersionHistory.cancelMerge(Version) throws an
UnsupportedRepositoryOperationExceptionExceptionpublic void testCheckin()
throws Exception
VersionHistory.checkin() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testCheckinJcr2()
throws Exception
VersionHistory.checkin() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testCheckout()
throws Exception
VersionHistory.checkout() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testCheckoutJcr2()
throws Exception
VersionHistory.checkout() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testDoneMerge()
throws Exception
VersionHistory.doneMerge(Version) throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testDoneMergeJcr2()
throws Exception
VersionHistory.doneMerge(Version) throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testGetAncestor()
throws Exception
VersionHistory.getAncestor(int) returns the right
ancestorExceptionpublic void testGetBaseVersion()
throws Exception
VersionHistory.getBaseVersion() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testGetBaseVersionJcr2()
throws Exception
VersionHistory.getBaseVersion() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testGetCorrespondingNodePath()
throws Exception
VersionHistory.getCorrespondingNodePath(String)
returns the right pathExceptionpublic void testGetDepth()
throws Exception
VersionHistory.getDepth() returns the right depthExceptionpublic void testGetIndex()
throws Exception
VersionHistory.getIndex() returns the right indexExceptionpublic void testGetLock()
throws Exception
VersionHistory.getLock() throws an LockExceptionExceptionpublic void testGetLockJcr2()
throws Exception
VersionHistory.getLock() throws an LockExceptionExceptionpublic void testGetMixinNodeTypes()
throws Exception
VersionHistory.getMixinNodeTypes() does not return
null.Exceptionpublic void testGetName()
throws Exception
VersionHistory.getName() returns the right nameExceptionpublic void testGetNode()
throws Exception
VersionHistory.getNode(String) returns the right
child NodeExceptionpublic void testGetNodes()
throws Exception
VersionHistory.getNodes() and
VersionHistory.getNodes(String) returns the right child
NodeExceptionpublic void testGetParent()
throws Exception
VersionHistory.getParent() returns the right parent
NodeExceptionpublic void testGetPath()
throws Exception
VersionHistory.getPath() returns the right pathExceptionpublic void testGetPrimaryItem()
throws Exception
VersionHistory.getPrimaryItem() throws a ItemNotFoundExceptionExceptionpublic void testGetPrimaryNodeType()
throws Exception
VersionHistory.getPrimaryNodeType() returns the
right primary node type nt:versionHistoryExceptionpublic void testGetProperties()
throws Exception
VersionHistory.getProperties() and
VersionHistory.getProperties(String) return the right
propertyExceptionpublic void testGetProperty()
throws Exception
VersionHistory.getProperty(String) returns the
right propertyExceptionpublic void testGetReferences()
throws Exception
VersionHistory.getReferences() returns the right
reference of the versionable nodeExceptionpublic void testGetSession()
throws Exception
VersionHistory.getSession() returns the right
sessionExceptionpublic void testGetUUID()
throws Exception
VersionHistory.getUUID() returns the right UUIDExceptionpublic void testGetIdentifier()
throws Exception
VersionHistory.getIdentifier() returns the right UUIDExceptionpublic void testGetVersionHistory()
throws Exception
VersionHistory.getVersionHistory() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testGetVersionHistoryJcr2()
throws Exception
VersionHistory.getVersionHistory() throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testHasNode()
throws Exception
VersionHistory.hasNode(String) returns the right
boolean valueExceptionpublic void testHasNodes()
throws Exception
VersionHistory.hasNodes() returns
trueExceptionpublic void testHasProperties()
throws Exception
VersionHistory.hasProperties() returns
trueExceptionpublic void testHasProperty()
throws Exception
VersionHistory.hasProperty(String) returns the
right boolean valueExceptionpublic void testHoldsLock()
throws Exception
VersionHistory.holdsLock() returns
falseExceptionpublic void testHoldsLockJcr2()
throws Exception
VersionHistory.holdsLock() returns
falseExceptionpublic void testIsCheckedOut()
throws Exception
VersionHistory.isCheckedOut() returns
trueExceptionpublic void testIsCheckedOutJcr2()
throws Exception
VersionHistory.isCheckedOut() returns
trueExceptionpublic void testIsLocked()
throws Exception
VersionHistory.isLocked() returns
falseExceptionpublic void testIsLockedJcr2()
throws Exception
VersionHistory.isLocked() returns
falseExceptionpublic void testIsModified()
throws Exception
VersionHistory.isModified() returns
falseExceptionpublic void testIsNew()
throws Exception
VersionHistory.isNew() returns falseExceptionpublic void testIsNode()
throws Exception
VersionHistory.isNode() returns trueExceptionpublic void testIsNodeType()
throws Exception
VersionHistory.isNodeType(String) returns the right
boolean valueExceptionpublic void testIsSame()
throws Exception
VersionHistory.isSame() returns the right
boolean valueExceptionpublic void testLock()
throws Exception
VersionHistory.lock(boolean, boolean) throws a
LockExceptionExceptionpublic void testLockJcr2()
throws Exception
VersionHistory.lock(boolean, boolean) throws a
LockExceptionExceptionpublic void testMerge()
throws Exception
VersionHistory.merge(String) throws an
ConstraintViolationExceptionExceptionpublic void testOrderBefore()
throws Exception
VersionHistory.orderBefore(String, String) throws
an UnsupportedRepositoryOperationExceptionExceptionpublic void testRefresh()
throws Exception
VersionHistory.refresh(boolean) works as expected
(do nothing and return quietly)Exceptionpublic void testRemove()
throws Exception
VersionHistory.remove() throws an ConstraintViolationExceptionExceptionpublic void testRemoveMixin()
throws Exception
VersionHistory.removeMixin(String) throws an NoSuchNodeTypeExceptionExceptionpublic void testRestore()
throws Exception
VersionHistory.restore(String, boolean) and
VersionHistory.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and VersionHistory.restore(Version,
String, boolean) throws a ConstraintViolationException.Exceptionpublic void testRestoreJcr2()
throws Exception
VersionHistory.restore(String, boolean) and
VersionHistory.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and VersionHistory.restore(Version,
String, boolean) throws a ConstraintViolationException.Exceptionpublic void testRestoreByLabel()
throws Exception
VersionHistory.restoreByLabel(String, boolean)
throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testRestoreByLabelJcr2()
throws Exception
VersionHistory.restoreByLabel(String, boolean)
throws an UnsupportedRepositoryOperationExceptionExceptionpublic void testSetProperty()
throws Exception
VersionHistory.setProperty(String,
String[])VersionHistory.setProperty(String,
String[], int)VersionHistory.setProperty(String,
Value[])VersionHistory.setProperty(String,
Value[], int)VersionHistory.setProperty(String,
boolean)VersionHistory.setProperty(String,
double)VersionHistory.setProperty(String,
InputStream)VersionHistory.setProperty(String,
String)VersionHistory.setProperty(String,
Calendar)VersionHistory.setProperty(String,
Node)VersionHistory.setProperty(String,
Value)VersionHistory.setProperty(String,
long)ConstraintViolationExceptionExceptionpublic void testUnlock()
throws Exception
VersionHistory.unlock() throws a LockExceptionExceptionpublic void testUnlockJcr2()
throws Exception
VersionHistory.unlock() throws a LockExceptionExceptionpublic void testUpdate()
throws Exception
VersionHistory.update(String) throws an
ConstraintViolationExceptionExceptionCopyright © 2004–2020 The Apache Software Foundation. All rights reserved.