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
MergeNodeTest
contains 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 void
disable_testMergeLocked()
Tests if aLockException
is thrown when merge is called on a locked node.void
disable_testMergeLockedJcr2()
Tests if aLockException
is thrown when merge is called on a locked node.void
disable_testMergeNodeForceFailure()
if mergeFailedProperty is present > VersionExceptionvoid
disable_testMergeNodeForceFailureJcr2()
if mergeFailedProperty is present > VersionExceptionprotected void
initNodes()
initialize a versionable node on default and second workspaceprotected void
setUp()
Initialising used variables coming from the properties file.
Setup some nodes on the 2 workspaces.protected void
tearDown()
Tidy the testRootNodes of both workspaces, then logout sessionsvoid
testMergeNodeBestEffortFalse()
Node.merge(): bestEffort is false and any merge fails a MergeException is thrown.void
testMergeNodeBestEffortFalseAmbiguousVersions()
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.void
testMergeNodeBestEffortFalseAmbiguousVersionsJcr2()
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.void
testMergeNodeBestEffortFalseJcr2()
VersionManager.merge(): bestEffort is false and any merge fails a MergeException is thrown.void
testMergeNodeBestEffortTrueCheckMergeFailedProperty()
Node.merge(): bestEffort is true > any merge-failure (represented by the version in the workspace) is reported in the jcrMergeFailed propertyvoid
testMergeNodeBestEffortTrueCheckMergeFailedPropertyJcr2()
VersionManager.merge(): bestEffort is true > any merge-failure (represented by the version in the workspace) is reported in the jcrMergeFailed propertyvoid
testMergeNodeNonCorrespondingNode()
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.void
testMergeNodeNonCorrespondingNodeJcr2()
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.void
testMergeNodeVersionAmbiguous()
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 failedvoid
testMergeNodeVersionAmbiguousJcr2()
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 failedvoid
testMergeNodeWithUnsavedStates()
Node.merge(): InvalidItemStateException if unsaved changes within the current Sessionvoid
testMergeNodeWithUnsavedStatesJcr2()
VersionManager.merge(): InvalidItemStateException if unsaved changes within the current Sessionvoid
testMergeUnknownWorkspaceName()
Perform a merge on a node with a unkwnown workspacenamevoid
testMergeUnknownWorkspaceNameJcr2()
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 Exception
Description copied from class:AbstractMergeTest
Initialising used variables coming from the properties file.
Setup some nodes on the 2 workspaces.- Overrides:
setUp
in classAbstractMergeTest
- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception
Description copied from class:AbstractMergeTest
Tidy the testRootNodes of both workspaces, then logout sessions- Overrides:
tearDown
in classAbstractMergeTest
- Throws:
Exception
-
testMergeNodeWithUnsavedStates
public void testMergeNodeWithUnsavedStates() throws RepositoryException
Node.merge(): InvalidItemStateException if unsaved changes within the current Session- Throws:
RepositoryException
-
testMergeNodeWithUnsavedStatesJcr2
public void testMergeNodeWithUnsavedStatesJcr2() throws RepositoryException
VersionManager.merge(): InvalidItemStateException if unsaved changes within the current Session- Throws:
RepositoryException
-
testMergeUnknownWorkspaceName
public void testMergeUnknownWorkspaceName() throws RepositoryException
Perform a merge on a node with a unkwnown workspacename- Throws:
RepositoryException
-
testMergeUnknownWorkspaceNameJcr2
public void testMergeUnknownWorkspaceNameJcr2() throws RepositoryException
Perform a merge on a node with a unkwnown workspacename- Throws:
RepositoryException
-
testMergeNodeNonCorrespondingNode
public void testMergeNodeNonCorrespondingNode() throws RepositoryException
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.- Throws:
RepositoryException
-
testMergeNodeNonCorrespondingNodeJcr2
public void testMergeNodeNonCorrespondingNodeJcr2() throws RepositoryException
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.- Throws:
RepositoryException
-
testMergeNodeVersionAmbiguous
public void testMergeNodeVersionAmbiguous() throws RepositoryException
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 failed- Throws:
RepositoryException
-
testMergeNodeVersionAmbiguousJcr2
public void testMergeNodeVersionAmbiguousJcr2() throws RepositoryException
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 failed- Throws:
RepositoryException
-
testMergeNodeBestEffortTrueCheckMergeFailedProperty
public void testMergeNodeBestEffortTrueCheckMergeFailedProperty() throws RepositoryException
Node.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 RepositoryException
VersionManager.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 RepositoryException
if mergeFailedProperty is present > VersionException- Throws:
RepositoryException
-
disable_testMergeNodeForceFailureJcr2
public void disable_testMergeNodeForceFailureJcr2() throws RepositoryException
if mergeFailedProperty is present > VersionException- Throws:
RepositoryException
-
testMergeNodeBestEffortFalse
public void testMergeNodeBestEffortFalse() throws RepositoryException
Node.merge(): bestEffort is false and any merge fails a MergeException is thrown.- Throws:
RepositoryException
-
testMergeNodeBestEffortFalseJcr2
public void testMergeNodeBestEffortFalseJcr2() throws RepositoryException
VersionManager.merge(): bestEffort is false and any merge fails a MergeException is thrown.- Throws:
RepositoryException
-
testMergeNodeBestEffortFalseAmbiguousVersions
public void testMergeNodeBestEffortFalseAmbiguousVersions() throws RepositoryException
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.- Throws:
RepositoryException
-
testMergeNodeBestEffortFalseAmbiguousVersionsJcr2
public void testMergeNodeBestEffortFalseAmbiguousVersionsJcr2() throws RepositoryException
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.- Throws:
RepositoryException
-
disable_testMergeLocked
public void disable_testMergeLocked() throws NotExecutableException, RepositoryException
Tests if aLockException
is 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, RepositoryException
Tests if aLockException
is thrown when merge is called on a locked node.- Throws:
NotExecutableException
- if repository does not support locking.RepositoryException
-
initNodes
protected void initNodes() throws RepositoryException
initialize a versionable node on default and second workspace- Throws:
RepositoryException
-
-