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

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.RestoreTest
                          extended byorg.apache.jackrabbit.test.api.version.WorkspaceRestoreTest
All Implemented Interfaces:
junit.framework.Test

public class WorkspaceRestoreTest
extends RestoreTest

WorkspaceRestoreTest provides test methods for the Workspace.restore(javax.jcr.version.Version[], boolean) method.


Field Summary
 
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
WorkspaceRestoreTest()
           
 
Method Summary
protected  void setUp()
           
protected  void tearDown()
           
 void testWorkspaceRestoreHasCorrespondingNode()
          Test if VersionException is thrown if the specified version array does not contain a version that has a corresponding node in this workspace.
 void testWorkspaceRestoreOnCheckedInNode()
          Test if workspace-restoring a node works on checked-in node.
 void testWorkspaceRestoreOnCheckedOutNode()
          Test if workspace-restoring a node works on checked-out node.
 void testWorkspaceRestoreWithParent()
          Test if Workspace.restore(Version[], boolean) succeeds if the following two preconditions are fulfilled: For every version V in S that corresponds to a missing node in the workspace, there must also be a parent of V in S. S must contain at least one version that corresponds to an existing node in the workspace.
 void testWorkspaceRestoreWithPendingChanges()
          Test if InvalidItemStateException is thrown if the session affected by Workspace.restore(Version[], boolean) has pending changes.
 void testWorkspaceRestoreWithRemoveExisting()
          Test if the removeExisting-flag removes an existing node in case of uuid conflict.
 void testWorkspaceRestoreWithUUIDConflict()
          Tests if restoring the Version of an existing node throws an ItemExistsException if removeExisting is set to FALSE.
 
Methods inherited from class org.apache.jackrabbit.test.api.version.RestoreTest
testRestoreInvalidVersion, testRestoreInvalidVersion2, testRestoreNonVersionableNode, testRestoreNonVersionableNode2, testRestoreNonVersionableNode3, testRestoreOnCheckedInNode, testRestoreOnCheckedOutNode, testRestoreRootVersionFail, testRestoreSetsBaseVersion, testRestoreSetsIsCheckedOutToFalse, testRestoreWithInvalidVersion, testRestoreWithPendingChanges, testRestoreWithUUIDConflict
 
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
 

Constructor Detail

WorkspaceRestoreTest

public WorkspaceRestoreTest()
Method Detail

setUp

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

tearDown

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

testWorkspaceRestoreWithPendingChanges

public void testWorkspaceRestoreWithPendingChanges()
                                            throws javax.jcr.RepositoryException
Test if InvalidItemStateException is thrown if the session affected by Workspace.restore(Version[], boolean) has pending changes.

Throws:
javax.jcr.RepositoryException

testWorkspaceRestoreHasCorrespondingNode

public void testWorkspaceRestoreHasCorrespondingNode()
                                              throws javax.jcr.RepositoryException
Test if VersionException is thrown if the specified version array does not contain a version that has a corresponding node in this workspace.

Throws:
javax.jcr.RepositoryException

testWorkspaceRestoreWithParent

public void testWorkspaceRestoreWithParent()
                                    throws javax.jcr.RepositoryException
Test if Workspace.restore(Version[], boolean) succeeds if the following two preconditions are fulfilled:

Throws:
javax.jcr.RepositoryException

testWorkspaceRestoreWithRemoveExisting

public void testWorkspaceRestoreWithRemoveExisting()
                                            throws NotExecutableException,
                                                   javax.jcr.RepositoryException
Test if the removeExisting-flag removes an existing node in case of uuid conflict.

Throws:
NotExecutableException
javax.jcr.RepositoryException

testWorkspaceRestoreWithUUIDConflict

public void testWorkspaceRestoreWithUUIDConflict()
                                          throws javax.jcr.RepositoryException,
                                                 NotExecutableException
Tests if restoring the Version of an existing node throws an ItemExistsException if removeExisting is set to FALSE.

Throws:
javax.jcr.RepositoryException
NotExecutableException

testWorkspaceRestoreOnCheckedInNode

public void testWorkspaceRestoreOnCheckedInNode()
                                         throws javax.jcr.RepositoryException
Test if workspace-restoring a node works on checked-in node.

Throws:
javax.jcr.RepositoryException

testWorkspaceRestoreOnCheckedOutNode

public void testWorkspaceRestoreOnCheckedOutNode()
                                          throws javax.jcr.RepositoryException
Test if workspace-restoring a node works on checked-out node.

Throws:
javax.jcr.RepositoryException


Copyright © -2005 . All Rights Reserved.