Class VersionLabelTest
- 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.VersionLabelTest
-
- All Implemented Interfaces:
junit.framework.Test
public class VersionLabelTest extends AbstractVersionTest
VersionLabelTestcovers methods related to version label such asVersionHistory.addVersionLabel(String, String, boolean)VersionHistory.removeVersionLabel(String)Node.restoreByLabel(String, boolean)VersionHistory.getVersionByLabel(String)VersionHistory.getVersionLabels()VersionHistory.hasVersionLabel(javax.jcr.version.Version, String)VersionHistory.hasVersionLabel(String)VersionHistory.hasVersionLabel(javax.jcr.version.Version, String)
-
-
Field Summary
Fields Modifier and Type Field Description protected StringjcrVersionLabelsJCR Name jcr:versionLabels using the namespace resolver of the current session.protected Versionversionprotected StringversionLabelprotected StringversionLabel2protected 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 VersionLabelTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()protected voidtearDown()voidtestAddDuplicateVersionLabel()Test if VersionHistory.addVersionLabel(versionName, label, moveLabel) throws VersionException the label already exists and if moveLabel is false)voidtestAddDuplicateVersionLabelJcr2()Test if VersionHistory.addVersionLabel(versionName, label, moveLabel) throws VersionException the label already exists and if moveLabel is false)voidtestAddMultipleVersionLabels()Test if multiple distinct version labels can be added for a given version.voidtestAddVersionCheckVersionLabelsNode()Test if the a label added with VersionHistory.addVersionLabel(String, String, boolean) corresponds to adding a reference property to the jcr:versionLabels node of this history node, with the label as name of the property, and the reference targeting the version.voidtestAddVersionCheckVersionLabelsNodeJcr2()Test if the a label added with VersionHistory.addVersionLabel(String, String, boolean) corresponds to adding a reference property to the jcr:versionLabels node of this history node, with the label as name of the property, and the reference targeting the version.voidtestAddVersionLabel()Test if the number of labels available in the version history is increased by added a new label.voidtestAddVersionLabel2()Test if the a label added with VersionHistory.addVersionLabel(String, String, boolean) is present in the array returned by VersionHistory.getVersionLabels(), if the label has not been present before.voidtestGetVersionByLabel()Test if VersionHistory.getVersionByLabel(String) returns the version that has been specified with the addVersionLabel call.voidtestGetVersionLabels()Test VersionHistory.getVersionLabels() returns all labels present on the version history.voidtestGetVersionLabelsForInvalidVersion()Test if versionHistory.getVersionLabels(Version) throws a VersionException if the specified version is not in this version history.voidtestGetVersionLabelsForVersion()Test VersionHistory.getVersionLabels(Version) only returns all labels present for the specified version.voidtestGetVersionLabelsForVersionJcr2()Test VersionHistory.getVersionLabels(Version) only returns all labels present for the specified version.voidtestGetVersionLabelsJcr2()Test VersionHistory.getVersionLabels() returns all labels present on the version history.voidtestHasVersionLabel()Test if VersionHistory.hasVersionLabel(String) returns true, if the label has beed successfully added before.voidtestHasVersionLabelForVersion()Test if VersionHistory.hasVersionLabel(Version, String) returns true, if the label has beed successfully added before to the specified version.voidtestMoveLabel()Test if the 'moveLabel' flag moves an existing version label.voidtestMoveLabelJcr2()Test if the 'moveLabel' flag moves an existing version label.voidtestRemoveLabel()Test the removal of an version label that has successfully been added before.voidtestRemoveNonExistingLabel()Test the removal of an version label that does not exist (must throw VersionException).voidtestRestoreByLabelNonVersionableNode()Test calling Node.restoreByLabel(String, boolean) on a non-versionable node.voidtestRestoreByLabelNonVersionableNodeJcr2()Test calling Node.restoreByLabel(String, boolean) on a non-versionable node.voidtestVersionLabelsAfterRemovingVersion()Test VersionHistory.removeVersion(String) should remove all associated labels with removal of 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
-
versionLabel
protected String versionLabel
-
versionLabel2
protected String versionLabel2
-
vHistory
protected VersionHistory vHistory
-
version
protected Version version
-
jcrVersionLabels
protected String jcrVersionLabels
JCR Name jcr:versionLabels using the namespace resolver of the current session.
-
-
Method Detail
-
setUp
protected void setUp() throws Exception- Overrides:
setUpin classAbstractVersionTest- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception- Overrides:
tearDownin classAbstractVersionTest- Throws:
Exception
-
testAddVersionLabel
public void testAddVersionLabel() throws RepositoryExceptionTest if the number of labels available in the version history is increased by added a new label.- Throws:
RepositoryException- See Also:
VersionHistory.addVersionLabel(String, String, boolean)
-
testAddVersionLabel2
public void testAddVersionLabel2() throws RepositoryExceptionTest if the a label added with VersionHistory.addVersionLabel(String, String, boolean) is present in the array returned by VersionHistory.getVersionLabels(), if the label has not been present before.- Throws:
RepositoryException- See Also:
VersionHistory.addVersionLabel(String, String, boolean)
-
testAddVersionCheckVersionLabelsNode
public void testAddVersionCheckVersionLabelsNode() throws RepositoryExceptionTest if the a label added with VersionHistory.addVersionLabel(String, String, boolean) corresponds to adding a reference property to the jcr:versionLabels node of this history node, with the label as name of the property, and the reference targeting the version.- Throws:
RepositoryException- See Also:
VersionHistory.addVersionLabel(String, String, boolean)
-
testAddVersionCheckVersionLabelsNodeJcr2
public void testAddVersionCheckVersionLabelsNodeJcr2() throws RepositoryExceptionTest if the a label added with VersionHistory.addVersionLabel(String, String, boolean) corresponds to adding a reference property to the jcr:versionLabels node of this history node, with the label as name of the property, and the reference targeting the version.- Throws:
RepositoryException- See Also:
VersionHistory.addVersionLabel(String, String, boolean)
-
testHasVersionLabel
public void testHasVersionLabel() throws RepositoryExceptionTest if VersionHistory.hasVersionLabel(String) returns true, if the label has beed successfully added before.- Throws:
RepositoryException- See Also:
VersionHistory.hasVersionLabel(String)
-
testHasVersionLabelForVersion
public void testHasVersionLabelForVersion() throws RepositoryExceptionTest if VersionHistory.hasVersionLabel(Version, String) returns true, if the label has beed successfully added before to the specified version.
-
testAddMultipleVersionLabels
public void testAddMultipleVersionLabels() throws RepositoryExceptionTest if multiple distinct version labels can be added for a given version.- Throws:
RepositoryException
-
testAddDuplicateVersionLabel
public void testAddDuplicateVersionLabel() throws RepositoryExceptionTest if VersionHistory.addVersionLabel(versionName, label, moveLabel) throws VersionException the label already exists and if moveLabel is false)- Throws:
RepositoryException
-
testAddDuplicateVersionLabelJcr2
public void testAddDuplicateVersionLabelJcr2() throws RepositoryExceptionTest if VersionHistory.addVersionLabel(versionName, label, moveLabel) throws VersionException the label already exists and if moveLabel is false)- Throws:
RepositoryException
-
testMoveLabel
public void testMoveLabel() throws RepositoryExceptionTest if the 'moveLabel' flag moves an existing version label.- Throws:
RepositoryException- See Also:
with boolan flag equals true.
-
testMoveLabelJcr2
public void testMoveLabelJcr2() throws RepositoryExceptionTest if the 'moveLabel' flag moves an existing version label.- Throws:
RepositoryException- See Also:
with boolan flag equals true.
-
testRemoveNonExistingLabel
public void testRemoveNonExistingLabel() throws RepositoryExceptionTest the removal of an version label that does not exist (must throw VersionException).- Throws:
RepositoryException
-
testRemoveLabel
public void testRemoveLabel() throws RepositoryExceptionTest the removal of an version label that has successfully been added before.- Throws:
RepositoryException- See Also:
VersionHistory.removeVersionLabel(String)
-
testGetVersionByLabel
public void testGetVersionByLabel() throws RepositoryExceptionTest if VersionHistory.getVersionByLabel(String) returns the version that has been specified with the addVersionLabel call.- Throws:
RepositoryException- See Also:
VersionHistory.getVersionByLabel(String)
-
testGetVersionLabels
public void testGetVersionLabels() throws RepositoryExceptionTest VersionHistory.getVersionLabels() returns all labels present on the version history.- Throws:
RepositoryException- See Also:
VersionHistory.getVersionLabels()
-
testGetVersionLabelsJcr2
public void testGetVersionLabelsJcr2() throws RepositoryExceptionTest VersionHistory.getVersionLabels() returns all labels present on the version history.- Throws:
RepositoryException- See Also:
VersionHistory.getVersionLabels()
-
testGetVersionLabelsForVersion
public void testGetVersionLabelsForVersion() throws RepositoryExceptionTest VersionHistory.getVersionLabels(Version) only returns all labels present for the specified version.
-
testGetVersionLabelsForVersionJcr2
public void testGetVersionLabelsForVersionJcr2() throws RepositoryExceptionTest VersionHistory.getVersionLabels(Version) only returns all labels present for the specified version.
-
testVersionLabelsAfterRemovingVersion
public void testVersionLabelsAfterRemovingVersion() throws RepositoryExceptionTest VersionHistory.removeVersion(String) should remove all associated labels with removal of version- Throws:
RepositoryException- See Also:
VersionHistory.removeVersion(String)
-
testRestoreByLabelNonVersionableNode
public void testRestoreByLabelNonVersionableNode() throws RepositoryExceptionTest calling Node.restoreByLabel(String, boolean) on a non-versionable node.- Throws:
RepositoryException- See Also:
Node.restoreByLabel(String, boolean)
-
testRestoreByLabelNonVersionableNodeJcr2
public void testRestoreByLabelNonVersionableNodeJcr2() throws RepositoryExceptionTest calling Node.restoreByLabel(String, boolean) on a non-versionable node.- Throws:
RepositoryException- See Also:
Node.restoreByLabel(String, boolean)
-
-