Class WorkspaceRestoreTest
- 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.WorkspaceRestoreTest
-
- All Implemented Interfaces:
junit.framework.Test
public class WorkspaceRestoreTest extends AbstractVersionTest
WorkspaceRestoreTestprovides test methods for theWorkspace.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
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 WorkspaceRestoreTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()protected voidtearDown()voidtestWorkspaceRestoreHasCorrespondingNode()Test if VersionException is thrown if the specified version array does not contain a version that has a corresponding node in this workspace.voidtestWorkspaceRestoreHasCorrespondingNodeJcr2()Test if VersionException is thrown if the specified version array does not contain a version that has a corresponding node in this workspace.voidtestWorkspaceRestoreOnCheckedInNode()Test if workspace-restoring a node works on checked-in node.voidtestWorkspaceRestoreOnCheckedInNodeJcr2()Test if workspace-restoring a node works on checked-in node.voidtestWorkspaceRestoreOnCheckedOutNode()Test if workspace-restoring a node works on checked-out node.voidtestWorkspaceRestoreOnCheckedOutNodeJcr2()Test if workspace-restoring a node works on checked-out node.voidtestWorkspaceRestoreWithParent()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.voidtestWorkspaceRestoreWithParentJcr2()Test if VersionManager.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.voidtestWorkspaceRestoreWithPendingChanges()Test if InvalidItemStateException is thrown if the session affected by Workspace.restore(Version[], boolean) has pending changes.voidtestWorkspaceRestoreWithPendingChangesJcr2()Test if InvalidItemStateException is thrown if the session affected by VersionManager.restore(Version[], boolean) has pending changes.voidtestWorkspaceRestoreWithRemoveExisting()Test if the removeExisting-flag removes an existing node in case of uuid conflict.voidtestWorkspaceRestoreWithRemoveExistingJcr2()Test if the removeExisting-flag removes an existing node in case of uuid conflict.voidtestWorkspaceRestoreWithUUIDConflict()Tests if restoring theVersionof an existing node throws anItemExistsExceptionif removeExisting is set to FALSE.voidtestWorkspaceRestoreWithUUIDConflictJcr2()Tests if restoring theVersionof an existing node throws anItemExistsExceptionif removeExisting is set to FALSE.-
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
-
-
-
-
Method Detail
-
setUp
protected void setUp() throws Exception- Overrides:
setUpin classAbstractVersionTest- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception- Overrides:
tearDownin classAbstractVersionTest- Throws:
Exception
-
testWorkspaceRestoreWithPendingChanges
public void testWorkspaceRestoreWithPendingChanges() throws RepositoryExceptionTest if InvalidItemStateException is thrown if the session affected by Workspace.restore(Version[], boolean) has pending changes.- Throws:
RepositoryException
-
testWorkspaceRestoreWithPendingChangesJcr2
public void testWorkspaceRestoreWithPendingChangesJcr2() throws RepositoryExceptionTest if InvalidItemStateException is thrown if the session affected by VersionManager.restore(Version[], boolean) has pending changes.- Throws:
RepositoryException
-
testWorkspaceRestoreHasCorrespondingNode
public void testWorkspaceRestoreHasCorrespondingNode() throws RepositoryExceptionTest if VersionException is thrown if the specified version array does not contain a version that has a corresponding node in this workspace.- Throws:
RepositoryException
-
testWorkspaceRestoreHasCorrespondingNodeJcr2
public void testWorkspaceRestoreHasCorrespondingNodeJcr2() throws RepositoryExceptionTest if VersionException is thrown if the specified version array does not contain a version that has a corresponding node in this workspace.- Throws:
RepositoryException
-
testWorkspaceRestoreWithParent
public void testWorkspaceRestoreWithParent() throws RepositoryExceptionTest 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.
- Throws:
RepositoryException
-
testWorkspaceRestoreWithParentJcr2
public void testWorkspaceRestoreWithParentJcr2() throws RepositoryExceptionTest if VersionManager.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.
- Throws:
RepositoryException
-
testWorkspaceRestoreWithRemoveExisting
public void testWorkspaceRestoreWithRemoveExisting() throws NotExecutableException, RepositoryExceptionTest if the removeExisting-flag removes an existing node in case of uuid conflict.
-
testWorkspaceRestoreWithRemoveExistingJcr2
public void testWorkspaceRestoreWithRemoveExistingJcr2() throws NotExecutableException, RepositoryExceptionTest if the removeExisting-flag removes an existing node in case of uuid conflict.
-
testWorkspaceRestoreWithUUIDConflict
public void testWorkspaceRestoreWithUUIDConflict() throws RepositoryException, NotExecutableExceptionTests if restoring theVersionof an existing node throws anItemExistsExceptionif removeExisting is set to FALSE.
-
testWorkspaceRestoreWithUUIDConflictJcr2
public void testWorkspaceRestoreWithUUIDConflictJcr2() throws RepositoryException, NotExecutableExceptionTests if restoring theVersionof an existing node throws anItemExistsExceptionif removeExisting is set to FALSE.
-
testWorkspaceRestoreOnCheckedInNode
public void testWorkspaceRestoreOnCheckedInNode() throws RepositoryExceptionTest if workspace-restoring a node works on checked-in node.- Throws:
RepositoryException
-
testWorkspaceRestoreOnCheckedInNodeJcr2
public void testWorkspaceRestoreOnCheckedInNodeJcr2() throws RepositoryExceptionTest if workspace-restoring a node works on checked-in node.- Throws:
RepositoryException
-
testWorkspaceRestoreOnCheckedOutNode
public void testWorkspaceRestoreOnCheckedOutNode() throws RepositoryExceptionTest if workspace-restoring a node works on checked-out node.- Throws:
RepositoryException
-
testWorkspaceRestoreOnCheckedOutNodeJcr2
public void testWorkspaceRestoreOnCheckedOutNodeJcr2() throws RepositoryExceptionTest if workspace-restoring a node works on checked-out node.- Throws:
RepositoryException
-
-