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
helper, isReadOnly, jcrBaseVersion, jcrCreated, jcrFrozenNode, jcrFrozenUuid, 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, testNodeTypeNoChildren, testPath, testRoot, testRootNode, workspaceName
 
Fields inherited from class org.apache.jackrabbit.test.JUnitTest
log
 
Constructor Summary
MergeNodeTest()
           
 
Method Summary
 void disable_testMergeLocked()
          Tests if a LockException is thrown when merge is called on a locked node.
 void disable_testMergeNodeForceFailure()
          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 testMergeNodeBestEffortTrueCheckMergeFailedProperty()
          Node.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 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 testMergeNodeWithUnsavedStates()
          Node.merge(): InvalidItemStateException if unsaved changes within the current Session
 void testMergeUnknownWorkspaceName()
          Perform a merge on a node with a unkwnown workspacename
 
Methods inherited from class org.apache.jackrabbit.test.AbstractJCRTest
cleanUp, cleanUpTestRoot, createRandomString, ensureCanSetProperty, ensureCanSetProperty, ensureCanSetProperty, ensureMultipleWorkspacesSupported, getNonExistingWorkspaceName, 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

testMergeUnknownWorkspaceName

public void testMergeUnknownWorkspaceName()
                                   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

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

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

disable_testMergeNodeForceFailure

public void disable_testMergeNodeForceFailure()
                                       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

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

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

initNodes

protected void initNodes()
                  throws RepositoryException
initialize a versionable node on default and second workspace

Throws:
RepositoryException


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