Class MergeNodeTest
- 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.AbstractMergeTest
-
- org.apache.jackrabbit.test.api.version.MergeNodeTest
-
- All Implemented Interfaces:
junit.framework.Test
public class MergeNodeTest extends AbstractMergeTest
MergeNodeTestcontains tests dealing with general merge node calls.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.test.api.version.AbstractMergeTest
CHANGED_STRING, nonVersionableNodeType, superuserW2, testRootNodeW2, versionableNodeType, workspace, workspaceW2
-
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 MergeNodeTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisable_testMergeLocked()Tests if aLockExceptionis thrown when merge is called on a locked node.voiddisable_testMergeLockedJcr2()Tests if aLockExceptionis thrown when merge is called on a locked node.voiddisable_testMergeNodeForceFailure()if mergeFailedProperty is present > VersionExceptionvoiddisable_testMergeNodeForceFailureJcr2()if mergeFailedProperty is present > VersionExceptionprotected voidinitNodes()initialize a versionable node on default and second workspaceprotected voidsetUp()Initialising used variables coming from the properties file.
Setup some nodes on the 2 workspaces.protected voidtearDown()Tidy the testRootNodes of both workspaces, then logout sessionsvoidtestMergeNodeBestEffortFalse()Node.merge(): bestEffort is false and any merge fails a MergeException is thrown.voidtestMergeNodeBestEffortFalseAmbiguousVersions()A MergeVersionException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.voidtestMergeNodeBestEffortFalseAmbiguousVersionsJcr2()A MergeVersionException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.voidtestMergeNodeBestEffortFalseJcr2()VersionManager.merge(): bestEffort is false and any merge fails a MergeException is thrown.voidtestMergeNodeBestEffortTrueCheckMergeFailedProperty()Node.merge(): bestEffort is true > any merge-failure (represented by the version in the workspace) is reported in the jcrMergeFailed propertyvoidtestMergeNodeBestEffortTrueCheckMergeFailedPropertyJcr2()VersionManager.merge(): bestEffort is true > any merge-failure (represented by the version in the workspace) is reported in the jcrMergeFailed propertyvoidtestMergeNodeNonCorrespondingNode()Node.merge(): If this node does not have a corresponding node in the indicated workspace
then the merge method returns quietly and no changes are made.voidtestMergeNodeNonCorrespondingNodeJcr2()VersionManager.merge(): If this node does not have a corresponding node in the indicated workspace
then the merge method returns quietly and no changes are made.voidtestMergeNodeVersionAmbiguous()Node.merge(): versionable subNode N checked-in: If V is neither a successor of, predecessor of, nor identical with V', then the merge result for N is failedvoidtestMergeNodeVersionAmbiguousJcr2()VersionManager.merge(): versionable subNode N checked-in: If V is neither a successor of, predecessor of, nor identical with V', then the merge result for N is failedvoidtestMergeNodeWithUnsavedStates()Node.merge(): InvalidItemStateException if unsaved changes within the current SessionvoidtestMergeNodeWithUnsavedStatesJcr2()VersionManager.merge(): InvalidItemStateException if unsaved changes within the current SessionvoidtestMergeUnknownWorkspaceName()Perform a merge on a node with a unkwnown workspacenamevoidtestMergeUnknownWorkspaceNameJcr2()Perform a merge on a node with a unkwnown workspacename-
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 ExceptionDescription copied from class:AbstractMergeTestInitialising used variables coming from the properties file.
Setup some nodes on the 2 workspaces.- Overrides:
setUpin classAbstractMergeTest- Throws:
Exception
-
tearDown
protected void tearDown() throws ExceptionDescription copied from class:AbstractMergeTestTidy the testRootNodes of both workspaces, then logout sessions- Overrides:
tearDownin classAbstractMergeTest- Throws:
Exception
-
testMergeNodeWithUnsavedStates
public void testMergeNodeWithUnsavedStates() throws RepositoryExceptionNode.merge(): InvalidItemStateException if unsaved changes within the current Session- Throws:
RepositoryException
-
testMergeNodeWithUnsavedStatesJcr2
public void testMergeNodeWithUnsavedStatesJcr2() throws RepositoryExceptionVersionManager.merge(): InvalidItemStateException if unsaved changes within the current Session- Throws:
RepositoryException
-
testMergeUnknownWorkspaceName
public void testMergeUnknownWorkspaceName() throws RepositoryExceptionPerform a merge on a node with a unkwnown workspacename- Throws:
RepositoryException
-
testMergeUnknownWorkspaceNameJcr2
public void testMergeUnknownWorkspaceNameJcr2() throws RepositoryExceptionPerform a merge on a node with a unkwnown workspacename- Throws:
RepositoryException
-
testMergeNodeNonCorrespondingNode
public void testMergeNodeNonCorrespondingNode() throws RepositoryExceptionNode.merge(): If this node does not have a corresponding node in the indicated workspace
then the merge method returns quietly and no changes are made.- Throws:
RepositoryException
-
testMergeNodeNonCorrespondingNodeJcr2
public void testMergeNodeNonCorrespondingNodeJcr2() throws RepositoryExceptionVersionManager.merge(): If this node does not have a corresponding node in the indicated workspace
then the merge method returns quietly and no changes are made.- Throws:
RepositoryException
-
testMergeNodeVersionAmbiguous
public void testMergeNodeVersionAmbiguous() throws RepositoryExceptionNode.merge(): versionable subNode N checked-in: If V is neither a successor of, predecessor of, nor identical with V', then the merge result for N is failed- Throws:
RepositoryException
-
testMergeNodeVersionAmbiguousJcr2
public void testMergeNodeVersionAmbiguousJcr2() throws RepositoryExceptionVersionManager.merge(): versionable subNode N checked-in: If V is neither a successor of, predecessor of, nor identical with V', then the merge result for N is failed- Throws:
RepositoryException
-
testMergeNodeBestEffortTrueCheckMergeFailedProperty
public void testMergeNodeBestEffortTrueCheckMergeFailedProperty() throws RepositoryExceptionNode.merge(): bestEffort is true > any merge-failure (represented by the version in the workspace) is reported in the jcrMergeFailed property- Throws:
RepositoryException
-
testMergeNodeBestEffortTrueCheckMergeFailedPropertyJcr2
public void testMergeNodeBestEffortTrueCheckMergeFailedPropertyJcr2() throws RepositoryExceptionVersionManager.merge(): bestEffort is true > any merge-failure (represented by the version in the workspace) is reported in the jcrMergeFailed property- Throws:
RepositoryException
-
disable_testMergeNodeForceFailure
public void disable_testMergeNodeForceFailure() throws RepositoryExceptionif mergeFailedProperty is present > VersionException- Throws:
RepositoryException
-
disable_testMergeNodeForceFailureJcr2
public void disable_testMergeNodeForceFailureJcr2() throws RepositoryExceptionif mergeFailedProperty is present > VersionException- Throws:
RepositoryException
-
testMergeNodeBestEffortFalse
public void testMergeNodeBestEffortFalse() throws RepositoryExceptionNode.merge(): bestEffort is false and any merge fails a MergeException is thrown.- Throws:
RepositoryException
-
testMergeNodeBestEffortFalseJcr2
public void testMergeNodeBestEffortFalseJcr2() throws RepositoryExceptionVersionManager.merge(): bestEffort is false and any merge fails a MergeException is thrown.- Throws:
RepositoryException
-
testMergeNodeBestEffortFalseAmbiguousVersions
public void testMergeNodeBestEffortFalseAmbiguousVersions() throws RepositoryExceptionA MergeVersionException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.- Throws:
RepositoryException
-
testMergeNodeBestEffortFalseAmbiguousVersionsJcr2
public void testMergeNodeBestEffortFalseAmbiguousVersionsJcr2() throws RepositoryExceptionA MergeVersionException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.- Throws:
RepositoryException
-
disable_testMergeLocked
public void disable_testMergeLocked() throws NotExecutableException, RepositoryExceptionTests if aLockExceptionis thrown when merge is called on a locked node.- Throws:
NotExecutableException- if repository does not support locking.RepositoryException
-
disable_testMergeLockedJcr2
public void disable_testMergeLockedJcr2() throws NotExecutableException, RepositoryExceptionTests if aLockExceptionis thrown when merge is called on a locked node.- Throws:
NotExecutableException- if repository does not support locking.RepositoryException
-
initNodes
protected void initNodes() throws RepositoryExceptioninitialize a versionable node on default and second workspace- Throws:
RepositoryException
-
-