jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r161260 [5/7] - in incubator/jackrabbit/trunk: ./ applications/test/ applications/test/repository/nodetypes/ contrib/orm-persistence/applications/test/ contrib/orm-persistence/applications/test/repository/nodetypes/ src/java/org/apache/jackrabbit/core/ src/java/org/apache/jackrabbit/core/lock/ src/java/org/apache/jackrabbit/core/nodetype/ src/java/org/apache/jackrabbit/core/nodetype/virtual/ src/java/org/apache/jackrabbit/core/nodetype/xml/ src/java/org/apache/jackrabbit/core/observation/ src/java/org/apache/jackrabbit/core/search/ src/java/org/apache/jackrabbit/core/search/lucene/ src/java/org/apache/jackrabbit/core/security/ src/java/org/apache/jackrabbit/core/util/ src/java/org/apache/jackrabbit/core/version/ src/java/org/apache/jackrabbit/core/virtual/ src/java/org/apache/jackrabbit/core/xml/ src/test/org/apache/jackrabbit/core/nodetype/xml/ src/test/org/apache/jackrabbit/core/observation/ src/test/org/apache/jackrabbit/core/search/ src/test/org/apache/jackrabbit/test/api/ src/test/org/apache/jackrabbit/test/api/lock/ src/test/org/apache/jackrabbit/test/api/nodetype/ src/test/org/apache/jackrabbit/test/api/nodetype/spec/ src/test/org/apache/jackrabbit/test/api/observation/ src/test/org/apache/jackrabbit/test/api/query/ src/test/org/apache/jackrabbit/test/api/version/
Date Thu, 14 Apr 2005 11:51:04 GMT
Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SessionImporter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SessionImporter.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SessionImporter.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SessionImporter.java Thu Apr 14 04:50:38 2005
@@ -28,6 +28,7 @@
 import org.apache.jackrabbit.core.util.ValueHelper;
 import org.apache.log4j.Logger;
 
+import javax.jcr.ImportUUIDBehavior;
 import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Property;
@@ -37,7 +38,7 @@
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
 import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.NodeDefinition;
 import java.io.IOException;
 import java.io.Reader;
 import java.util.Iterator;
@@ -63,6 +64,14 @@
      */
     private final ReferenceChangeTracker refTracker;
 
+    /**
+     * Creates a new <code>SessionImporter</code> instance.
+     *
+     * @param importTargetNode
+     * @param session
+     * @param uuidBehavior     any of the constants declared by
+     *                         {@link ImportUUIDBehavior}
+     */
     public SessionImporter(NodeImpl importTargetNode,
                            SessionImpl session,
                            int uuidBehavior) {
@@ -99,7 +108,7 @@
                                            NodeInfo nodeInfo)
             throws RepositoryException {
         NodeImpl node;
-        if (uuidBehavior == IMPORT_UUID_CREATE_NEW) {
+        if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW) {
             // create new with new uuid
             node = createNode(parent, nodeInfo.getName(),
                     nodeInfo.getNodeTypeName(), nodeInfo.getMixinNames(), null);
@@ -107,11 +116,11 @@
             if (node.isNodeType(Constants.MIX_REFERENCEABLE)) {
                 refTracker.mappedUUID(nodeInfo.getUUID(), node.getUUID());
             }
-        } else if (uuidBehavior == IMPORT_UUID_COLLISION_THROW) {
+        } else if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW) {
             String msg = "a node with uuid " + nodeInfo.getUUID() + " already exists!";
             log.debug(msg);
             throw new ItemExistsException(msg);
-        } else if (uuidBehavior == IMPORT_UUID_COLLISION_REMOVE_EXISTING) {
+        } else if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING) {
             // make sure conflicting node is not importTargetNode or an ancestor thereof
             if (importTargetNode.getPath().startsWith(conflicting.getPath())) {
                 String msg = "cannot remove ancestor node";
@@ -124,7 +133,7 @@
             node = createNode(parent, nodeInfo.getName(),
                     nodeInfo.getNodeTypeName(), nodeInfo.getMixinNames(),
                     nodeInfo.getUUID());
-        } else if (uuidBehavior == IMPORT_UUID_COLLISION_REPLACE_EXISTING) {
+        } else if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING) {
             if (conflicting.getDepth() == 0) {
                 String msg = "root node cannot be replaced";
                 log.debug(msg);
@@ -179,8 +188,8 @@
         if (parent.hasNode(nodeName)) {
             // a node with that name already exists...
             NodeImpl existing = parent.getNode(nodeName);
-            NodeDef def = existing.getDefinition();
-            if (!def.allowSameNameSibs()) {
+            NodeDefinition def = existing.getDefinition();
+            if (!def.allowsSameNameSiblings()) {
                 // existing doesn't allow same-name siblings,
                 // check for potential conflicts
                 if (def.isProtected() && existing.isNodeType(ntName)) {
@@ -189,7 +198,7 @@
                     log.debug("skipping protected node " + existing.safeGetJCRPath());
                     return;
                 }
-                if (def.isAutoCreate() && existing.isNodeType(ntName)) {
+                if (def.isAutoCreated() && existing.isNodeType(ntName)) {
                     // this node has already been auto-created, no need to create it
                     node = existing;
                 } else {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java Thu Apr 14 04:50:38 2005
@@ -29,7 +29,7 @@
 import org.apache.jackrabbit.core.QName;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.WorkspaceImpl;
-import org.apache.jackrabbit.core.nodetype.ChildNodeDef;
+import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
@@ -48,6 +48,7 @@
 import javax.jcr.ItemExistsException;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
+import javax.jcr.ImportUUIDBehavior;
 import javax.jcr.nodetype.ConstraintViolationException;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -86,12 +87,13 @@
     private final ReferenceChangeTracker refTracker;
 
     /**
-     * Creates a <code>WorkspaceImporter</code> instance.
+     * Creates a new <code>WorkspaceImporter</code> instance.
      *
      * @param importTarget
      * @param wsp
      * @param ntReg
-     * @param uuidBehavior
+     * @param uuidBehavior     any of the constants declared by
+     *                         {@link ImportUUIDBehavior}
      */
     public WorkspaceImporter(NodeState importTarget,
                              WorkspaceImpl wsp,
@@ -145,7 +147,7 @@
                                    QName[] mixinNames,
                                    String uuid)
             throws RepositoryException {
-        ChildNodeDef def =
+        NodeDef def =
                 wsp.findApplicableNodeDefinition(nodeName, nodeTypeName, parent);
         return createNode(parent, nodeName, nodeTypeName, mixinNames, uuid, def);
     }
@@ -155,7 +157,7 @@
                                    QName nodeTypeName,
                                    QName[] mixinNames,
                                    String uuid,
-                                   ChildNodeDef def)
+                                   NodeDef def)
             throws RepositoryException {
         // check for name collisions with existing properties
         if (parent.hasPropertyEntry(nodeName)) {
@@ -164,7 +166,7 @@
             throw new RepositoryException(msg);
         }
         // check for name collisions with existing nodes
-        if (!def.allowSameNameSibs() && parent.hasChildNodeEntry(nodeName)) {
+        if (!def.allowsSameNameSiblings() && parent.hasChildNodeEntry(nodeName)) {
             NodeId id = new NodeId(parent.getChildNodeEntry(nodeName, 1).getUUID());
             throw new ItemExistsException(resolveJCRPath(id));
         }
@@ -209,9 +211,9 @@
         }
 
         // recursively add 'auto-create' child nodes defined in node type
-        ChildNodeDef[] nda = ent.getAutoCreateNodeDefs();
+        NodeDef[] nda = ent.getAutoCreateNodeDefs();
         for (int i = 0; i < nda.length; i++) {
-            ChildNodeDef nd = nda[i];
+            NodeDef nd = nda[i];
             createNode(node, nd.getName(), nd.getDefaultPrimaryType(),
                     null, null, nd);
         }
@@ -514,7 +516,7 @@
             throws RepositoryException {
 
         NodeState node;
-        if (uuidBehavior == IMPORT_UUID_CREATE_NEW) {
+        if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW) {
             // create new with new uuid:
             // check if new node can be added (check access rights &
             // node type constraints only, assume locking & versioning status
@@ -530,12 +532,12 @@
             if (ent.includesNodeType(MIX_REFERENCEABLE)) {
                 refTracker.mappedUUID(nodeInfo.getUUID(), node.getUUID());
             }
-        } else if (uuidBehavior == IMPORT_UUID_COLLISION_THROW) {
+        } else if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW) {
             String msg = "a node with uuid " + nodeInfo.getUUID()
                     + " already exists!";
             log.debug(msg);
             throw new ItemExistsException(msg);
-        } else if (uuidBehavior == IMPORT_UUID_COLLISION_REMOVE_EXISTING) {
+        } else if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING) {
             // make sure conflicting node is not importTarget or an ancestor thereof
             Path p0 = hierMgr.getPath(importTarget.getId());
             Path p1 = hierMgr.getPath(conflicting.getId());
@@ -574,7 +576,7 @@
             node = createNode(parent, nodeInfo.getName(),
                     nodeInfo.getNodeTypeName(), nodeInfo.getMixinNames(),
                     nodeInfo.getUUID());
-        } else if (uuidBehavior == IMPORT_UUID_COLLISION_REPLACE_EXISTING) {
+        } else if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING) {
             if (conflicting.getParentUUID() == null) {
                 String msg = "root node cannot be replaced";
                 log.debug(msg);
@@ -677,9 +679,9 @@
                         parent.getChildNodeEntry(nodeName, 1);
                 NodeId idExisting = new NodeId(entry.getUUID());
                 NodeState existing = (NodeState) stateMgr.getItemState(idExisting);
-                ChildNodeDef def = ntReg.getNodeDef(existing.getDefinitionId());
+                NodeDef def = ntReg.getNodeDef(existing.getDefinitionId());
 
-                if (!def.allowSameNameSibs()) {
+                if (!def.allowsSameNameSiblings()) {
                     // existing doesn't allow same-name siblings,
                     // check for potential conflicts
                     EffectiveNodeType entExisting =
@@ -692,7 +694,7 @@
                                 + resolveJCRPath(existing.getId()));
                         return;
                     }
-                    if (def.isAutoCreate() && entExisting.includesNodeType(ntName)) {
+                    if (def.isAutoCreated() && entExisting.includesNodeType(ntName)) {
                         // this node has already been auto-created,
                         // no need to create it
                         node = existing;
@@ -707,7 +709,7 @@
                 if (uuid == null) {
                     // no potential uuid conflict, always create new node
 
-                    ChildNodeDef def =
+                    NodeDef def =
                             wsp.findApplicableNodeDefinition(nodeName, ntName, parent);
                     if (def.isProtected()) {
                         // skip protected node
@@ -741,7 +743,7 @@
                     } else {
                         // create new with given uuid
 
-                        ChildNodeDef def =
+                        NodeDef def =
                                 wsp.findApplicableNodeDefinition(nodeName, ntName, parent);
                         if (def.isProtected()) {
                             // skip protected node
@@ -787,7 +789,7 @@
                                 + resolveJCRPath(idExisting));
                         continue;
                     }
-                    if (def.isAutoCreate() && (existing.getType() == type
+                    if (def.isAutoCreated() && (existing.getType() == type
                             || type == PropertyType.UNDEFINED)
                             && def.isMultiple() == existing.isMultiValued()) {
                         // this property has already been auto-created,

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/TestAll.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/TestAll.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/TestAll.java Thu Apr 14 04:50:38 2005
@@ -34,7 +34,7 @@
 import org.apache.jackrabbit.core.InternalValue;
 import org.apache.jackrabbit.core.NamespaceResolver;
 import org.apache.jackrabbit.core.QName;
-import org.apache.jackrabbit.core.nodetype.ChildNodeDef;
+import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.PropDef;
@@ -139,11 +139,11 @@
      * @param nodeName child node name
      * @return child node definition
      */
-    private ChildNodeDef getChildNode(String typeName, String nodeName) {
+    private NodeDef getChildNode(String typeName, String nodeName) {
         QName name = new QName(TEST_NAMESPACE, nodeName);
 
         NodeTypeDef def = getNodeType(typeName);
-        ChildNodeDef[] defs = def.getChildNodeDefs();
+        NodeDef[] defs = def.getChildNodeDefs();
         for (int i = 0; i < defs.length; i++) {
             if (name.equals(defs[i].getName())) {
                 return defs[i];
@@ -204,14 +204,14 @@
         PropDef[] defs = def.getPropertyDefs();
         assertEquals("itemNodeType wildcard property",
                 new QName(Constants.NS_DEFAULT_URI, "*"),
-                def.getPropertyDefs()[0].getName());
+                defs[0].getName());
     }
 
     /** Test for the empty item definition. */
     public void testEmptyItem() {
         PropDef def = getProperty("itemNodeType", "emptyItem");
         assertEquals("emptyItem autoCreate",
-                false, def.isAutoCreate());
+                false, def.isAutoCreated());
         assertEquals("emptyItem mandatory",
                 false, def.isMandatory());
         assertEquals("emptyItem onParentVersion",
@@ -220,11 +220,11 @@
                 false, def.isProtected());
     }
 
-    /** Test for the <code>autoCreate</code> item definition attribute. */
+    /** Test for the <code>autoCreated</code> item definition attribute. */
     public void testAutoCreateItem() {
-        PropDef def = getProperty("itemNodeType", "autoCreateItem");
-        assertEquals("autoCreateItem autoCreate",
-                true, def.isAutoCreate());
+        PropDef def = getProperty("itemNodeType", "autoCreatedItem");
+        assertEquals("autoCreatedItem autoCreated",
+                true, def.isAutoCreated());
     }
 
     /** Test for the <code>mandatory</code> item definition attribute. */
@@ -458,23 +458,23 @@
 
     /** Test for the empty child node definition. */
     public void testEmptyNode() {
-        ChildNodeDef def = getChildNode("childNodeType", "emptyNode");
-        assertEquals("emptyNode allowSameNameSibs",
-                false, def.allowSameNameSibs());
+        NodeDef def = getChildNode("childNodeType", "emptyNode");
+        assertEquals("emptyNode allowsSameNameSiblings",
+                false, def.allowsSameNameSiblings());
         assertEquals("emptyNode defaultPrimaryType",
                 null, def.getDefaultPrimaryType());
     }
 
-    /** Test for the <code>allowSameNameSibs</code> child node attribute. */
+    /** Test for the <code>allowsSameNameSiblings</code> child node attribute. */
     public void testSiblingNode() {
-        ChildNodeDef def = getChildNode("childNodeType", "siblingNode");
-        assertEquals("siblingNode allowSameNameSibs",
-                true, def.allowSameNameSibs());
+        NodeDef def = getChildNode("childNodeType", "siblingNode");
+        assertEquals("siblingNode allowsSameNameSiblings",
+                true, def.allowsSameNameSiblings());
     }
 
     /** Test for the <code>defaultPrimaryType</code> child node attribute. */
     public void testDefaultTypeNode() {
-        ChildNodeDef def = getChildNode("childNodeType", "defaultTypeNode");
+        NodeDef def = getChildNode("childNodeType", "defaultTypeNode");
         assertEquals("defaultTypeNode defaultPrimaryType",
                 new QName(TEST_NAMESPACE, "testType"),
                 def.getDefaultPrimaryType());
@@ -482,7 +482,7 @@
 
     /** Test for the <code>requiredPrimaryTypes</code> child node attributes. */
     public void testRequiredTypeNode() {
-        ChildNodeDef def = getChildNode("childNodeType", "requiredTypeNode");
+        NodeDef def = getChildNode("childNodeType", "requiredTypeNode");
         assertEquals("requiredTypeNode requiredPrimaryTypes",
                 2, def.getRequiredPrimaryTypes().length);
         assertEquals("requiredTypeNode requiredPrimaryTypes[0]",

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/test_nodetypes.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/test_nodetypes.xml?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/test_nodetypes.xml (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/test_nodetypes.xml Thu Apr 14 04:50:38 2005
@@ -32,52 +32,52 @@
   <nodeType name="test:itemNodeType"
             isMixin="false" hasOrderableChildNodes="false"
             primaryItemName="test:emptyItem">
-    <propertyDef name="*"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="*"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false"/>
-    <propertyDef name="test:emptyItem"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:emptyItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false"/>
-    <propertyDef name="test:autoCreateItem"
-                 requiredType="undefined" autoCreate="true" mandatory="false"
+    <propertyDefinition name="test:autoCreatedItem"
+                 requiredType="undefined" autoCreated="true" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false"/>
-    <propertyDef name="test:mandatoryItem"
-                 requiredType="undefined" autoCreate="false" mandatory="true"
+    <propertyDefinition name="test:mandatoryItem"
+                 requiredType="undefined" autoCreated="false" mandatory="true"
                  onParentVersion="IGNORE" protected="false" multiple="false"/>
-    <propertyDef name="test:copyItem"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:copyItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="COPY" protected="false" multiple="false"/>
-    <propertyDef name="test:versionItem"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:versionItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="VERSION" protected="false" multiple="false"/>
-    <propertyDef name="test:initializeItem"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:initializeItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="INITIALIZE" protected="false" multiple="false"/>
-    <propertyDef name="test:computeItem"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:computeItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="COMPUTE" protected="false" multiple="false"/>
-    <propertyDef name="test:abortItem"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:abortItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="ABORT" protected="false" multiple="false"/>
-    <propertyDef name="test:protectedItem"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:protectedItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="true" multiple="false"/>
   </nodeType>
 
   <nodeType name="test:propertyNodeType"
             isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
-    <propertyDef name="test:emptyProperty"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:emptyProperty"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false"/>
-    <propertyDef name="test:binaryProperty"
-                 requiredType="Binary" autoCreate="false" mandatory="false"
+    <propertyDefinition name="test:binaryProperty"
+                 requiredType="Binary" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>[0,)</valueConstraint>
       </valueConstraints>
-    </propertyDef>
-    <propertyDef name="test:booleanProperty"
-                 requiredType="Boolean" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:booleanProperty"
+                 requiredType="Boolean" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>true</valueConstraint>
@@ -86,9 +86,9 @@
       <defaultValues>
         <defaultValue>true</defaultValue>
       </defaultValues>
-    </propertyDef>
-    <propertyDef name="test:dateProperty"
-                 requiredType="Date" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:dateProperty"
+                 requiredType="Date" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>
@@ -98,9 +98,9 @@
       <defaultValues>
         <defaultValue>2005-01-01T00:00:00.000Z</defaultValue>
       </defaultValues>
-    </propertyDef>
-    <propertyDef name="test:doubleProperty"
-                 requiredType="Double" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:doubleProperty"
+                 requiredType="Double" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>[,0.0)</valueConstraint>
@@ -110,9 +110,9 @@
       <defaultValues>
         <defaultValue>1.5</defaultValue>
       </defaultValues>
-    </propertyDef>
-    <propertyDef name="test:longProperty"
-                 requiredType="Long" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:longProperty"
+                 requiredType="Long" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>(-10,0]</valueConstraint>
@@ -122,9 +122,9 @@
       <defaultValues>
         <defaultValue>25</defaultValue>
       </defaultValues>
-    </propertyDef>
-    <propertyDef name="test:nameProperty"
-                 requiredType="Name" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:nameProperty"
+                 requiredType="Name" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>test:testName</valueConstraint>
@@ -132,23 +132,23 @@
       <defaultValues>
         <defaultValue>test:testName</defaultValue>
       </defaultValues>
-    </propertyDef>
-    <propertyDef name="test:pathProperty"
-                 requiredType="Path" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:pathProperty"
+                 requiredType="Path" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>/test:testPath</valueConstraint>
       </valueConstraints>
-    </propertyDef>
-    <propertyDef name="test:referenceProperty"
-                 requiredType="Reference" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:referenceProperty"
+                 requiredType="Reference" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="false">
       <valueConstraints>
         <valueConstraint>test:testType</valueConstraint>
       </valueConstraints>
-    </propertyDef>
-    <propertyDef name="test:stringProperty"
-                 requiredType="String" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:stringProperty"
+                 requiredType="String" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="true">
       <valueConstraints>
         <valueConstraint>bananas?</valueConstraint>
@@ -157,35 +157,35 @@
         <defaultValue>banana</defaultValue>
         <defaultValue>bananas</defaultValue>
       </defaultValues>
-    </propertyDef>
-    <propertyDef name="test:multipleProperty"
-                 requiredType="undefined" autoCreate="false" mandatory="false"
+    </propertyDefinition>
+    <propertyDefinition name="test:multipleProperty"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
                  onParentVersion="IGNORE" protected="false" multiple="true"/>
   </nodeType>
 
   <nodeType name="test:childNodeType"
             isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
-    <childNodeDef name="test:emptyNode"
-                  defaultPrimaryType="" sameNameSibs="false"
-                  autoCreate="false" mandatory="false"
+    <childNodeDefinition name="test:emptyNode"
+                  defaultPrimaryType="" sameNameSiblings="false"
+                  autoCreated="false" mandatory="false"
                   onParentVersion="IGNORE" protected="false"/>
-    <childNodeDef name="test:siblingNode"
-                  defaultPrimaryType="" sameNameSibs="true"
-                  autoCreate="false" mandatory="false"
+    <childNodeDefinition name="test:siblingNode"
+                  defaultPrimaryType="" sameNameSiblings="true"
+                  autoCreated="false" mandatory="false"
                   onParentVersion="IGNORE" protected="false"/>
-    <childNodeDef name="test:defaultTypeNode"
-                  defaultPrimaryType="test:testType" sameNameSibs="false"
-                  autoCreate="false" mandatory="false"
+    <childNodeDefinition name="test:defaultTypeNode"
+                  defaultPrimaryType="test:testType" sameNameSiblings="false"
+                  autoCreated="false" mandatory="false"
                   onParentVersion="IGNORE" protected="false"/>
-    <childNodeDef name="test:requiredTypeNode"
-                  defaultPrimaryType="" sameNameSibs="false"
-                  autoCreate="false" mandatory="false"
+    <childNodeDefinition name="test:requiredTypeNode"
+                  defaultPrimaryType="" sameNameSiblings="false"
+                  autoCreated="false" mandatory="false"
                   onParentVersion="IGNORE" protected="false">
       <requiredPrimaryTypes>
         <requiredPrimaryType>test:baseType</requiredPrimaryType>
         <requiredPrimaryType>test:testType</requiredPrimaryType>
       </requiredPrimaryTypes>
-    </childNodeDef>
+    </childNodeDefinition>
   </nodeType>
 
 </nodeTypes>

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/observation/ReorderTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/observation/ReorderTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/observation/ReorderTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/observation/ReorderTest.java Thu Apr 14 04:50:38 2005
@@ -64,7 +64,7 @@
          *      + nodename1[4] (was 2)
          */
         Node n = testRootNode.addNode(nodeName1, testNodeType);
-        if (!n.getDefinition().allowSameNameSibs()) {
+        if (!n.getDefinition().allowsSameNameSiblings()) {
             throw new NotExecutableException("Node at " + testRoot + " does not allow same name siblings with name " + nodeName1);
         }
         testRootNode.addNode(nodeName1, testNodeType);

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/search/AbstractQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/search/AbstractQueryTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/search/AbstractQueryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/search/AbstractQueryTest.java Thu Apr 14 04:50:38 2005
@@ -74,7 +74,7 @@
         // now check property count
         int count = 0;
         log.println("Properties:");
-        String[] propNames = result.getPropertyNames();
+        String[] propNames = result.getColumnNames();
         for (RowIterator it = result.getRows(); it.hasNext();) {
             StringBuffer msg = new StringBuffer();
             Value[] values = it.nextRow().getValues();

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AbstractWorkspaceSameNameSibsTest.java Thu Apr 14 04:50:38 2005
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.test.api;
 
 import javax.jcr.nodetype.NoSuchNodeTypeException;
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeManager;
 
@@ -31,12 +31,12 @@
 abstract class AbstractWorkspaceSameNameSibsTest extends AbstractWorkspaceCopyBetweenTest {
 
     /**
-     * Node type with sameNameSibs=true ChildNodeDef
+     * Node type with sameNameSibs=true NodeDef
      */
     protected final String PROP_SAME_NAME_SIBS_TRUE_NODE_TYPE = "sameNameSibsTrueNodeType";
 
     /**
-     * Node type with sameNameSibs=false ChildNodeDef
+     * Node type with sameNameSibs=false NodeDef
      */
     protected final String PROP_SAME_NAME_SIBS_FALSE_NODE_TYPE = "sameNameSibsFalseNodeType";
 
@@ -63,10 +63,10 @@
             if (sameNameSibsTrueNodeType == null) {
                 fail("Property 'sameNameSibsTrueNodeType' does not define a nodetype where sameNameSibs are allowed: '" + sameNameSibsTrueNodeType.getName() + "'");
             } else {
-                NodeDef[] childNodeDefs = sameNameSibsTrueNodeType.getDeclaredChildNodeDefs();
+                NodeDefinition[] childNodeDefs = sameNameSibsTrueNodeType.getDeclaredChildNodeDefinitions();
                 boolean isSameNameSibs = false;
                 for (int i = 0; i < childNodeDefs.length; i++) {
-                    if (childNodeDefs[i].allowSameNameSibs()) {
+                    if (childNodeDefs[i].allowsSameNameSiblings()) {
                         isSameNameSibs = true;
                         break;
                     }
@@ -86,10 +86,10 @@
             if (sameNameSibsFalseNodeType == null) {
                 fail("Property 'sameNameSibsFalseNodeType' does define a nodetype where sameNameSibs are allowed: '" + sameNameSibsFalseNodeType.getName() + "'");
             } else {
-                NodeDef[] childNodeDefs = sameNameSibsFalseNodeType.getDeclaredChildNodeDefs();
+                NodeDefinition[] childNodeDefs = sameNameSibsFalseNodeType.getDeclaredChildNodeDefinitions();
                 boolean isSameNameSibs = true;
                 for (int i = 0; i < childNodeDefs.length; i++) {
-                    if (!childNodeDefs[i].allowSameNameSibs()) {
+                    if (!childNodeDefs[i].allowsSameNameSiblings()) {
                         isSameNameSibs = false;
                         break;
                     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AddNodeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AddNodeTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AddNodeTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/AddNodeTest.java Thu Apr 14 04:50:38 2005
@@ -61,7 +61,7 @@
      * siblings are not supported a ItemExistsException is thrown.
      */
     public void testSameNameSiblings() throws RepositoryException {
-        if (testRootNode.getDefinition().allowSameNameSibs()) {
+        if (testRootNode.getDefinition().allowsSameNameSiblings()) {
             Node n1 = testRootNode.addNode(nodeName1, testNodeType);
             Node n2 = testRootNode.addNode(nodeName1, testNodeType);
             testRootNode.save();

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportSysViewTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportSysViewTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportSysViewTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportSysViewTest.java Thu Apr 14 04:50:38 2005
@@ -176,7 +176,7 @@
             if (workspace) {
                 //workspace.exportSysView(testPath, contentHandler, skipBinary, noRecurse);
             } else {
-                session.exportSysView(testPath, contentHandler, skipBinary, noRecurse);
+                session.exportSystemView(testPath, contentHandler, skipBinary, noRecurse);
             }
         } catch (RepositoryException re) {
             fail("Could not initialize the contenthandler due to: " + re.toString());
@@ -199,7 +199,7 @@
             thisSession = workspace.getSession();
         }
         try {
-            thisSession.exportSysView(testPath, os, false, false);
+            thisSession.exportSystemView(testPath, os, false, false);
             SysViewParser parser = new SysViewParser(testPath, thisSession, SAVEBINARY, RECURSE);
             parser.parse(file);
         } catch (RepositoryException re) {

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeIteratorTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeIteratorTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeIteratorTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeIteratorTest.java Thu Apr 14 04:50:38 2005
@@ -59,15 +59,15 @@
     }
 
     /**
-     * Tests if {@link javax.jcr.NodeIterator#getPos()} return correct values.
+     * Tests if {@link javax.jcr.NodeIterator#getPosition()} return correct values.
      */
     public void testGetPos() throws RepositoryException {
         NodeIterator iter = testRootNode.getNodes();
-        assertEquals("Initial call to getPos() must return zero", 0, iter.getPos());
+        assertEquals("Initial call to getPos() must return zero", 0, iter.getPosition());
         int index = 0;
         while (iter.hasNext()) {
             iter.nextNode();
-            assertEquals("Wrong position returned by getPos()", ++index, iter.getPos());
+            assertEquals("Wrong position returned by getPos()", ++index, iter.getPosition());
         }
     }
 

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeReadMethodsTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeReadMethodsTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeReadMethodsTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeReadMethodsTest.java Thu Apr 14 04:50:38 2005
@@ -244,7 +244,7 @@
                 fail("Wrong accept method executed.");
             }
 
-            public void visit(Node node) {
+            public void visit(Node node) throws RepositoryException {
                 assertTrue("Visited node is not the same as the one passed in method visit(Node)",
                         n.isSame(node));
             }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeTest.java Thu Apr 14 04:50:38 2005
@@ -859,54 +859,6 @@
     }
 
     /**
-     * Moves an unreferencable node with one session and saves the same node
-     * using a different session at same time.<br/> <br/> Procedure: <ul>
-     * <li>Creates node 1 and node 2 with session 1</li> <li>Gets reference to
-     * node 1 using session 2</li> <li>session 1 moves node 1 under node 2 ,
-     * saves using parent nodes {@link Node#save()}</li> <li>session 2 modifies
-     * node 1 by adding a child node, saves using </code>Node.save()</code></li>
-     * </ul> Should throw {@link javax.jcr.InvalidItemStateException} since
-     * saving an unreferencable node that has been moved by and other session is
-     * not possible. <br/><br/>Prerequisites: <ul> <li><code>javax.jcr.tck.nodetype</code>
-     * must accept children of same nodetype and it must not be
-     * referencable</li> </ul>
-     */
-    public void testSaveMovedNotRefNode() throws RepositoryException {
-        // get default workspace test root node using superuser session
-        Node defaultRootNode = (Node) superuser.getItem(testRootNode.getPath());
-
-        // create non referenciable node to be moved with session 1
-        Node testNodeSession1 = defaultRootNode.addNode(nodeName1, testNodeType);
-
-        // create a second node with session 1 that will serve as new parent
-        Node newParentNodeSession1 = defaultRootNode.addNode(nodeName2, testNodeType);
-
-        // save the new nodes
-        defaultRootNode.save();
-
-        // get the moving node with session 2
-        Session testSession = helper.getReadWriteSession();
-        Node testNodeSession2 = (Node) testSession.getItem(testNodeSession1.getPath());
-
-        //move the node with session 1
-        superuser.move(testNodeSession1.getPath(), newParentNodeSession1.getPath() + "/testNewName");
-
-        // make the move persistent with session 1
-        defaultRootNode.save();
-
-        // add a child to the node with session
-        testNodeSession2.addNode(nodeName3, testNodeType);
-
-        // save it
-        try {
-            defaultRootNode.save();
-            fail("Saving a unreferencedable Node that has been moved by other session should throw InvalidItemStateException");
-        } catch (InvalidItemStateException e) {
-            // ok, works as expected
-        }
-    }
-
-    /**
      * Checks if {@link javax.jcr.Node#refresh(boolean refresh)} works properly
      * with <code>refresh</code> set to <code>false</code>.<br/> <br/>
      * Procedure: <ul> <li>Creates two nodes with session 1</li> <li>Modifies

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeUUIDTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeUUIDTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeUUIDTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/NodeUUIDTest.java Thu Apr 14 04:50:38 2005
@@ -131,64 +131,6 @@
     }
 
     /**
-     * Moves a node using {@link javax.jcr.Session#move(String, String)} and
-     * places a new <b>referenceable</b> node at the source position with same
-     * name. A second session tries to save changes made to the moved node using
-     * {@link Node#save()}. <br/> Procedure: <ul> <li>Create node 1 and node 2
-     * with session 1</li> <li>Session 2 gets a reference to node 1</li>
-     * <li>Session 1 moves node 1 under node 2 , saves</li> <li>session 1 adds
-     * new referencable node previous position of node 1</li> <li>session 2
-     * modifes node, saves</li> </ul> This should fail since the node that
-     * replaces the moved node is referencable. Should throw {@link
-     * javax.jcr.InvalidItemStateException}. <br><br>Prerequisites: <ul>
-     * <li><code>javax.jcr.tck.nodetype</code> must allow children of
-     * itself.</li> <li><code>javax.jcr.tck.propertyname1</code> name of a
-     * property that can be modified in <code>javax.jcr.tck.nodetype</code> for
-     * testing</li> <li><code>javax.jcr.tck.NodeUUIDTest.nodetype2</code> must
-     * have the mixin type <code>mix:referenceable</code> assigned.</li> </ul>
-     */
-    public void testSaveReplacedNotRefNodeByRefNode() throws RepositoryException, NotExecutableException {
-        checkMixReferenceable();
-        // get default workspace test root node using superuser session
-        Node defaultRootNode = (Node) superuser.getItem(testRootNode.getPath());
-
-        // create a node
-        Node parentNode = defaultRootNode.addNode(nodeName1, testNodeType);
-
-        // create a moving node
-        Node movingNode = defaultRootNode.addNode(nodeName2, testNodeType);
-
-        // save the new nodes
-        defaultRootNode.save();
-
-        // get the moving node with session 2
-        Session testSession = helper.getReadWriteSession();
-        Node movingNodeSession2 = (Node) testSession.getItem(movingNode.getPath());
-
-        //move the node with session 1
-        superuser.move(movingNode.getPath(), parentNode.getPath() + "/" + nodeName3);
-
-        // repace it it with a referenciable node
-        parentNode.addNode(nodeName2, getProperty("nodetype2"));
-
-        // make the move and adding of new node persistent with session 1
-        defaultRootNode.save();
-
-        // modify some prop of the moved node
-        movingNodeSession2.setProperty(propertyName1, "test");
-
-        // save it
-        try {
-            movingNodeSession2.save();
-            fail("Saving a unreferenceable Node using Node.save() that has been moved and replaced by a referenceable node in the meantime should" +
-                    " throw InvalidItemStateException");
-        } catch (InvalidItemStateException e) {
-            // ok, what's expected
-        }
-        testSession.logout();
-    }
-
-    /**
      * Checks if the repository supports the mixin mix:Referenceable otherwise a
      * {@link NotExecutableException} is thrown.
      *

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PropertyReadMethodsTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PropertyReadMethodsTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PropertyReadMethodsTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/PropertyReadMethodsTest.java Thu Apr 14 04:50:38 2005
@@ -19,16 +19,16 @@
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 
-import javax.jcr.Session;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.ItemVisitor;
 import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.PropertyIterator;
+import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
-import javax.jcr.ItemNotFoundException;
-import javax.jcr.ItemVisitor;
+import javax.jcr.Session;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
-import javax.jcr.PropertyType;
 import java.util.NoSuchElementException;
 
 /**
@@ -203,7 +203,8 @@
         final Property p = property;
 
         ItemVisitor itemVisitor = new ItemVisitor() {
-            public void visit(Property property) {
+            public void visit(Property property)
+                    throws RepositoryException {
                 assertTrue("Visited Property is not the same as the one returned by visit(Property).",
                         p.isSame(property));
             }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SerializationTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SerializationTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SerializationTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SerializationTest.java Thu Apr 14 04:50:38 2005
@@ -18,30 +18,31 @@
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
-import org.xml.sax.helpers.XMLReaderFactory;
 import org.xml.sax.ContentHandler;
-import org.xml.sax.XMLReader;
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
 
-import javax.jcr.lock.LockException;
-import javax.jcr.lock.Lock;
-import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.Workspace;
-import javax.jcr.Session;
-import javax.jcr.RepositoryException;
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.ItemExistsException;
 import javax.jcr.Node;
-import javax.jcr.Repository;
 import javax.jcr.PathNotFoundException;
-import javax.jcr.ItemExistsException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
 import java.io.File;
-import java.io.IOException;
 import java.io.FileInputStream;
-import java.io.StringReader;
-import java.io.Reader;
-import java.io.FileOutputStream;
 import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
 
 /**
  * <code>SerializationTest</code> contains the test cases for the method
@@ -96,7 +97,7 @@
 
         FileInputStream in = new FileInputStream(file);
         try {
-            session.importXML(n.getPath(), in);
+            session.importXML(n.getPath(), in, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
             fail("Importing to a checked-in node must throw a ConstraintViolationException.");
         } catch (ConstraintViolationException e) {
             // success
@@ -113,7 +114,7 @@
         Node n = initVersioningException(false);
         FileInputStream in = new FileInputStream(file);
         try {
-            session.importXML(n.getPath(), in);
+            session.importXML(n.getPath(), in, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
             fail("Importing to a child of a checked-in node must throw a ConstraintViolationException.");
         } catch (ConstraintViolationException e) {
             // success
@@ -163,7 +164,7 @@
             session.removeLockToken(lock.getLockToken());   //remove the token, so the lock is for me, too
             FileInputStream in = new FileInputStream(file);
             try {
-                session.importXML(lNode.getPath(), in);
+                session.importXML(lNode.getPath(), in, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
                 fail("De-serializing to a locked node must throw a lock exception.");
             } catch (LockException e) {
                 // success
@@ -181,7 +182,8 @@
         StringReader in = new StringReader("<this is not a <valid> <xml> file/>");
         ContentHandler ih = null;
         try {
-            ih = session.getImportContentHandler(treeComparator.targetFolder);
+            ih = session.getImportContentHandler(treeComparator.targetFolder,
+                    ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
         } catch (RepositoryException e) {
             fail("ImportHandler not created: " + e);
         }
@@ -225,7 +227,8 @@
     public void testGetImportContentHandlerExceptions() throws RepositoryException {
         //Specifying a path that does not exist throws a PathNotFound exception
         try {
-            session.getImportContentHandler(treeComparator.targetFolder + "/thisIsNotAnExistingNode");
+            session.getImportContentHandler(treeComparator.targetFolder + "/thisIsNotAnExistingNode",
+                    ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
             fail("Specifying a non-existing path must throw a PathNotFoudException.");
         } catch (PathNotFoundException e) {
             // success
@@ -241,7 +244,8 @@
 
         // If no node exists at parentAbsPath, a PathNotFoundException is thrown.
         try {
-            session.importXML(treeComparator.targetFolder + "/thisNodeDoesNotExist", in);
+            session.importXML(treeComparator.targetFolder + "/thisNodeDoesNotExist",
+                    in, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
             fail("Importing to a non-existing node does not throw a PathNotFoundException.");
         } catch (PathNotFoundException e) {
             // success
@@ -280,14 +284,15 @@
         subfolder = folder.addNode("mySubFolder", "nt:folder");
         session.save();
         out = new FileOutputStream(file);
-        session.exportSysView(subfolder.getPath(), out, true, true);
+        session.exportSystemView(subfolder.getPath(), out, true, true);
         subfolder.addNode("mySubSubFolder", "nt:folder");
         subfolder.remove();
         session.save();
         in = new FileInputStream(file);
 
         try {
-            session.importXML(folder.getPath(), in);
+            session.importXML(folder.getPath(), in,
+                    ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
             session.save();
             fail("Overwriting an existing node during import must throw an ItemExistsException");
         } catch (ItemExistsException e) {
@@ -302,7 +307,8 @@
     public void testSessionImportXml() throws RepositoryException, IOException {
         FileInputStream in = new FileInputStream(file);
         exportRepository(SAVEBINARY, RECURSE);
-        session.importXML(treeComparator.targetFolder, in);
+        session.importXML(treeComparator.targetFolder, in,
+                ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
 
         // after logout/login, no nodes are in the session
         session.logout();
@@ -411,7 +417,7 @@
         try {
             out = new FileOutputStream(file);
             session.refresh(false); //move the workspace into the session, then save it. The workspace is always valid, the session not necessarily.
-            session.exportSysView(treeComparator.getSourceRootPath(), out, skipBinary, noRecurse);
+            session.exportSystemView(treeComparator.getSourceRootPath(), out, skipBinary, noRecurse);
         } catch (RepositoryException e) {
             fail("Could not export the repository: " + e);
         }
@@ -445,7 +451,8 @@
                     fail("Error while parsing the imported repository: " + e);
                 }
             } else {
-                ContentHandler ih = session.getImportContentHandler(treeComparator.targetFolder);
+                ContentHandler ih = session.getImportContentHandler(treeComparator.targetFolder,
+                        ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
                 try {
                     XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
                     parser.setContentHandler(ih);
@@ -459,7 +466,8 @@
             if (workspace) {
                 this.workspace.importXML(treeComparator.targetFolder, in, 0);
             } else {
-                session.importXML(treeComparator.targetFolder, in);
+                session.importXML(treeComparator.targetFolder, in,
+                        ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
             }
         }
     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionTest.java Thu Apr 14 04:50:38 2005
@@ -381,54 +381,6 @@
     }
 
     /**
-     * Moves an unreferencable node with one session and saves the same node
-     * using a different session at same time.<br/> <br/> Procedure: <ul>
-     * <li>Creates node 1 and node 2 with session 1</li> <li>Gets reference to
-     * node 1 using session 2</li> <li>session 1 moves node 1 under node 2 ,
-     * saves using session1.save()</li> <li>session 2 modifies node 1 by adding
-     * a child node, saves using session2.save()</li> </ul> Should throw {@link
-     * javax.jcr.InvalidItemStateException} since saving an unreferencable node
-     * that has been moved by and other session is not possible.
-     * <br/><br/>Prerequisites: <ul> <li><code>javax.jcr.tck.nodetype</code>
-     * must accept children of same nodetype and it must not be
-     * referencable</li> </ul>
-     */
-    public void testSaveMovedNotRefNode() throws RepositoryException {
-        // get default workspace test root node using superuser session
-        Node defaultRootNode = (Node) superuser.getItem(testRootNode.getPath());
-
-        // create non referenciable node to be moved with session 1
-        Node testNodeSession1 = defaultRootNode.addNode(nodeName1, testNodeType);
-
-        // create a second node with session 1 that will serve as new parent
-        Node newParentNodeSession1 = defaultRootNode.addNode(nodeName2, testNodeType);
-
-        // save the new nodes
-        superuser.save();
-
-        // get the moving node with session 2
-        Session testSession = helper.getReadWriteSession();
-        Node testNodeSession2 = (Node) testSession.getItem(testNodeSession1.getPath());
-
-        //move the node with session 1
-        superuser.move(testNodeSession1.getPath(), newParentNodeSession1.getPath() + "/" + nodeName1);
-
-        // make the move persistent with session 1
-        superuser.save();
-
-        // add a child to the node with session
-        testNodeSession2.addNode(nodeName3, testNodeType);
-
-        // save it
-        try {
-            testSession.save();
-            fail("Saving a unreferencedable Node that has been moved by other session should throw InvalidItemStateException");
-        } catch (InvalidItemStateException e) {
-            // ok, works as expected
-        }
-    }
-
-    /**
      * Checks if {@link javax.jcr.Session#refresh(boolean refresh)} works
      * properly with <code>refresh</code> set to <code>false</code>.<br/> <br/>
      * Procedure: <ul> <li>Creates two nodes with session 1</li> <li>Modifies

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionUUIDTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionUUIDTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionUUIDTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SessionUUIDTest.java Thu Apr 14 04:50:38 2005
@@ -130,66 +130,4 @@
 
         // ok, works as expected
     }
-
-    /**
-     * Moves a node using {@link javax.jcr.Session#move(String, String)} and places a new <b>referenceable</b> node
-     * at the source position with same name. A second session tries to save changes made to the moved node using
-     * {@link Session#save()}.
-     * <br/>
-     * Procedure:
-     * <ul>
-     * <li>Create node 1 and node 2 with session 1</li>
-     * <li>Session 2 gets a reference to node 1</li>
-     * <li>Session 1 moves node 1 under node 2 , saves</li>
-     * <li>session 1 adds new referencable node previous position of node 1</li>
-     * <li>session 2 modifes node, saves</li>
-     * </ul>
-     * This should fail since the node that replaces the moved node is referencable. Should
-     * throw {@link javax.jcr.InvalidItemStateException}.
-     * <br><br>Prerequisites:
-     * <ul>
-     * <li><code>javax.jcr.tck.nodetype</code> must allow children of itself.</li>
-     * <li><code>javax.jcr.tck.propertyname1</code>
-     * name of a property that can be modified in <code>javax.jcr.tck.nodetype</code> for testing</li>
-     * <li><code>javax.jcr.tck.SessionUUIDTest.nodetype2</code> must have the mixin type <code>mix:referenceable</code> assigned.</li>
-     * </ul>
-     */
-    public void testSaveReplacedNotRefNodeByRefNode() throws RepositoryException {
-        // get default workspace test root node using superuser session
-        Node defaultRootNode = (Node) superuser.getItem(testRootNode.getPath());
-
-        // create a node
-        Node parentNode = defaultRootNode.addNode(nodeName1, testNodeType);
-
-        // create a moving node
-        Node movingNode = defaultRootNode.addNode(nodeName2, testNodeType);
-
-        // save the new nodes
-        superuser.save();
-
-        // get the moving node with session 2
-        Session testSession = helper.getReadWriteSession();
-        Node movingNodeSession2 = (Node) testSession.getItem(movingNode.getPath());
-
-        //move the node with session 1
-        superuser.move(movingNode.getPath(), parentNode.getPath() + "/" + nodeName2);
-
-        // repace it it with a referenciable node
-        parentNode.addNode(nodeName3, getProperty("nodetype2"));
-
-        // make the move and adding of new node persistent with session 1
-        superuser.save();
-
-        // modify some prop of the moved node
-        movingNodeSession2.setProperty(propertyName1, "test");
-
-        // save it
-        try {
-            testSession.save();
-            fail("Saving a unreferenceable Node using Session.save() that has been moved and replaced by a referenceable node in the meantime should" +
-                    " throw InvalidItemStateException");
-        } catch (InvalidItemStateException e) {
-            // ok, what's expected
-        }
-    }
 }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/lock/LockTest.java Thu Apr 14 04:50:38 2005
@@ -173,7 +173,7 @@
         // lock node
         Lock lock = n1.lock(false, true);
 
-        if (n1.getSession().getUserId() == null) {
+        if (n1.getSession().getUserID() == null) {
             assertFalse("jcr:lockOwner must not exist if Session.getUserId() returns null",
                     n1.hasProperty(jcrLockOwner));
         } else {
@@ -201,7 +201,7 @@
 
         assertEquals("getLockOwner() must return the same value as returned " +
                 "by Session.getUserId at the time that the lock was placed",
-                testRootNode.getSession().getUserId(),
+                testRootNode.getSession().getUserID(),
                 lock.getLockOwner());
 
         n1.unlock();

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithNodeTypeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithNodeTypeTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithNodeTypeTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithNodeTypeTest.java Thu Apr 14 04:50:38 2005
@@ -19,9 +19,9 @@
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 
-import javax.jcr.Session;
 import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeManager;
 
@@ -70,16 +70,16 @@
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
      * returns true if <code>childNodeName</code> and <code>nodeTypeName</code>
-     * match the <code>ChildNodeDef</code>.
+     * match the <code>NodeDef</code>.
      */
     public void testDefinedAndLegalType()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No child node def with " +
-                                             "defaultPrimaryType found");
+                    "defaultPrimaryType found");
         }
 
         NodeType nodeType = nodeDef.getDeclaringNodeType();
@@ -87,20 +87,20 @@
         String nodeTypeName = nodeDef.getRequiredPrimaryTypes()[0].getName();
 
         assertTrue("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
-                   "must return true if childNodeName and nodeTypeName match the " +
-                   "child node def of NodeType.",
-                   nodeType.canAddChildNode(childNodeName, nodeTypeName));
+                "must return true if childNodeName and nodeTypeName match the " +
+                "child node def of NodeType.",
+                nodeType.canAddChildNode(childNodeName, nodeTypeName));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
      * returns false if <code>childNodeName</code> does and <code>nodeTypeName</code>
-     * does not match the <code>ChildNodeDef</code>.
+     * does not match the <code>NodeDef</code>.
      */
     public void testDefinedAndIllegalType()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No testable node type found.");
@@ -116,19 +116,19 @@
         }
 
         assertFalse("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
-                    "must return false if childNodeName does and nodeTypeName does not " +
-                    "match the child node def of NodeType.",
-                    nodeType.canAddChildNode(childNodeName, illegalType));
+                "must return false if childNodeName does and nodeTypeName does not " +
+                "match the child node def of NodeType.",
+                nodeType.canAddChildNode(childNodeName, illegalType));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
-     * returns false if <code>childNodeName</code> does not match the <code>ChildNodeDef</code>.
+     * returns false if <code>childNodeName</code> does not match the <code>NodeDef</code>.
      */
     public void testUndefined()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, true, false);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, true, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No testable node type found.");
@@ -139,20 +139,20 @@
         String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);
 
         assertFalse("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
-                    "must return false if childNodeName does not match the " +
-                    "child node def of NodeType.",
-                    nodeType.canAddChildNode(undefinedName, type));
+                "must return false if childNodeName does not match the " +
+                "child node def of NodeType.",
+                nodeType.canAddChildNode(undefinedName, type));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
-     * returns true if <code>childNodeName</code> does not match the <code>ChildNodeDef</code>
-     * but <code>nodeTypeName</code> matches the node type of a residual <code>ChildNodeDef</code>.
+     * returns true if <code>childNodeName</code> does not match the <code>NodeDef</code>
+     * but <code>nodeTypeName</code> matches the node type of a residual <code>NodeDef</code>.
      */
     public void testResidualAndLegalType()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, true);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, true);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No testable residual child node def.");
@@ -163,21 +163,21 @@
         String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);
 
         assertTrue("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
-                   "must return true for a not defined childNodeName if nodeTypeName " +
-                   "matches the type of a residual child node def",
-                   nodeType.canAddChildNode(undefinedName, type));
+                "must return true for a not defined childNodeName if nodeTypeName " +
+                "matches the type of a residual child node def",
+                nodeType.canAddChildNode(undefinedName, type));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
-     * returns false if <code>childNodeName</code> does not match the <code>ChildNodeDef</code>
+     * returns false if <code>childNodeName</code> does not match the <code>NodeDef</code>
      * and <code>nodeTypeName</code> does not matches the node type of a residual
-     * <code>ChildNodeDef</code>.
+     * <code>NodeDef</code>.
      */
     public void testResidualAndIllegalType()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, true);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, true);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No testable residual child node def.");
@@ -193,8 +193,8 @@
         }
 
         assertFalse("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
-                    "must return false for a not defined childNodeName if nodeTypeName " +
-                    "does not matches the type of a residual child node def",
-                    nodeType.canAddChildNode(undefinedName, illegalType));
+                "must return false for a not defined childNodeName if nodeTypeName " +
+                "does not matches the type of a residual child node def",
+                nodeType.canAddChildNode(undefinedName, illegalType));
     }
 }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithoutNodeTypeTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithoutNodeTypeTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithoutNodeTypeTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanAddChildNodeCallWithoutNodeTypeTest.java Thu Apr 14 04:50:38 2005
@@ -18,10 +18,11 @@
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
-import javax.jcr.Session;
+
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.NodeDef;
 
 /**
  * Tests <code>NodeType.canAddChildNode(String childNodeName)</code> returns true if
@@ -62,58 +63,57 @@
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
-     * true if <code>NodeType</code> contains a <code>ChildNodeDef</code>  named
+     * true if <code>NodeType</code> contains a <code>NodeDef</code>  named
      * <code>childNodeName</code> with a default primary type.
      */
     public void testDefinedWithDefault()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, true, false);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, true, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No child node def with " +
-                                             "defaultPrimaryType found");
+                    "defaultPrimaryType found");
         }
 
         NodeType nodeType = nodeDef.getDeclaringNodeType();
 
         assertTrue("NodeType.canAddChildNode(String childNodeName) must return " +
-                   "true if child node def 'childNodeName' defines a defaultPrimaryType.",
-                   nodeType.canAddChildNode(nodeDef.getName()));
+                "true if child node def 'childNodeName' defines a defaultPrimaryType.",
+                nodeType.canAddChildNode(nodeDef.getName()));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
-     * true if <code>NodeType</code> contains a <code>ChildNodeDef</code>  named
+     * true if <code>NodeType</code> contains a <code>NodeDef</code>  named
      * <code>childNodeName</code> without a default primary type.
      */
     public void testDefinedWithoutDefault()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, false, false);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, false, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No child node def without " +
-                                             "defaultPrimaryType found");
+                    "defaultPrimaryType found");
         }
 
         NodeType nodeType = nodeDef.getDeclaringNodeType();
 
         assertFalse("NodeType.canAddChildNode(String childNodeName) must return false " +
-                    "if child node def 'childNodeName' does not define a defaultPrimaryType.",
-                    nodeType.canAddChildNode(nodeDef.getName()));
+                "if child node def 'childNodeName' does not define a defaultPrimaryType.",
+                nodeType.canAddChildNode(nodeDef.getName()));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
-     * true if <code>NodeType</code> nor does contain a <code>ChildNodeDef</code>  named
+     * true if <code>NodeType</code> nor does contain a <code>NodeDef</code>  named
      * <code>childNodeName</code> nor a residual definition.
-     *
      */
     public void testUndefined()
-        throws NotExecutableException, RepositoryException {
+            throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, true, false);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, true, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No testable node type found.");
@@ -123,55 +123,55 @@
         String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);
 
         assertFalse("NodeType.canAddChildNode(String childNodeName) must return " +
-                    "false if 'childNodeName' is a undefined child node def",
-                    nodeType.canAddChildNode(undefinedName));
+                "false if 'childNodeName' is a undefined child node def",
+                nodeType.canAddChildNode(undefinedName));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
-     * true if <code>NodeType</code> contains a residual <code>ChildNodeDef</code>
+     * true if <code>NodeType</code> contains a residual <code>NodeDef</code>
      * with a default primary type.
      */
     public void testResidualWithDefault()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, true, true);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, true, true);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No residual child node def " +
-                                             "without a defaultPrimaryType found.");
+                    "without a defaultPrimaryType found.");
         }
 
         NodeType nodeType = nodeDef.getDeclaringNodeType();
         String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);
 
         assertTrue("NodeType.canAddChildNode(String childNodeName) must return " +
-                   "true for a not defined childNodeName if NodeType has a residual child node " +
-                   "definition with a defaultPrimaryType",
-                   nodeType.canAddChildNode(undefinedName));
+                "true for a not defined childNodeName if NodeType has a residual child node " +
+                "definition with a defaultPrimaryType",
+                nodeType.canAddChildNode(undefinedName));
     }
 
     /**
      * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
-     * true if <code>NodeType</code> contains a residual <code>ChildNodeDef</code>
+     * true if <code>NodeType</code> contains a residual <code>NodeDef</code>
      * without a default primary type.
      */
     public void testResidualWithoutDefault()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, false, true);
+        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, false, true);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No residual child node def " +
-                                             "with a defaultPrimaryType found.");
+                    "with a defaultPrimaryType found.");
         }
 
         NodeType nodeType = nodeDef.getDeclaringNodeType();
         String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);
 
         assertFalse("NodeType.canAddChildNode(String childNodeName) must return " +
-                    "false for a not defiend childNodeName if NodeType has a " +
-                    "residual child node definition without a defaultPrimaryType",
-                    nodeType.canAddChildNode(undefinedName));
+                "false for a not defiend childNodeName if NodeType has a " +
+                "residual child node definition without a defaultPrimaryType",
+                nodeType.canAddChildNode(undefinedName));
     }
 }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanRemoveItemTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanRemoveItemTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanRemoveItemTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanRemoveItemTest.java Thu Apr 14 04:50:38 2005
@@ -19,11 +19,11 @@
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 
-import javax.jcr.Session;
 import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.PropertyDef;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
-import javax.jcr.nodetype.NodeDef;
+import javax.jcr.nodetype.PropertyDefinition;
 
 /**
  * Tests <code>NodeType.canRemoveItem(String itemName)</code> returns true if a
@@ -70,8 +70,8 @@
     public void testRemovableProperty()
             throws NotExecutableException, RepositoryException {
 
-        PropertyDef propDef =
-            NodeTypeUtil.locatePropertyDef(session, false, false);
+        PropertyDefinition propDef =
+                NodeTypeUtil.locatePropertyDef(session, false, false);
 
         if (propDef == null) {
             throw new NotExecutableException("No mandatory property def found.");
@@ -80,8 +80,8 @@
         NodeType type = propDef.getDeclaringNodeType();
 
         assertTrue("NodeType.canRemoveIten(String itemName) must return true " +
-                    "if itemName is nor a protected nor a mandatory property def.",
-                    type.canRemoveItem(propDef.getName()));
+                "if itemName is nor a protected nor a mandatory property def.",
+                type.canRemoveItem(propDef.getName()));
     }
 
     /**
@@ -91,8 +91,8 @@
     public void testProtectedProperty()
             throws NotExecutableException, RepositoryException {
 
-        PropertyDef propDef =
-            NodeTypeUtil.locatePropertyDef(session, true, false);
+        PropertyDefinition propDef =
+                NodeTypeUtil.locatePropertyDef(session, true, false);
 
         if (propDef == null) {
             throw new NotExecutableException("No protected property def found.");
@@ -101,8 +101,8 @@
         NodeType type = propDef.getDeclaringNodeType();
 
         assertFalse("NodeType.canRemoveIten(String itemName) must return false " +
-                    "if itemName is a protected property def.",
-                    type.canRemoveItem(propDef.getName()));
+                "if itemName is a protected property def.",
+                type.canRemoveItem(propDef.getName()));
     }
 
     /**
@@ -112,8 +112,8 @@
     public void testMandatoryProperty()
             throws NotExecutableException, RepositoryException {
 
-        PropertyDef propDef =
-            NodeTypeUtil.locatePropertyDef(session, false, true);
+        PropertyDefinition propDef =
+                NodeTypeUtil.locatePropertyDef(session, false, true);
 
         if (propDef == null) {
             throw new NotExecutableException("No mandatory property def found.");
@@ -122,8 +122,8 @@
         NodeType type = propDef.getDeclaringNodeType();
 
         assertFalse("NodeType.canRemoveIten(String itemName) must return false " +
-                    "if itemName is a mandatory property def.",
-                    type.canRemoveItem(propDef.getName()));
+                "if itemName is a mandatory property def.",
+                type.canRemoveItem(propDef.getName()));
     }
 
     /**
@@ -134,8 +134,8 @@
     public void testRemovableChildNode()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef =
-            NodeTypeUtil.locateChildNodeDef(session, false, false);
+        NodeDefinition nodeDef =
+                NodeTypeUtil.locateChildNodeDef(session, false, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No mandatory property def found.");
@@ -144,8 +144,8 @@
         NodeType type = nodeDef.getDeclaringNodeType();
 
         assertTrue("NodeType.canRemoveIten(String itemName) must return true " +
-                   "if itemName is nor a protected nor a mandatory child node def.",
-                   type.canRemoveItem(nodeDef.getName()));
+                "if itemName is nor a protected nor a mandatory child node def.",
+                type.canRemoveItem(nodeDef.getName()));
     }
 
     /**
@@ -155,8 +155,8 @@
     public void testProtectedChildNode()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef =
-            NodeTypeUtil.locateChildNodeDef(session, true, false);
+        NodeDefinition nodeDef =
+                NodeTypeUtil.locateChildNodeDef(session, true, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No mandatory property def found.");
@@ -165,8 +165,8 @@
         NodeType type = nodeDef.getDeclaringNodeType();
 
         assertFalse("NodeType.canRemoveIten(String itemName) must return false " +
-                    "if itemName is a protected child node def.",
-                    type.canRemoveItem(nodeDef.getName()));
+                "if itemName is a protected child node def.",
+                type.canRemoveItem(nodeDef.getName()));
     }
 
     /**
@@ -176,8 +176,8 @@
     public void testMandatoryChildNode()
             throws NotExecutableException, RepositoryException {
 
-        NodeDef nodeDef =
-            NodeTypeUtil.locateChildNodeDef(session, true, false);
+        NodeDefinition nodeDef =
+                NodeTypeUtil.locateChildNodeDef(session, true, false);
 
         if (nodeDef == null) {
             throw new NotExecutableException("No mandatory property def found.");
@@ -186,7 +186,7 @@
         NodeType type = nodeDef.getDeclaringNodeType();
 
         assertFalse("NodeType.canRemoveIten(String itemName) must return false " +
-                    "if itemName is a mandatory child node def.",
-                    type.canRemoveItem(nodeDef.getName()));
+                "if itemName is a mandatory child node def.",
+                type.canRemoveItem(nodeDef.getName()));
     }
 }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java?view=diff&r1=161259&r2=161260
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/CanSetPropertyBinaryTest.java Thu Apr 14 04:50:38 2005
@@ -19,12 +19,12 @@
 import org.apache.jackrabbit.test.AbstractJCRTest;
 import org.apache.jackrabbit.test.NotExecutableException;
 
-import javax.jcr.nodetype.PropertyDef;
-import javax.jcr.nodetype.NodeType;
-import javax.jcr.Session;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 import javax.jcr.Value;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.PropertyDefinition;
 import java.text.ParseException;
 
 /**
@@ -71,7 +71,7 @@
     public void testConversions()
             throws NotExecutableException, RepositoryException {
 
-        PropertyDef propDef =
+        PropertyDefinition propDef =
                 NodeTypeUtil.locatePropertyDef(session, PropertyType.BINARY, false, false, false, false);
 
         if (propDef == null) {
@@ -130,7 +130,7 @@
     public void testConversionsMultiple()
             throws NotExecutableException, RepositoryException {
 
-        PropertyDef propDef =
+        PropertyDefinition propDef =
                 NodeTypeUtil.locatePropertyDef(session, PropertyType.BINARY, true, false, false, false);
 
         if (propDef == null) {
@@ -193,12 +193,12 @@
 
     /**
      * Tests if canSetProperty(String propertyName, Value value) returns false
-     * if value does not match the value constraints of the property def
+     * if value does not satisfy the value constraints of the property def
      */
-    public void testOutOfValueConstraint()
+    public void testValueConstraintNotSatisfied()
             throws NotExecutableException, ParseException, RepositoryException {
 
-        PropertyDef propDef =
+        PropertyDefinition propDef =
                 NodeTypeUtil.locatePropertyDef(session, PropertyType.BINARY, false, false, true, false);
 
         if (propDef == null) {
@@ -225,12 +225,12 @@
 
     /**
      * Tests if canSetProperty(String propertyName, Value[] values) returns
-     * false if values do not match the value constraints of the property def
+     * false if values do not satisfy the value constraints of the property def
      */
-    public void testOutOfValueConstraintMultiple()
+    public void testValueConstraintNotSatisfiedMultiple()
             throws NotExecutableException, ParseException, RepositoryException {
 
-        PropertyDef propDef =
+        PropertyDefinition propDef =
                 NodeTypeUtil.locatePropertyDef(session, PropertyType.BINARY, true, false, true, false);
 
         if (propDef == null) {



Mime
View raw message