Package org.apache.jackrabbit.test.api
Class NodeUUIDTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- org.apache.jackrabbit.test.JUnitTest
-
- org.apache.jackrabbit.test.AbstractJCRTest
-
- org.apache.jackrabbit.test.api.NodeUUIDTest
-
- All Implemented Interfaces:
junit.framework.Test
public class NodeUUIDTest extends AbstractJCRTest
NodeUUIDTest
contains all tests for thejavax.jcr.Node
class that require a UUID (and therefore are optional). If the repository does not support the node type mix:referenceable aNotExecutableException
is thrown.
-
-
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 NodeUUIDTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testSaveMovedRefNode()
Moves a referencable node usingSession.move(String, String)
with one session and saves afterward changes made with a second session to the moved node usingItem.save()
.void
testSaveReferentialIntegrityException()
Tries to remove a node that is a reference target usingItem.save()
.
Procedure: Creates two nodes with same session One has a referencing property pointing to the other node Target node gets removed. This should generate aReferentialIntegrityException
upon save.-
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, setUp, tearDown
-
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
-
testSaveReferentialIntegrityException
public void testSaveReferentialIntegrityException() throws RepositoryException, NotExecutableException
Tries to remove a node that is a reference target usingItem.save()
.
Procedure:- Creates two nodes with same session
- One has a referencing property pointing to the other node
- Target node gets removed.
ReferentialIntegrityException
upon save.
Prerequisites:javax.jcr.tck.NodeUUIDTest.nodetype
must allow a property of typePropertyType.REFERENCE
javax.jcr.tck.NodeUUIDTest.propertyname1
name of the property of typePropertyType.REFERENCE
javax.jcr.tck.NodeUUIDTest.nodetype2
must have the mixin typemix:referenceable
assigned.
-
testSaveMovedRefNode
public void testSaveMovedRefNode() throws RepositoryException, NotExecutableException
Moves a referencable node usingSession.move(String, String)
with one session and saves afterward changes made with a second session to the moved node usingItem.save()
.Procedure:
- Creates node 1 and node 2 with session 1
- Gets reference to node 1 using session 2
- Session 1 moves node 1 under node 2, saves changes
- Session 2 modifes node 1, saves
InvalidItemStateException
if 'move' is reported to the second session as a sequence of remove and add events.
Prerequisites:javax.jcr.tck.NodeUUIDTest.nodetype2
must have the mixin typemix:referenceable
assigned.javax.jcr.tck.NodeUUIDTest.testSaveMovedRefNode.propertyname1
name of a property that can be modified innodetype2
for testing
-
-