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

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.VersionLabelTest
All Implemented Interfaces:
junit.framework.Test

public class VersionLabelTest
extends AbstractVersionTest

VersionLabelTest covers methods related to version label such as


Field Summary
protected  java.lang.String jcrVersionLabels
          JCR Name jcr:versionLabels using the namespace resolver of the current session.
protected  javax.jcr.version.Version rootVersion
           
protected  java.lang.String versionLabel
           
protected  java.lang.String versionLabel2
           
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
VersionLabelTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testAddDuplicateVersionLabel()
          Test if VersionHistory.addVersionLabel(versionName, label, moveLabel) throws VersionException the label already exists and if moveLabel is false)
 void testAddMultipleVersionLabels()
          Test if multiple distinct version labels can be added for a given version.
 void testAddVersionCheckVersionLabelsNode()
          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.
 void testAddVersionLabel()
          Test if the number of labels available in the version history is increased by added a new label.
 void testAddVersionLabel2()
          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.
 void testGetVersionByLabel()
          Test if VersionHistory.getVersionByLabel(String) returns the version that has been specified with the addVersionLabel call.
 void testGetVersionLabels()
          Test VersionHistory.getVersionLabels() returns all labels present on the version history.
 void testGetVersionLabelsForInvalidVersion()
          Test if versionHistory.getVersionLabels(Version) throws a VersionException if the specified version is not in this version history.
 void testGetVersionLabelsForVersion()
          Test VersionHistory.getVersionLabels(Version) only returns all labels present for the specified version.
 void testHasVersionLabel()
          Test if VersionHistory.hasVersionLabel(String) returns true, if the label has beed successfully added before.
 void testHasVersionLabelForVersion()
          Test if VersionHistory.hasVersionLabel(Version, String) returns true, if the label has beed successfully added before to the specified version.
 void testMoveLabel()
          Test if the 'moveLabel' flag moves an existing version label.
 void testRemoveLabel()
          Test the removal of an version label that has successfully been added before.
 void testRemoveNonExistingLabel()
          Test the removal of an version label that does not exist (must throw VersionException).
 void testRestoreByLabelNonVersionableNode()
          Test calling Node.restoreByLabel(String, boolean) on a non-versionable node.
 
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

versionLabel

protected java.lang.String versionLabel

versionLabel2

protected java.lang.String versionLabel2

vHistory

protected javax.jcr.version.VersionHistory vHistory

rootVersion

protected javax.jcr.version.Version rootVersion

jcrVersionLabels

protected java.lang.String jcrVersionLabels
JCR Name jcr:versionLabels using the namespace resolver of the current session.

Constructor Detail

VersionLabelTest

public VersionLabelTest()
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

testAddVersionLabel

public void testAddVersionLabel()
                         throws javax.jcr.RepositoryException
Test if the number of labels available in the version history is increased by added a new label.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.addVersionLabel(String, String, boolean)

testAddVersionLabel2

public void testAddVersionLabel2()
                          throws javax.jcr.RepositoryException
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.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.addVersionLabel(String, String, boolean)

testAddVersionCheckVersionLabelsNode

public void testAddVersionCheckVersionLabelsNode()
                                          throws javax.jcr.RepositoryException
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.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.addVersionLabel(String, String, boolean)

testHasVersionLabel

public void testHasVersionLabel()
                         throws javax.jcr.RepositoryException
Test if VersionHistory.hasVersionLabel(String) returns true, if the label has beed successfully added before.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.hasVersionLabel(String)

testHasVersionLabelForVersion

public void testHasVersionLabelForVersion()
                                   throws javax.jcr.RepositoryException
Test if VersionHistory.hasVersionLabel(Version, String) returns true, if the label has beed successfully added before to the specified version.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.hasVersionLabel(javax.jcr.version.Version, String)

testAddMultipleVersionLabels

public void testAddMultipleVersionLabels()
                                  throws javax.jcr.RepositoryException
Test if multiple distinct version labels can be added for a given version.

Throws:
javax.jcr.RepositoryException

testAddDuplicateVersionLabel

public void testAddDuplicateVersionLabel()
                                  throws javax.jcr.RepositoryException
Test if VersionHistory.addVersionLabel(versionName, label, moveLabel) throws VersionException the label already exists and if moveLabel is false)

Throws:
javax.jcr.RepositoryException

testMoveLabel

public void testMoveLabel()
                   throws javax.jcr.RepositoryException
Test if the 'moveLabel' flag moves an existing version label.

Throws:
javax.jcr.RepositoryException
See Also:
with boolan flag equals true.

testRemoveNonExistingLabel

public void testRemoveNonExistingLabel()
                                throws javax.jcr.RepositoryException
Test the removal of an version label that does not exist (must throw VersionException).

Throws:
javax.jcr.RepositoryException

testRemoveLabel

public void testRemoveLabel()
                     throws javax.jcr.RepositoryException
Test the removal of an version label that has successfully been added before.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.removeVersionLabel(String)

testGetVersionByLabel

public void testGetVersionByLabel()
                           throws javax.jcr.RepositoryException
Test if VersionHistory.getVersionByLabel(String) returns the version that has been specified with the addVersionLabel call.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.getVersionByLabel(String)

testGetVersionLabels

public void testGetVersionLabels()
                          throws javax.jcr.RepositoryException
Test VersionHistory.getVersionLabels() returns all labels present on the version history.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.getVersionLabels()

testGetVersionLabelsForVersion

public void testGetVersionLabelsForVersion()
                                    throws javax.jcr.RepositoryException
Test VersionHistory.getVersionLabels(Version) only returns all labels present for the specified version.

Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.getVersionLabels(javax.jcr.version.Version)

testRestoreByLabelNonVersionableNode

public void testRestoreByLabelNonVersionableNode()
                                          throws javax.jcr.RepositoryException
Test calling Node.restoreByLabel(String, boolean) on a non-versionable node.

Throws:
javax.jcr.RepositoryException
See Also:
Node.restoreByLabel(String, boolean)

testGetVersionLabelsForInvalidVersion

public void testGetVersionLabelsForInvalidVersion()
                                           throws java.lang.Exception
Test if versionHistory.getVersionLabels(Version) throws a VersionException if the specified version is not in this version history.

Throws:
java.lang.Exception


Copyright © -2005 . All Rights Reserved.