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

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.apache.jackrabbit.test.JUnitTest
              extended byorg.apache.jackrabbit.test.AbstractJCRTest
                  extended byorg.apache.jackrabbit.test.api.version.AbstractVersionTest
                      extended byorg.apache.jackrabbit.test.api.version.RemoveVersionTest
All Implemented Interfaces:
junit.framework.Test

public class RemoveVersionTest
extends AbstractVersionTest

RemoveVersionTest provides test methods covering VersionHistory.removeVersion(String). Please note, that removing versions is defined to be an optional feature in the JSR 170 specification. The setup therefore includes a initial removal, in order to test, whether removing versions is supported.


Field Summary
protected  javax.jcr.version.Version version
           
protected  javax.jcr.version.Version version2
           
protected  javax.jcr.Node versionableNode2
           
protected  javax.jcr.version.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
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, jcrlockIsDeep, jcrLockOwner, jcrMergeFailed, jcrMixinTypes, jcrPredecessors, jcrPrimaryType, jcrRootVersion, jcrSuccessors, jcrSystem, jcrUUID, jcrVersionHistory, mixLockable, mixReferenceable, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testPath, testRoot, testRootNode, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log
 
Constructor Summary
RemoveVersionTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testReferentialIntegrityException()
          Checks if VersionHistory.removeVersion(String) throws a ReferentialIntegrityException if the named version is still referenced by another node.
 void testRemoveInvalidVersion()
          Test if removing a version from the version history throws a VersionException if the specified version does not exist.
 void testRemoveVersionAdjustPredecessorSet()
          Test if the predecessors of the removed version are made predecessor of its original successor version.
 void testRemoveVersionAdjustSucessorSet()
          Test if the successors of the removed version are made successors of all predecessors of the the removed version.
 
Methods inherited from class org.apache.jackrabbit.test.api.version.AbstractVersionTest
createVersionableNode, getNumberOfVersions
 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
createRandomString, getNonExistingWorkspaceName, getProperty, getSize, 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

versionableNode2

protected javax.jcr.Node versionableNode2

version

protected javax.jcr.version.Version version

version2

protected javax.jcr.version.Version version2

vHistory

protected javax.jcr.version.VersionHistory vHistory
Constructor Detail

RemoveVersionTest

public RemoveVersionTest()
Method Detail

setUp

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

tearDown

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

testRemoveVersionAdjustPredecessorSet

public void testRemoveVersionAdjustPredecessorSet()
                                           throws javax.jcr.RepositoryException
Test if the predecessors of the removed version are made predecessor of its original successor version.

Throws:
javax.jcr.RepositoryException

testRemoveVersionAdjustSucessorSet

public void testRemoveVersionAdjustSucessorSet()
                                        throws javax.jcr.RepositoryException
Test if the successors of the removed version are made successors of all predecessors of the the removed version.

Throws:
javax.jcr.RepositoryException

testRemoveInvalidVersion

public void testRemoveInvalidVersion()
                              throws javax.jcr.RepositoryException,
                                     NotExecutableException
Test if removing a version from the version history throws a VersionException if the specified version does not exist.

Throws:
javax.jcr.RepositoryException
NotExecutableException

testReferentialIntegrityException

public void testReferentialIntegrityException()
                                       throws javax.jcr.RepositoryException
Checks if VersionHistory.removeVersion(String) throws a ReferentialIntegrityException if the named version is still referenced by another node.

Throws:
javax.jcr.RepositoryException


Copyright © -2005 . All Rights Reserved.