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, versionableNodeType
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 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, getNumberOfVersions
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureLockingSupported, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getPrefix, getProperty, getProperty, getQualifiedName, getSize, isSupported, needsMixin, run
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
protected VersionHistory vHistory
protected void setUp() throws Exception
setUp
in class AbstractVersionTest
Exception
protected void tearDown() throws Exception
tearDown
in class AbstractVersionTest
Exception
public void testAutocreatedRootVersion() throws RepositoryException
RepositoryException
public void testInitialNumberOfVersions() throws RepositoryException
RepositoryException
public void testInitialNumberOfLinearVersions() throws RepositoryException
RepositoryException
public void testInitiallyGetAllVersionsContainsTheRootVersion() throws RepositoryException
VersionHistory.getAllVersions()
contains the root version upon creation of the version history.RepositoryException
VersionHistory.getRootVersion()
public void testInitiallyGetAllLinearVersionsContainsTheRootAndTheBaseVersion() throws RepositoryException
VersionHistory.getAllLinearVersions()
contains both the root and the base version upon creation of the version history.RepositoryException
public void testGetAllVersions() throws RepositoryException
VersionHistory.getAllVersions()
returns an iterator
containing the root version and all versions that have been created by
Node.checkin().RepositoryException
VersionHistory.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().RepositoryException
VersionHistory.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)
.RepositoryException
VersionHistory.getAllFrozenNodes()
public void testGetVersionHistoryOnNonVersionableNode() throws RepositoryException
RepositoryException
public void testGetVersionHistoryOnNonVersionableNodeJcr2() throws RepositoryException
RepositoryException
public void testGetVersion() throws RepositoryException
RepositoryException
VersionHistory.getVersion(String)
public void testAccept() throws Exception
VersionHistory.accept(ItemVisitor)
accepts a
ItemVisitor and if the right Node is provided to that visitor.Exception
public void testAddMixin() throws Exception
VersionHistory.addMixin(String)
throws a ConstraintViolationException
Exception
public void testAddNode() throws Exception
VersionHistory.addNode(String)
and
VersionHistory.addNode(String, String)
throw a ConstraintViolationException
Exception
public void testCanAddMixin() throws Exception
VersionHistory.canAddMixin(String)
returns
false
Exception
public void testCancelMerge() throws Exception
VersionHistory.cancelMerge(Version)
throws an
UnsupportedRepositoryOperationException
Exception
public void testCancelMergeJcr2() throws Exception
VersionHistory.cancelMerge(Version)
throws an
UnsupportedRepositoryOperationException
Exception
public void testCheckin() throws Exception
VersionHistory.checkin()
throws an UnsupportedRepositoryOperationException
Exception
public void testCheckinJcr2() throws Exception
VersionHistory.checkin()
throws an UnsupportedRepositoryOperationException
Exception
public void testCheckout() throws Exception
VersionHistory.checkout()
throws an UnsupportedRepositoryOperationException
Exception
public void testCheckoutJcr2() throws Exception
VersionHistory.checkout()
throws an UnsupportedRepositoryOperationException
Exception
public void testDoneMerge() throws Exception
VersionHistory.doneMerge(Version)
throws an UnsupportedRepositoryOperationException
Exception
public void testDoneMergeJcr2() throws Exception
VersionHistory.doneMerge(Version)
throws an UnsupportedRepositoryOperationException
Exception
public void testGetAncestor() throws Exception
VersionHistory.getAncestor(int)
returns the right
ancestorException
public void testGetBaseVersion() throws Exception
VersionHistory.getBaseVersion()
throws an UnsupportedRepositoryOperationException
Exception
public void testGetBaseVersionJcr2() throws Exception
VersionHistory.getBaseVersion()
throws an UnsupportedRepositoryOperationException
Exception
public void testGetCorrespondingNodePath() throws Exception
VersionHistory.getCorrespondingNodePath(String)
returns the right pathException
public void testGetDepth() throws Exception
VersionHistory.getDepth()
returns the right depthException
public void testGetIndex() throws Exception
VersionHistory.getIndex()
returns the right indexException
public void testGetLock() throws Exception
VersionHistory.getLock()
throws an LockException
Exception
public void testGetLockJcr2() throws Exception
VersionHistory.getLock()
throws an LockException
Exception
public void testGetMixinNodeTypes() throws Exception
VersionHistory.getMixinNodeTypes()
does not return
null.Exception
public void testGetName() throws Exception
VersionHistory.getName()
returns the right nameException
public void testGetNode() throws Exception
VersionHistory.getNode(String)
returns the right
child NodeException
public void testGetNodes() throws Exception
VersionHistory.getNodes()
and
VersionHistory.getNodes(String)
returns the right child
NodeException
public void testGetParent() throws Exception
VersionHistory.getParent()
returns the right parent
NodeException
public void testGetPath() throws Exception
VersionHistory.getPath()
returns the right pathException
public void testGetPrimaryItem() throws Exception
VersionHistory.getPrimaryItem()
throws a ItemNotFoundException
Exception
public void testGetPrimaryNodeType() throws Exception
VersionHistory.getPrimaryNodeType()
returns the
right primary node type nt:versionHistory
Exception
public void testGetProperties() throws Exception
VersionHistory.getProperties()
and
VersionHistory.getProperties(String)
return the right
propertyException
public void testGetProperty() throws Exception
VersionHistory.getProperty(String)
returns the
right propertyException
public void testGetReferences() throws Exception
VersionHistory.getReferences()
returns the right
reference of the versionable nodeException
public void testGetSession() throws Exception
VersionHistory.getSession()
returns the right
sessionException
public void testGetUUID() throws Exception
VersionHistory.getUUID()
returns the right UUIDException
public void testGetIdentifier() throws Exception
VersionHistory.getIdentifier()
returns the right UUIDException
public void testGetVersionHistory() throws Exception
VersionHistory.getVersionHistory()
throws an UnsupportedRepositoryOperationException
Exception
public void testGetVersionHistoryJcr2() throws Exception
VersionHistory.getVersionHistory()
throws an UnsupportedRepositoryOperationException
Exception
public void testHasNode() throws Exception
VersionHistory.hasNode(String)
returns the right
boolean
valueException
public void testHasNodes() throws Exception
VersionHistory.hasNodes()
returns
true
Exception
public void testHasProperties() throws Exception
VersionHistory.hasProperties()
returns
true
Exception
public void testHasProperty() throws Exception
VersionHistory.hasProperty(String)
returns the
right boolean
valueException
public void testHoldsLock() throws Exception
VersionHistory.holdsLock()
returns
false
Exception
public void testHoldsLockJcr2() throws Exception
VersionHistory.holdsLock()
returns
false
Exception
public void testIsCheckedOut() throws Exception
VersionHistory.isCheckedOut()
returns
true
Exception
public void testIsCheckedOutJcr2() throws Exception
VersionHistory.isCheckedOut()
returns
true
Exception
public void testIsLocked() throws Exception
VersionHistory.isLocked()
returns
false
Exception
public void testIsLockedJcr2() throws Exception
VersionHistory.isLocked()
returns
false
Exception
public void testIsModified() throws Exception
VersionHistory.isModified()
returns
false
Exception
public void testIsNew() throws Exception
VersionHistory.isNew()
returns false
Exception
public void testIsNode() throws Exception
VersionHistory.isNode()
returns true
Exception
public void testIsNodeType() throws Exception
VersionHistory.isNodeType(String)
returns the right
boolean
valueException
public void testIsSame() throws Exception
VersionHistory.isSame()
returns the right
boolean
valueException
public void testLock() throws Exception
VersionHistory.lock(boolean, boolean)
throws a
LockException
Exception
public void testLockJcr2() throws Exception
VersionHistory.lock(boolean, boolean)
throws a
LockException
Exception
public void testMerge() throws Exception
VersionHistory.merge(String)
throws an
ConstraintViolationException
Exception
public void testOrderBefore() throws Exception
VersionHistory.orderBefore(String, String)
throws
an UnsupportedRepositoryOperationException
Exception
public void testRefresh() throws Exception
VersionHistory.refresh(boolean)
works as expected
(do nothing and return quietly)Exception
public void testRemove() throws Exception
VersionHistory.remove()
throws an ConstraintViolationException
Exception
public void testRemoveMixin() throws Exception
VersionHistory.removeMixin(String)
throws an NoSuchNodeTypeException
Exception
public 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
.Exception
public 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
.Exception
public void testRestoreByLabel() throws Exception
VersionHistory.restoreByLabel(String, boolean)
throws an UnsupportedRepositoryOperationException
Exception
public void testRestoreByLabelJcr2() throws Exception
VersionHistory.restoreByLabel(String, boolean)
throws an UnsupportedRepositoryOperationException
Exception
public 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)
ConstraintViolationException
Exception
public void testUnlock() throws Exception
VersionHistory.unlock()
throws a LockException
Exception
public void testUnlockJcr2() throws Exception
VersionHistory.unlock()
throws a LockException
Exception
public void testUpdate() throws Exception
VersionHistory.update(String)
throws an
ConstraintViolationException
Exception
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.