org.apache.jackrabbit.test.api.version
Class VersionTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jackrabbit.test.JUnitTest
              extended by org.apache.jackrabbit.test.AbstractJCRTest
                  extended by org.apache.jackrabbit.test.api.version.AbstractVersionTest
                      extended by 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 the Version 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, 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
VersionTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testAccept()
          Tests if Version.accept(ItemVisitor) accepts a ItemVisitor and if the right Node is provided to that visitor.
 void testAddMixin()
          Tests if Version.addMixin(String) throws a ConstraintViolationException
 void testAddNode()
          Tests if Version.addNode(String) and Version.addNode(String, String) throw a ConstraintViolationException
 void testCanAddMixin()
          Tests if Version.canAddMixin(String) returns false
 void testCancelMerge()
          Tests if Version.cancelMerge(Version) throws an UnsupportedRepositoryOperationException
 void testCancelMergeJcr2()
          Tests if Version.cancelMerge(Version) throws an UnsupportedRepositoryOperationException
 void testCheckin()
          Tests if Version.checkin() throws an UnsupportedRepositoryOperationException
 void testCheckinJcr2()
          Tests if Version.checkin() throws an UnsupportedRepositoryOperationException
 void testCheckout()
          Tests if Version.checkout() throws an UnsupportedRepositoryOperationException
 void testCheckoutJcr2()
          Tests if Version.checkout() throws an UnsupportedRepositoryOperationException
 void testDoneMerge()
          Tests if Version.doneMerge(Version) throws an UnsupportedRepositoryOperationException
 void testDoneMergeJcr2()
          Tests if Version.doneMerge(Version) throws an UnsupportedRepositoryOperationException
 void testFrozenUUID()
          Tests if the jcr:frozenUuid property has the correct type
 void testGetAncestor()
          Tests if Version.getAncestor(int) returns the right ancestor
 void testGetBaseVersion()
          Tests if Version.getBaseVersion() throws an UnsupportedRepositoryOperationException
 void testGetBaseVersionJcr2()
          Tests if Version.getBaseVersion() throws an UnsupportedRepositoryOperationException
 void testGetCorrespondingNodePath()
          Tests if Version.getCorrespondingNodePath(String) returns the right path
 void testGetDepth()
          Tests if Version.getDepth() returns the right depth
 void testGetIndex()
          Tests if Version.getIndex() returns the right index
 void testGetLock()
          Tests if Version.getLock() throws a LockException
 void testGetLockJcr2()
          Tests if Version.getLock() throws a LockException
 void testGetMixinNodeTypes()
          Tests if Version.getMixinNodeTypes() does not return null.
 void testGetName()
          Tests if Version.getName() returns the right name
 void testGetNode()
          Tests if Version.getNode(String) returns the right child Node
 void testGetNodes()
          Tests if Version.getNodes() and Version.getNodes(String) returns the right child Node
 void testGetParent()
          Tests if Version.getParent() returns the right parent Node
 void testGetPath()
          Tests if Version.getPath() returns the right path
 void testGetPrimaryItem()
          Tests if Version.getPrimaryItem() throws a ItemNotFoundException
 void testGetPrimaryNodeType()
          Tests if Version.getPrimaryNodeType() returns the right primary node type nt:version
 void testGetProperties()
          Tests if Version.getProperties() and Version.getProperties(String) return the right property
 void testGetProperty()
          Tests if Version.getProperty(String) returns the right property
 void testGetSession()
          Tests if Version.getSession() returns the right session
 void testGetUUID()
          Tests if Version.getUUID() returns the right UUID
 void testGetVersionHistory()
          Tests if Version.getVersionHistory() throws an UnsupportedRepositoryOperationException
 void testGetVersionHistoryJcr2()
          Tests if Version.getVersionHistory() throws an UnsupportedRepositoryOperationException
 void testHasNode()
          Tests if Version.hasNode(String) returns the right boolean value
 void testHasNodes()
          Tests if Version.hasNodes() returns true
 void testHasProperties()
          Tests if Version.hasProperties() returns true
 void testHasProperty()
          Tests if Version.hasProperty(String) returns the right boolean value
 void testHoldsLock()
          Tests if Version.holdsLock() returns false
 void testHoldsLockJcr2()
          Tests if Version.holdsLock() returns false
 void testIsCheckedOut()
          Tests if Version.isCheckedOut() returns true
 void testIsCheckedOutJcr2()
          Tests if Version.isCheckedOut() returns true
 void testIsLocked()
          Tests if Version.isLocked() returns false
 void testIsLockedJcr2()
          Tests if Version.isLocked() returns false
 void testIsModified()
          Tests if Version.isModified() returns false
 void testIsNew()
          Tests if Version.isNew() returns false
 void testIsNode()
          Tests if Version.isNode() returns true
 void testIsNodeType()
          Tests if Version.isNodeType(String) returns the right boolean value
 void testIsSame()
          Tests if Version.isSame() returns the right boolean value
 void testIsSameJcr2()
          Tests if Version.isSame() returns the right boolean value
 void testLock()
          Tests if Version.lock(boolean, boolean) throws a LockException
 void testLockJcr2()
          Tests if Version.lock(boolean, boolean) throws a LockException
 void testMerge()
          Tests if Version.merge(String) throws an ConstraintViolationException
 void testOrderBefore()
          Tests if Version.orderBefore(String, String) throws an UnsupportedRepositoryOperationException
 void testRefresh()
          Tests if Version.refresh(boolean) works as expected (do nothing and return quietly)
 void testRemove()
          Tests if Version.remove() throws an ConstraintViolationException
 void testRemoveMixin()
          Tests if Version.removeMixin(String) throws an ConstraintViolationException
 void testRestore()
          Tests if Version.restore(String, boolean) and Version.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and Version.restore(Version, String, boolean) throws a ConstraintViolationException.
 void testRestoreByLabel()
          Tests if Version.restoreByLabel(String, boolean) throws an UnsupportedRepositoryOperationException
 void testRestoreByLabelJcr2()
          Tests if Version.restoreByLabel(String, boolean) throws an UnsupportedRepositoryOperationException
 void testRestoreJcr2()
          Tests if Version.restore(String, boolean) and Version.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and Version.restore(Version, String, boolean) throws a ConstraintViolationException.
 void testSetProperty()
          Tests 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) all throw a ConstraintViolationException
 void testUnlock()
          Tests if Version.unlock() throws a LockException
 void testUnlockJcr2()
          Tests if Version.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
 

Constructor Detail

VersionTest

public VersionTest()
Method Detail

setUp

protected void setUp()
              throws Exception
Overrides:
setUp in class AbstractVersionTest
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class AbstractVersionTest
Throws:
Exception

testAccept

public void testAccept()
                throws Exception
Tests if Version.accept(ItemVisitor) accepts a ItemVisitor and if the right Node is provided to that visitor.

Throws:
Exception

testAddMixin

public void testAddMixin()
                  throws Exception
Tests if Version.addMixin(String) throws a ConstraintViolationException

Throws:
Exception

testAddNode

public void testAddNode()
                 throws Exception
Tests if Version.addNode(String) and Version.addNode(String, String) throw a ConstraintViolationException

Throws:
Exception

testCanAddMixin

public void testCanAddMixin()
                     throws Exception
Tests if Version.canAddMixin(String) returns false

Throws:
Exception

testCancelMerge

public void testCancelMerge()
                     throws Exception
Tests if Version.cancelMerge(Version) throws an UnsupportedRepositoryOperationException

Throws:
Exception

testCancelMergeJcr2

public void testCancelMergeJcr2()
                         throws Exception
Tests if Version.cancelMerge(Version) throws an UnsupportedRepositoryOperationException

Throws:
Exception

testCheckin

public void testCheckin()
                 throws Exception
Tests if Version.checkin() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testCheckinJcr2

public void testCheckinJcr2()
                     throws Exception
Tests if Version.checkin() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testCheckout

public void testCheckout()
                  throws Exception
Tests if Version.checkout() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testCheckoutJcr2

public void testCheckoutJcr2()
                      throws Exception
Tests if Version.checkout() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testDoneMerge

public void testDoneMerge()
                   throws Exception
Tests if Version.doneMerge(Version) throws an UnsupportedRepositoryOperationException

Throws:
Exception

testDoneMergeJcr2

public void testDoneMergeJcr2()
                       throws Exception
Tests if Version.doneMerge(Version) throws an UnsupportedRepositoryOperationException

Throws:
Exception

testGetAncestor

public void testGetAncestor()
                     throws Exception
Tests if Version.getAncestor(int) returns the right ancestor

Throws:
Exception

testGetBaseVersion

public void testGetBaseVersion()
                        throws Exception
Tests if Version.getBaseVersion() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testGetBaseVersionJcr2

public void testGetBaseVersionJcr2()
                            throws Exception
Tests if Version.getBaseVersion() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testGetCorrespondingNodePath

public void testGetCorrespondingNodePath()
                                  throws Exception
Tests if Version.getCorrespondingNodePath(String) returns the right path

Throws:
Exception

testGetDepth

public void testGetDepth()
                  throws Exception
Tests if Version.getDepth() returns the right depth

Throws:
Exception

testGetIndex

public void testGetIndex()
                  throws Exception
Tests if Version.getIndex() returns the right index

Throws:
Exception

testGetLock

public void testGetLock()
                 throws Exception
Tests if Version.getLock() throws a LockException

Throws:
Exception

testGetLockJcr2

public void testGetLockJcr2()
                     throws Exception
Tests if Version.getLock() throws a LockException

Throws:
Exception

testGetMixinNodeTypes

public void testGetMixinNodeTypes()
                           throws Exception
Tests if Version.getMixinNodeTypes() does not return null.

Throws:
Exception

testGetName

public void testGetName()
                 throws Exception
Tests if Version.getName() returns the right name

Throws:
Exception

testGetNode

public void testGetNode()
                 throws Exception
Tests if Version.getNode(String) returns the right child Node

Throws:
Exception

testGetNodes

public void testGetNodes()
                  throws Exception
Tests if Version.getNodes() and Version.getNodes(String) returns the right child Node

Throws:
Exception

testGetParent

public void testGetParent()
                   throws Exception
Tests if Version.getParent() returns the right parent Node

Throws:
Exception

testGetPath

public void testGetPath()
                 throws Exception
Tests if Version.getPath() returns the right path

Throws:
Exception

testGetPrimaryItem

public void testGetPrimaryItem()
                        throws Exception
Tests if Version.getPrimaryItem() throws a ItemNotFoundException

Throws:
Exception

testGetPrimaryNodeType

public void testGetPrimaryNodeType()
                            throws Exception
Tests if Version.getPrimaryNodeType() returns the right primary node type nt:version

Throws:
Exception

testGetProperties

public void testGetProperties()
                       throws Exception
Tests if Version.getProperties() and Version.getProperties(String) return the right property

Throws:
Exception

testGetProperty

public void testGetProperty()
                     throws Exception
Tests if Version.getProperty(String) returns the right property

Throws:
Exception

testGetSession

public void testGetSession()
                    throws Exception
Tests if Version.getSession() returns the right session

Throws:
Exception

testGetVersionHistory

public void testGetVersionHistory()
                           throws Exception
Tests if Version.getVersionHistory() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testGetVersionHistoryJcr2

public void testGetVersionHistoryJcr2()
                               throws Exception
Tests if Version.getVersionHistory() throws an UnsupportedRepositoryOperationException

Throws:
Exception

testGetUUID

public void testGetUUID()
                 throws Exception
Tests if Version.getUUID() returns the right UUID

Throws:
Exception

testHasNode

public void testHasNode()
                 throws Exception
Tests if Version.hasNode(String) returns the right boolean value

Throws:
Exception

testHasNodes

public void testHasNodes()
                  throws Exception
Tests if Version.hasNodes() returns true

Throws:
Exception

testHasProperties

public void testHasProperties()
                       throws Exception
Tests if Version.hasProperties() returns true

Throws:
Exception

testHasProperty

public void testHasProperty()
                     throws Exception
Tests if Version.hasProperty(String) returns the right boolean value

Throws:
Exception

testHoldsLock

public void testHoldsLock()
                   throws Exception
Tests if Version.holdsLock() returns false

Throws:
Exception

testHoldsLockJcr2

public void testHoldsLockJcr2()
                       throws Exception
Tests if Version.holdsLock() returns false

Throws:
Exception

testIsCheckedOut

public void testIsCheckedOut()
                      throws Exception
Tests if Version.isCheckedOut() returns true

Throws:
Exception

testIsCheckedOutJcr2

public void testIsCheckedOutJcr2()
                          throws Exception
Tests if Version.isCheckedOut() returns true

Throws:
Exception

testIsLocked

public void testIsLocked()
                  throws Exception
Tests if Version.isLocked() returns false

Throws:
Exception

testIsLockedJcr2

public void testIsLockedJcr2()
                      throws Exception
Tests if Version.isLocked() returns false

Throws:
Exception

testIsModified

public void testIsModified()
                    throws Exception
Tests if Version.isModified() returns false

Throws:
Exception

testIsNew

public void testIsNew()
               throws Exception
Tests if Version.isNew() returns false

Throws:
Exception

testIsNode

public void testIsNode()
                throws Exception
Tests if Version.isNode() returns true

Throws:
Exception

testIsNodeType

public void testIsNodeType()
                    throws Exception
Tests if Version.isNodeType(String) returns the right boolean value

Throws:
Exception

testIsSame

public void testIsSame()
                throws Exception
Tests if Version.isSame() returns the right boolean value

Throws:
Exception

testIsSameJcr2

public void testIsSameJcr2()
                    throws Exception
Tests if Version.isSame() returns the right boolean value

Throws:
Exception

testLock

public void testLock()
              throws Exception
Tests if Version.lock(boolean, boolean) throws a LockException

Throws:
Exception

testLockJcr2

public void testLockJcr2()
                  throws Exception
Tests if Version.lock(boolean, boolean) throws a LockException

Throws:
Exception

testMerge

public void testMerge()
               throws Exception
Tests if Version.merge(String) throws an ConstraintViolationException

Throws:
Exception

testOrderBefore

public void testOrderBefore()
                     throws Exception
Tests if Version.orderBefore(String, String) throws an UnsupportedRepositoryOperationException

Throws:
Exception

testRefresh

public void testRefresh()
                 throws Exception
Tests if Version.refresh(boolean) works as expected (do nothing and return quietly)

Throws:
Exception

testRemove

public void testRemove()
                throws Exception
Tests if Version.remove() throws an ConstraintViolationException

Throws:
Exception

testRemoveMixin

public void testRemoveMixin()
                     throws Exception
Tests if Version.removeMixin(String) throws an ConstraintViolationException

Throws:
Exception

testRestore

public void testRestore()
                 throws Exception
Tests if Version.restore(String, boolean) and Version.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and Version.restore(Version, String, boolean) throws a ConstraintViolationException.

Throws:
Exception

testRestoreJcr2

public void testRestoreJcr2()
                     throws Exception
Tests if Version.restore(String, boolean) and Version.restore(Version, boolean) throw an UnsupportedRepositoryOperationException and Version.restore(Version, String, boolean) throws a ConstraintViolationException.

Throws:
Exception

testRestoreByLabel

public void testRestoreByLabel()
                        throws Exception
Tests if Version.restoreByLabel(String, boolean) throws an UnsupportedRepositoryOperationException

Throws:
Exception

testRestoreByLabelJcr2

public void testRestoreByLabelJcr2()
                            throws Exception
Tests if Version.restoreByLabel(String, boolean) throws an UnsupportedRepositoryOperationException

Throws:
Exception

testSetProperty

public void testSetProperty()
                     throws Exception
Tests if all throw a ConstraintViolationException

Throws:
Exception

testUnlock

public void testUnlock()
                throws Exception
Tests if Version.unlock() throws a LockException

Throws:
Exception

testUnlockJcr2

public void testUnlockJcr2()
                    throws Exception
Tests if Version.unlock() throws a LockException

Throws:
Exception

testUpdate

public void testUpdate()
                throws Exception
Tests if VersionHistory.update(String) throws an ConstraintViolationException

Throws:
Exception

testFrozenUUID

public void testFrozenUUID()
                    throws Exception
Tests if the jcr:frozenUuid property has the correct type

Throws:
Exception


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.