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.| Modifier and Type | Field and Description |
|---|---|
protected javax.jcr.version.Version |
version |
protected javax.jcr.version.Version |
version2 |
protected javax.jcr.Node |
versionableNode2 |
protected javax.jcr.version.VersionHistory |
vHistory |
nonVersionableNode, nonVersionableNodeType, propertyValue, versionableNode, versionableNodeTypeisReadOnly, 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, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testNodeTypeTestRoot, testPath, testRoot, testRootNode, vf, workspaceName| Constructor and Description |
|---|
RemoveVersionTest() |
| Modifier and Type | Method and Description |
|---|---|
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 |
testRemoveAllBut2()
Checks if all versions but the base and root one can be removed.
|
void |
testRemoveBaseVersion()
Checks if all versions by the base and root one can be removed.
|
void |
testRemovedInvalid()
Test removed version gets invalid
|
void |
testRemoveInvalidVersion()
Test if removing a version from the version history throws a VersionException
if the specified version does not exist.
|
void |
testRemoveRootVersion()
Checks if all versions by the base and root one can be removed.
|
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.
|
createVersionableNode, getNumberOfVersionscheckSupportedOption, cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureKnowsNodeType, ensureLockingSupported, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getPrefix, getProperty, getProperty, getQualifiedName, getSize, isSupported, needsMixin, runassertEquals, 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, toStringprotected javax.jcr.Node versionableNode2
protected javax.jcr.version.Version version
protected javax.jcr.version.Version version2
protected javax.jcr.version.VersionHistory vHistory
protected void setUp()
throws Exception
setUp in class AbstractVersionTestExceptionprotected void tearDown()
throws Exception
tearDown in class AbstractVersionTestExceptionpublic void testRemovedInvalid()
throws Exception
Exceptionpublic void testRemoveVersionAdjustPredecessorSet()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void testRemoveVersionAdjustSucessorSet()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void testRemoveInvalidVersion()
throws javax.jcr.RepositoryException,
NotExecutableException
javax.jcr.RepositoryExceptionNotExecutableExceptionpublic void testReferentialIntegrityException()
throws javax.jcr.RepositoryException,
NotExecutableException
VersionHistory.removeVersion(String)
throws a ReferentialIntegrityException if the named
version is still referenced by another node.
nodetype name of a node type that supports a reference
property.
nodename4 name of the node created with nodetype.
propertyname1 a single value reference property available
in nodetype.
javax.jcr.RepositoryExceptionNotExecutableExceptionpublic void testRemoveAllBut2()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void testRemoveRootVersion()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void testRemoveBaseVersion()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.