
org.apache.jackrabbit.test.api.NodeUUIDTest Maven / Gradle / Ivy
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jackrabbit.test.api; import org.apache.jackrabbit.test.AbstractJCRTest; import org.apache.jackrabbit.test.NotExecutableException; import javax.jcr.RepositoryException; import javax.jcr.Node; import javax.jcr.Session; import javax.jcr.ReferentialIntegrityException; import javax.jcr.InvalidItemStateException; import javax.jcr.nodetype.NoSuchNodeTypeException; /** *
This should * generate a {@link javax.jcr.ReferentialIntegrityException} upon save. *NodeUUIDTest
contains all tests for the *javax.jcr.Node
class that require a UUID (and therefore are * optional). If the repository does not support the node type mix:referenceable * a {@link NotExecutableException} is thrown. * * @test * @sources NodeUUIDTest.java * @executeClass org.apache.jackrabbit.test.api.NodeUUIDTest * @keywords level2 */ public class NodeUUIDTest extends AbstractJCRTest { /** * Tries to remove a node that is a reference target using {@link * Node#save()}.
Procedure:
- Creates two nodes with same * session
- One has a referencing property pointing to the other * node
- Target node gets removed.
Prerequisites:
javax.jcr.tck.NodeUUIDTest.nodetype
* must allow a property of type {@link javax.jcr.PropertyType#REFERENCE}
* javax.jcr.tck.NodeUUIDTest.propertyname1
name of the * property of type {@link javax.jcr.PropertyType#REFERENCE}
* javax.jcr.tck.NodeUUIDTest.nodetype2
must have the mixin * typemix:referenceable
assigned.
* 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy