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

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.jackrabbit.test.JUnitTest
              extended by org.apache.jackrabbit.test.AbstractJCRTest
                  extended by org.apache.jackrabbit.test.api.version.AbstractMergeTest
                      extended by 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, mixVersionable, nodeName1, nodeName2, nodeName3, nodeName4, NS_JCR_URI, NS_MIX_URI, NS_NT_URI, NS_SV_URI, ntBase, ntFrozenNode, ntQuery, ntUnstructured, ntVersion, ntVersionHistory, ntVersionLabels, propertyName1, propertyName2, superuser, testNodeType, testNodeTypeNoChildren, testPath, testRoot, testRootNode, vf, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log, logger
 
Constructor Summary
MergeNodeTest()
           
 
Method Summary
 void disable_testMergeLocked()
          Tests if a LockException is thrown when merge is called on a locked node.
 void disable_testMergeLockedJcr2()
          Tests if a LockException is thrown when merge is called on a locked node.
 void disable_testMergeNodeForceFailure()
          if mergeFailedProperty is present > VersionException
 void disable_testMergeNodeForceFailureJcr2()
          if mergeFailedProperty is present > VersionException
protected  void initNodes()
          initialize a versionable node on default and second workspace
protected  void setUp()
          Initialising used variables coming from the properties file.
protected  void tearDown()
          Tidy the testRootNodes of both workspaces, then logout sessions
 void 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 property
 void testMergeNodeBestEffortTrueCheckMergeFailedPropertyJcr2()
          VersionManager.merge(): bestEffort is true > any merge-failure (represented by the version in the workspace) is reported in the jcrMergeFailed property
 void 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 failed
 void 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 failed
 void testMergeNodeWithUnsavedStates()
          Node.merge(): InvalidItemStateException if unsaved changes within the current Session
 void testMergeNodeWithUnsavedStatesJcr2()
          VersionManager.merge(): InvalidItemStateException if unsaved changes within the current Session
 void testMergeUnknownWorkspaceName()
          Perform a merge on a node with a unkwnown workspacename
 void 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, ensureMixinType, ensureMultipleWorkspacesSupported, getHelper, getJcrValue, getLocalName, getNonExistingWorkspaceName, getProperty, getProperty, getSize, isSupported, needsMixin, 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

MergeNodeTest

public MergeNodeTest()
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 class AbstractMergeTest
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 class AbstractMergeTest
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 a LockException 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 a LockException 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


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.