Class RemoveVersionTest
- java.lang.Object
-
- junit.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.RemoveVersionTest
-
- All Implemented Interfaces:
junit.framework.Test
public class RemoveVersionTest extends AbstractVersionTest
RemoveVersionTestprovides test methods coveringVersionHistory.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
Fields Modifier and Type Field Description protected Versionversionprotected Versionversion2protected NodeversionableNode2protected VersionHistoryvHistory-
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, 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 Summary
Constructors Constructor Description RemoveVersionTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()protected voidtearDown()voidtestReferentialIntegrityException()Checks ifVersionHistory.removeVersion(String)throws aReferentialIntegrityExceptionif the named version is still referenced by another node.voidtestRemoveAllBut2()Checks if all versions but the base and root one can be removed.voidtestRemoveBaseVersion()Checks if all versions by the base and root one can be removed.voidtestRemovedInvalid()Test removed version gets invalidvoidtestRemoveInvalidVersion()Test if removing a version from the version history throws a VersionException if the specified version does not exist.voidtestRemoveRootVersion()Checks if all versions by the base and root one can be removed.voidtestRemoveVersionAdjustPredecessorSet()Test if the predecessors of the removed version are made predecessor of its original successor version.voidtestRemoveVersionAdjustSucessorSet()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
checkSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureLockingSupported, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getPrefix, getProperty, getProperty, getQualifiedName, getSize, isSupported, needsMixin, run
-
Methods inherited from class junit.framework.TestCase
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
-
-
-
-
Field Detail
-
versionableNode2
protected Node versionableNode2
-
version
protected Version version
-
version2
protected Version version2
-
vHistory
protected VersionHistory vHistory
-
-
Method Detail
-
setUp
protected void setUp() throws Exception- Overrides:
setUpin classAbstractVersionTest- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception- Overrides:
tearDownin classAbstractVersionTest- Throws:
Exception
-
testRemovedInvalid
public void testRemovedInvalid() throws ExceptionTest removed version gets invalid- Throws:
Exception
-
testRemoveVersionAdjustPredecessorSet
public void testRemoveVersionAdjustPredecessorSet() throws RepositoryExceptionTest if the predecessors of the removed version are made predecessor of its original successor version.- Throws:
RepositoryException
-
testRemoveVersionAdjustSucessorSet
public void testRemoveVersionAdjustSucessorSet() throws RepositoryExceptionTest if the successors of the removed version are made successors of all predecessors of the the removed version.- Throws:
RepositoryException
-
testRemoveInvalidVersion
public void testRemoveInvalidVersion() throws RepositoryException, NotExecutableExceptionTest if removing a version from the version history throws a VersionException if the specified version does not exist.
-
testReferentialIntegrityException
public void testReferentialIntegrityException() throws RepositoryException, NotExecutableExceptionChecks ifVersionHistory.removeVersion(String)throws aReferentialIntegrityExceptionif the named version is still referenced by another node.nodetypename of a node type that supports a reference property.nodename4name of the node created withnodetype.propertyname1a single value reference property available innodetype.
-
testRemoveAllBut2
public void testRemoveAllBut2() throws RepositoryExceptionChecks if all versions but the base and root one can be removed.- Throws:
RepositoryException
-
testRemoveRootVersion
public void testRemoveRootVersion() throws RepositoryExceptionChecks if all versions by the base and root one can be removed.- Throws:
RepositoryException
-
testRemoveBaseVersion
public void testRemoveBaseVersion() throws RepositoryExceptionChecks if all versions by the base and root one can be removed.- Throws:
RepositoryException
-
-