|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.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.VersionHistoryTest
public class VersionHistoryTest
VersionHistoryTest
provides test methods related to version
history methods and general version history issues.
Field Summary | |
---|---|
protected VersionHistory |
vHistory
|
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, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testPath, testRoot, testRootNode, vf, workspaceName |
Fields inherited from class org.apache.jackrabbit.test.JUnitTest |
---|
log |
Constructor Summary | |
---|---|
VersionHistoryTest()
|
Method Summary | |
---|---|
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 |
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, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getProperty, getProperty, getSize, isSupported, needsMixin, run |
Methods inherited from class junit.framework.TestCase |
---|
countTestCases, createResult, getName, run, runBare, runTest, setName, toString |
Methods inherited from class junit.framework.Assert |
---|
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, fail, fail |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected VersionHistory vHistory
Constructor Detail |
---|
public VersionHistoryTest()
Method Detail |
---|
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
ancestor
Exception
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 path
Exception
public void testGetDepth() throws Exception
VersionHistory.getDepth()
returns the right depth
Exception
public void testGetIndex() throws Exception
VersionHistory.getIndex()
returns the right index
Exception
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 name
Exception
public void testGetNode() throws Exception
VersionHistory.getNode(String)
returns the right
child Node
Exception
public void testGetNodes() throws Exception
VersionHistory.getNodes()
and
VersionHistory.getNodes(String)
returns the right child
Node
Exception
public void testGetParent() throws Exception
VersionHistory.getParent()
returns the right parent
Node
Exception
public void testGetPath() throws Exception
VersionHistory.getPath()
returns the right path
Exception
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
property
Exception
public void testGetProperty() throws Exception
VersionHistory.getProperty(String)
returns the
right property
Exception
public void testGetReferences() throws Exception
VersionHistory.getReferences()
returns the right
reference of the versionable node
Exception
public void testGetSession() throws Exception
VersionHistory.getSession()
returns the right
session
Exception
public void testGetUUID() throws Exception
VersionHistory.getUUID()
returns the right UUID
Exception
public void testGetIdentifier() throws Exception
VersionHistory.getIdentifier()
returns the right UUID
Exception
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
value
Exception
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
value
Exception
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
value
Exception
public void testIsSame() throws Exception
VersionHistory.isSame()
returns the right
boolean
value
Exception
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |