Package org.apache.jackrabbit.test.api
Class ShareableNodeTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.ShareableNodeTest
-
- All Implemented Interfaces:
junit.framework.Test
public class ShareableNodeTest extends AbstractJCRTest
Tests features available with shareable nodes.
-
-
Field Summary
-
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 ShareableNodeTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()protected voidtearDown()voidtestAddChild()Add a child to a shareable node and verify that another node in the same shared set has the same child and is modified when the first one is (6.13.11).voidtestAddMixin()Add the mix:shareable mixin to a node (6.13.2).voidtestClone()Clone a mix:shareable node to the same workspace (6.13.20).voidtestCloneMultipleTimes()Clone a mix:shareable node to the same workspace multiple times, remove all parents and save.voidtestCloneToSameParent()Clone a mix:shareable node to the same workspace, with the same parent.voidtestCopy()Copy a subtree that contains shareable nodes.voidtestDetectShareCycleOnClone()Verify that a share cycle is detected (6.13.13) when a shareable node is cloned.voidtestDetectShareCycleOnMove()Verify that a share cycle is detected (6.13.13) when a node is moved.voidtestDetectShareCycleOnTransientMove()Verify that a share cycle is detected (6.13.13) when a node is transiently moved.voidtestGetIndex()Verify that Node.getIndex returns the correct index in a shareable node (6.13).voidtestGetName()Verify that Node.getName returns the correct name in a shareable node (6.13).voidtestGetNode()Verify that the shareable node returned by Node.getNode() has the right name.voidtestGetNodes()Verify that the shareable nodes returned by Node.getNodes() have the right name.voidtestGetNodesByPattern()Verify that the shareable nodes returned by Node.getNodes(String) have the right name.voidtestGetPath()Verify that Node.getPath returns the correct path in a shareable node (6.13).voidtestGetSharedSet()Check new API Node.getSharedSet() (6.13.1)voidtestImportDocumentViewCollision()Verify document view import via workspace (6.13.14).voidtestImportExportNtShare()Verify export and import of a tree containing multiple nodes in the same shared set (6.13.14).voidtestImportSystemViewCollision()Verify system view import via workspace (6.13.14).voidtestIsSame()Verify that Node.isSame returnstruefor shareable nodes in the same shared set (6.13.21)voidtestLock()Verify that a lock applies to all nodes in a shared set (6.13.16).voidtestModifyDescendantAndRemoveShareAndSave()Verify that invoking save() on a share-ancestor will save changes in all share-descendants.voidtestModifyDescendantAndSave()Verify that invoking save() on a share-ancestor will save changes in all share-descendants.voidtestMoveShareableNode()Move a node in a shared set.voidtestRemoveDescendantAndRemoveShareAndSave()Verify that invoking save() on a share-ancestor will save changes in all share-descendants.voidtestRemoveDescendantAndSave()Verify that invoking save() on a share-ancestor will save changes in all share-descendants.voidtestRemoveMixin()Remove mix:shareable from a shareable node.voidtestRemoveMixinFromSharedNode()Remove mix:shareable from a shareable node that has 2 nodes in the shared set.voidtestRemoveShare()Check new API Node.removeShare() (6.13.4).voidtestRemoveSharedSet()Check new API Node.removeSharedSet() (6.13.4).voidtestRemoveSharedSetSaveOneParentOnly()Invoke Node.removeSharedSet(), but save only one of the parent nodes of the shared set.voidtestRestore()Create a shareable node by restoring it (6.13.3).voidtestRestoreRemoveExisting()Restore a shareable node that automatically removes an existing shareable node (6.13.19).voidtestSameUUID()Verify that shareable nodes in the same shared set have the same jcr:uuid (6.13.10).voidtestSearch()Verify that a descendant of a shareable node appears once in the result set (6.13.23)voidtestSessionImportDocumentViewCollision()Verify document view import via session (6.13.14).voidtestSessionImportSystemViewCollision()Verify system view import via session (6.13.14).voidtestSharedNodePath()Verify that shared nodes return correct paths.voidtestTransientMoveShareableNode()Transiently move a node in a shared set.-
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 classAbstractJCRTest- Throws:
Exception
-
tearDown
protected void tearDown() throws Exception- Overrides:
tearDownin classAbstractJCRTest- Throws:
Exception
-
testGetIndex
public void testGetIndex() throws ExceptionVerify that Node.getIndex returns the correct index in a shareable node (6.13).- Throws:
Exception
-
testGetName
public void testGetName() throws ExceptionVerify that Node.getName returns the correct name in a shareable node (6.13).- Throws:
Exception
-
testGetPath
public void testGetPath() throws ExceptionVerify that Node.getPath returns the correct path in a shareable node (6.13).- Throws:
Exception
-
testGetNode
public void testGetNode() throws ExceptionVerify that the shareable node returned by Node.getNode() has the right name.- Throws:
Exception
-
testGetNodes
public void testGetNodes() throws ExceptionVerify that the shareable nodes returned by Node.getNodes() have the right name.- Throws:
Exception
-
testGetNodesByPattern
public void testGetNodesByPattern() throws ExceptionVerify that the shareable nodes returned by Node.getNodes(String) have the right name.- Throws:
Exception
-
testGetSharedSet
public void testGetSharedSet() throws ExceptionCheck new API Node.getSharedSet() (6.13.1)- Throws:
Exception
-
testAddMixin
public void testAddMixin() throws ExceptionAdd the mix:shareable mixin to a node (6.13.2).- Throws:
Exception
-
testRestore
public void testRestore() throws ExceptionCreate a shareable node by restoring it (6.13.3).- Throws:
Exception
-
testRemoveShare
public void testRemoveShare() throws ExceptionCheck new API Node.removeShare() (6.13.4).- Throws:
Exception
-
testRemoveSharedSet
public void testRemoveSharedSet() throws ExceptionCheck new API Node.removeSharedSet() (6.13.4).- Throws:
Exception
-
testRemoveSharedSetSaveOneParentOnly
public void testRemoveSharedSetSaveOneParentOnly() throws ExceptionInvoke Node.removeSharedSet(), but save only one of the parent nodes of the shared set. This doesn't need to be supported according to the specification (6.13.4).- Throws:
Exception
-
testSameUUID
public void testSameUUID() throws ExceptionVerify that shareable nodes in the same shared set have the same jcr:uuid (6.13.10).- Throws:
Exception
-
testAddChild
public void testAddChild() throws ExceptionAdd a child to a shareable node and verify that another node in the same shared set has the same child and is modified when the first one is (6.13.11).- Throws:
Exception
-
testCopy
public void testCopy() throws ExceptionCopy a subtree that contains shareable nodes. Verify that the nodes newly created are not in the shared set that existed before the copy, but if two nodes in the source of a copy are in the same shared set, then the two corresponding nodes in the destination of the copy must also be in the same shared set (6.13.12).- Throws:
Exception
-
testDetectShareCycleOnClone
public void testDetectShareCycleOnClone() throws ExceptionVerify that a share cycle is detected (6.13.13) when a shareable node is cloned.- Throws:
Exception
-
testDetectShareCycleOnMove
public void testDetectShareCycleOnMove() throws ExceptionVerify that a share cycle is detected (6.13.13) when a node is moved.- Throws:
Exception
-
testDetectShareCycleOnTransientMove
public void testDetectShareCycleOnTransientMove() throws ExceptionVerify that a share cycle is detected (6.13.13) when a node is transiently moved.- Throws:
Exception
-
testImportExportNtShare
public void testImportExportNtShare() throws ExceptionVerify export and import of a tree containing multiple nodes in the same shared set (6.13.14). The first serialized node in that shared set is serialized in the normal fashion (with all of its properties and children), but any subsequent shared node in that shared set is serialized as a special node of typent:share, which contains only thejcr:uuidproperty of the shared node and thejcr:primaryTypeproperty indicating the typent:share.- Throws:
Exception
-
testImportSystemViewCollision
public void testImportSystemViewCollision() throws ExceptionVerify system view import via workspace (6.13.14). Export a system view containing a shareable node and verify, that reimporting underneath a different parent adds another member to the shared set and does not duplicate children nodes.- Throws:
Exception
-
testImportDocumentViewCollision
public void testImportDocumentViewCollision() throws ExceptionVerify document view import via workspace (6.13.14). Export a document view containing a shareable node and verify, that reimporting underneath a different parent adds another member to the shared set and does not duplicate children nodes.- Throws:
Exception
-
testSessionImportSystemViewCollision
public void testSessionImportSystemViewCollision() throws ExceptionVerify system view import via session (6.13.14). Export a system view containing a shareable node and verify, that reimporting underneath a different parent adds another member to the shared set and does not duplicate children nodes.- Throws:
Exception
-
testSessionImportDocumentViewCollision
public void testSessionImportDocumentViewCollision() throws ExceptionVerify document view import via session (6.13.14). Export a document view containing a shareable node and verify, that reimporting underneath a different parent adds another member to the shared set and does not duplicate children nodes.- Throws:
Exception
-
testLock
public void testLock() throws ExceptionVerify that a lock applies to all nodes in a shared set (6.13.16).- Throws:
Exception
-
testRestoreRemoveExisting
public void testRestoreRemoveExisting() throws ExceptionRestore a shareable node that automatically removes an existing shareable node (6.13.19). In this case the particular shared node is removed but its descendants continue to exist below the remaining members of the shared set.- Throws:
Exception
-
testClone
public void testClone() throws ExceptionClone a mix:shareable node to the same workspace (6.13.20). Verify that cloning without mix:shareable fails.- Throws:
Exception
-
testIsSame
public void testIsSame() throws ExceptionVerify that Node.isSame returnstruefor shareable nodes in the same shared set (6.13.21)- Throws:
Exception
-
testRemoveMixin
public void testRemoveMixin() throws ExceptionRemove mix:shareable from a shareable node.- Throws:
Exception
-
testRemoveMixinFromSharedNode
public void testRemoveMixinFromSharedNode() throws ExceptionRemove mix:shareable from a shareable node that has 2 nodes in the shared set.- Throws:
Exception
-
testSearch
public void testSearch() throws ExceptionVerify that a descendant of a shareable node appears once in the result set (6.13.23)- Throws:
Exception
-
testCloneToSameParent
public void testCloneToSameParent() throws ExceptionClone a mix:shareable node to the same workspace, with the same parent. This is unsupported in Jackrabbit.- Throws:
Exception
-
testMoveShareableNode
public void testMoveShareableNode() throws ExceptionMove a node in a shared set.- Throws:
Exception
-
testTransientMoveShareableNode
public void testTransientMoveShareableNode() throws ExceptionTransiently move a node in a shared set.- Throws:
Exception
-
testRemoveDescendantAndSave
public void testRemoveDescendantAndSave() throws ExceptionVerify that invoking save() on a share-ancestor will save changes in all share-descendants.- Throws:
Exception
-
testRemoveDescendantAndRemoveShareAndSave
public void testRemoveDescendantAndRemoveShareAndSave() throws ExceptionVerify that invoking save() on a share-ancestor will save changes in all share-descendants.- Throws:
Exception
-
testModifyDescendantAndSave
public void testModifyDescendantAndSave() throws ExceptionVerify that invoking save() on a share-ancestor will save changes in all share-descendants.- Throws:
Exception
-
testModifyDescendantAndRemoveShareAndSave
public void testModifyDescendantAndRemoveShareAndSave() throws ExceptionVerify that invoking save() on a share-ancestor will save changes in all share-descendants.- Throws:
Exception
-
testCloneMultipleTimes
public void testCloneMultipleTimes() throws ExceptionClone a mix:shareable node to the same workspace multiple times, remove all parents and save. Exposes an error that occurred when having more than two members in a shared set and parents were removed in the same order they were created.- Throws:
Exception
-
-