You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by tr...@apache.org on 2009/04/16 12:07:33 UTC

svn commit: r765556 [2/2] - in /jackrabbit/trunk: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/jsr283/version/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/ jackrab...

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java Thu Apr 16 10:07:31 2009
@@ -21,6 +21,8 @@
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.api.jsr283.version.Version;
+import org.apache.jackrabbit.api.jsr283.version.VersionHistory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -28,9 +30,8 @@
 import javax.jcr.Item;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
+import javax.jcr.Node;
 import javax.jcr.nodetype.ConstraintViolationException;
-import javax.jcr.version.Version;
-import javax.jcr.version.VersionHistory;
 import java.util.Calendar;
 
 /**
@@ -77,7 +78,7 @@
     /**
      * {@inheritDoc}
      */
-    public Version[] getSuccessors() throws RepositoryException {
+    public javax.jcr.version.Version[] getSuccessors() throws RepositoryException {
         // need to wrap it around proper node
         InternalVersion[] suc = getInternalVersion().getSuccessors();
         Version[] ret = new Version[suc.length];
@@ -90,7 +91,7 @@
     /**
      * {@inheritDoc}
      */
-    public Version[] getPredecessors() throws RepositoryException {
+    public javax.jcr.version.Version[] getPredecessors() throws RepositoryException {
         // need to wrap it around proper node
         InternalVersion[] pred = getInternalVersion().getPredecessors();
         Version[] ret = new Version[pred.length];
@@ -103,23 +104,53 @@
     /**
      * {@inheritDoc}
      */
-    public VersionHistory getContainingHistory() throws RepositoryException {
+    public Version getLinearSuccessor() throws RepositoryException {
+        // get base version. this can certainly be optimized
+        InternalVersionHistory vh = ((VersionHistoryImpl) getContainingHistory())
+                .getInternalVersionHistory();
+        NodeId id = new NodeId(vh.getVersionableUUID());
+        Node vn = session.getNodeById(id);
+        InternalVersion base = ((VersionImpl) vn.getBaseVersion()).getInternalVersion();
+
+        InternalVersion suc = getInternalVersion().getLinearSuccessor(base);
+        return (Version) session.getNodeById(suc.getId());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public javax.jcr.version.Version getLinearPredecessor() throws RepositoryException {
+        InternalVersion pred = getInternalVersion().getLinearPredecessor();
+        return (Version) session.getNodeById(pred.getId());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public javax.jcr.version.VersionHistory getContainingHistory() throws RepositoryException {
         return (VersionHistory) getParent();
     }
 
     /**
      * Returns the frozen node of this version
      *
-     * @return
-     * @throws javax.jcr.RepositoryException
+     * @return the internal frozen node
+     * @throws javax.jcr.RepositoryException if an error occurs
      */
-    public InternalFrozenNode getFrozenNode() throws RepositoryException {
+    public InternalFrozenNode getInternalFrozenNode() throws RepositoryException {
         return getInternalVersion().getFrozenNode();
     }
 
     /**
      * {@inheritDoc}
      */
+    public Node getFrozenNode() throws RepositoryException {
+        return session.getNodeById(getInternalVersion().getFrozenNodeId());
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public boolean isSame(Item otherItem) {
         if (otherItem instanceof VersionImpl) {
             // since all versions live in the same workspace, we can compare the uuids
@@ -142,6 +173,7 @@
      * @param v the version to check
      * @return <code>true</code> if the version is more recent;
      *         <code>false</code> otherwise.
+     * @throws RepositoryException if a repository error occurs
      */
     public boolean isMoreRecent(VersionImpl v) throws RepositoryException {
         return getInternalVersion().isMoreRecent(v.getInternalVersion());
@@ -151,6 +183,7 @@
      * Checks if this is the root version.
      * @return <code>true</code> if this version is the root version;
      *         <code>false</code> otherwise.
+     * @throws RepositoryException if a repository error occurs
      */
     public boolean isRootVersion() throws RepositoryException {
         return getInternalVersion().isRootVersion();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java Thu Apr 16 10:07:31 2009
@@ -26,6 +26,7 @@
 import java.util.ConcurrentModificationException;
 import java.util.LinkedList;
 import java.util.NoSuchElementException;
+import java.util.Arrays;
 
 /**
  * This Class implements a VersionIterator that iterates over a version
@@ -33,13 +34,17 @@
  * the id's of the versions and returns them when iterating. please note, that
  * a version can be deleted while traversing this iterator and the 'nextVesion'
  * would produce a  ConcurrentModificationException.
+ * <p/>
+ * If this iterator is initialized with a base version, it will only iterate
+ * on the versions of a single line of decent from the given root version to the
+ * base version.
  */
 class VersionIteratorImpl implements VersionIterator {
 
     /**
      * the id's of the versions to return
      */
-    private LinkedList versions = new LinkedList();
+    private LinkedList/*<NodeId>*/ versions = new LinkedList/*<NodeId>*/();
 
     /**
      * the current position
@@ -60,12 +65,29 @@
      * Creates a new VersionIterator that iterates over the version tree,
      * starting the root node.
      *
-     * @param rootVersion
+     * @param session repository session
+     * @param rootVersion the root version
      */
     public VersionIteratorImpl(Session session, InternalVersion rootVersion) {
-        this.session = (SessionImpl) session;
+        this(session, rootVersion, null);
+    }
 
-        addVersion(rootVersion);
+    /**
+     * Creates a new VersionIterator that iterates over a single line of decent
+     * of all versions starting at the root version and ending at the given
+     * base version
+     *
+     * @param session repository session
+     * @param rootVersion the root version
+     * @param baseVersion the ending base version
+     */
+    public VersionIteratorImpl(Session session, InternalVersion rootVersion, InternalVersion baseVersion) {
+        this.session = (SessionImpl) session;
+        if (baseVersion == null) {
+            initVersions(rootVersion);
+        } else {
+            initVersions(rootVersion, baseVersion);
+        }
         // retrieve initial size, since size of the list is not stable
         size = versions.size();
     }
@@ -134,25 +156,43 @@
     }
 
     /**
-     * Adds the version 'v' to the list of versions to return and then iterates
-     * over the hierarchy of successors of 'v'.
+     * Adds the version subtree starting at <code>root</code> to the internal
+     * set of versions.
      *
-     * @param v
+     * @param root the root version
      */
-    private synchronized void addVersion(InternalVersion v) {
+    private synchronized void initVersions(InternalVersion root) {
         LinkedList workQueue = new LinkedList();
-        workQueue.add(v);
+        workQueue.add(root);
         while (!workQueue.isEmpty()) {
             InternalVersion currentVersion = (InternalVersion) workQueue.removeFirst();
             NodeId id = currentVersion.getId();
             if (!versions.contains(id)) {
                 versions.add(id);
                 InternalVersion[] successors = currentVersion.getSuccessors();
-                for (int i = 0; i < successors.length; i++) {
-                    workQueue.add(successors[i]);
-                }
+                workQueue.addAll(Arrays.asList(successors));
             }
         }
 
     }
+
+    /**
+     * Adds all versions of a single line of decent starting from <code>root</code>
+     * and ending at <code>base</code>.
+     *
+     * @param root the root version
+     * @param base the base version
+     */
+    private synchronized void initVersions(InternalVersion root, InternalVersion base) {
+        NodeId rootId = root == null ? null : root.getId();
+        while (base != null && !base.getId().equals(rootId)) {
+            versions.addFirst(base.getId());
+            InternalVersion[] preds = base.getPredecessors();
+            if (preds.length == 0) {
+                base = null;
+            } else {
+                base = preds[0];
+            }
+        }
+    }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManager.java Thu Apr 16 10:07:31 2009
@@ -48,7 +48,7 @@
      * only be called by code that already knows that the specified node
      * is versionable.
      *
-     * @param session
+     * @param session workspace session
      * @param node node whose version history should be returned
      * @return identifiers of the version history and root version nodes
      * @throws RepositoryException if an error occurs
@@ -60,17 +60,17 @@
      * invokes the checkin() on the persistent version manager and remaps the
      * newly created version objects.
      *
-     * @param node
-     * @return
-     * @throws RepositoryException
+     * @param node node to checkin
+     * @return the newly created version
+     * @throws RepositoryException if an error occurs
      */
     Version checkin(NodeImpl node) throws RepositoryException;
 
     /**
      * Removes the specified version from the given version history.
-     * @param history
-     * @param versionName
-     * @throws RepositoryException
+     * @param history version history to remove the version from
+     * @param versionName name of the version
+     * @throws RepositoryException if an error occurs
      */
     void removeVersion(VersionHistory history, Name versionName)
             throws RepositoryException;
@@ -83,12 +83,12 @@
      * In either case, the version the label was previously assigned is returned,
      * or <code>null</code> of the label was not moved.
      *
-     * @param history
-     * @param version
-     * @param label
-     * @param move
-     * @return
-     * @throws RepositoryException
+     * @param history version history
+     * @param version name of the version
+     * @param label new label
+     * @param move if <code>true</code> label will be moved
+     * @return the version that had the label or <code>null</code>
+     * @throws RepositoryException if an error occurs
      */
     Version setVersionLabel(VersionHistory history, Name version, Name label,
                             boolean move)
@@ -97,23 +97,44 @@
     /**
      * Returns the version history with the given id
      *
-     * @param id
+     * @param id id of the version history
      * @return the version history.
-     * @throws RepositoryException
+     * @throws RepositoryException if an error occurs
      */
     InternalVersionHistory getVersionHistory(NodeId id)
             throws RepositoryException;
 
     /**
+     * Returns the version history for the versionable node with the given id.
+     *
+     * @param id id of the node to retrieve the version history for
+     * @return the version history
+     * @throws RepositoryException if an error occurs or the history does not exit
+     */
+    InternalVersionHistory getVersionHistoryOfNode(NodeId id)
+            throws RepositoryException;
+
+    /**
      * Returns the version with the given id
      *
-     * @param id
+     * @param id id of the version to retrieve
      * @return the version.
-     * @throws RepositoryException
+     * @throws RepositoryException if an error occurs
      */
     InternalVersion getVersion(NodeId id) throws RepositoryException;
 
     /**
+     * Returns the head version of the node with the given id. this is always
+     * the last of all versions. this only works correctly for liner version
+     * graphs (i.e. simple versioning)
+     *
+     * @param id id of the node to retrieve the version for
+     * @return the version.
+     * @throws RepositoryException if an error occurs
+     */
+    InternalVersion getHeadVersionOfNode(NodeId id) throws RepositoryException;
+
+    /**
      * Close this version manager. After having closed a persistence
      * manager, further operations on this object are treated as illegal
      * and throw

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java Thu Apr 16 10:07:31 2009
@@ -280,9 +280,18 @@
         InternalVersion version = (InternalVersion)
                 escFactory.doSourced((SessionImpl) node.getSession(), new SourcedTarget() {
             public Object run() throws RepositoryException {
-                String histUUID = node.getProperty(NameConstants.JCR_VERSIONHISTORY).getString();
-                return checkin((InternalVersionHistoryImpl)
-                        getVersionHistory(NodeId.valueOf(histUUID)), node);
+                InternalVersionHistory vh;
+                if (node.isNodeType(NameConstants.MIX_VERSIONABLE)) {
+                    // in full versioning, the history id can be retrieved via
+                    // the property
+                    String histUUID = node.getProperty(NameConstants.JCR_VERSIONHISTORY).getString();
+                    vh = getVersionHistory(NodeId.valueOf(histUUID));
+                    return checkin((InternalVersionHistoryImpl) vh, node, false);
+                } else {
+                    // in simple versioning the history id needs to be calculated
+                    vh = getVersionHistoryOfNode(node.getNodeId());
+                    return checkin((InternalVersionHistoryImpl) vh, node, true);
+                }
             }
         });
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionSelector.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionSelector.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionSelector.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionSelector.java Thu Apr 16 10:07:31 2009
@@ -55,9 +55,9 @@
      * is unable to select one, it can return <code>null</code>. Please note,
      * that a version selector is not allowed to return the root version.
      *
-     * @param versionHistory
+     * @param versionHistory version history to select a version from
      * @return A version or <code>null</code>.
-     * @throws RepositoryException if an error occurrs.
+     * @throws RepositoryException if an error occurs.
      */
     Version select(VersionHistory versionHistory) throws RepositoryException;
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java Thu Apr 16 10:07:31 2009
@@ -161,9 +161,19 @@
      */
     public Version checkin(NodeImpl node) throws RepositoryException {
         if (isInXA()) {
-            String histUUID = node.getProperty(NameConstants.JCR_VERSIONHISTORY).getString();
-            InternalVersion version = checkin((InternalVersionHistoryImpl)
-                    getVersionHistory(NodeId.valueOf(histUUID)), node);
+            InternalVersionHistory vh;
+            InternalVersion version;
+            if (node.isNodeType(NameConstants.MIX_VERSIONABLE)) {
+                // in full versioning, the history id can be retrieved via
+                // the property
+                String histUUID = node.getProperty(NameConstants.JCR_VERSIONHISTORY).getString();
+                vh = getVersionHistory(NodeId.valueOf(histUUID));
+                version = checkin((InternalVersionHistoryImpl) vh, node, false);
+            } else {
+                // in simple versioning the history id needs to be calculated
+                vh = getVersionHistoryOfNode(node.getNodeId());
+                version = checkin((InternalVersionHistoryImpl) vh, node, true);
+            }
             return (Version) ((SessionImpl) node.getSession()).getNodeById(version.getId());
         }
         return vMgr.checkin(node);
@@ -371,14 +381,14 @@
      * Before modifying version history given, make a local copy of it.
      */
     protected InternalVersion checkin(InternalVersionHistoryImpl history,
-                                      NodeImpl node)
+                                      NodeImpl node, boolean simple)
             throws RepositoryException {
 
         if (history.getVersionManager() != this) {
             history = makeLocalCopy(history);
             xaItems.put(history.getId(), history);
         }
-        InternalVersion version = super.checkin(history, node);
+        InternalVersion version = super.checkin(history, node, simple);
         NodeId frozenNodeId = version.getFrozenNodeId();
         InternalVersionItem frozenNode = createInternalVersionItem(frozenNodeId);
         if (frozenNode != null) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java Thu Apr 16 10:07:31 2009
@@ -305,7 +305,7 @@
          * todo FIXME delegate to 'node type instance handler'
          */
         EffectiveNodeType ent = itemOps.getEffectiveNodeType(node);
-        if (ent.includesNodeType(NameConstants.MIX_VERSIONABLE)) {
+        if (ent.includesNodeType(NameConstants.MIX_SIMPLE_VERSIONABLE)) {
             /**
              * check if there's already a version history for that
              * node; this would e.g. be the case if a versionable node
@@ -321,25 +321,28 @@
             InternalValue versionId = InternalValue.create(
                     history.getRootVersionId().getUUID());
 
-            // jcr:versionHistory
-            conditionalAddProperty(
-                    node, NameConstants.JCR_VERSIONHISTORY,
-                    PropertyType.REFERENCE, false, historyId);
-
-            // jcr:baseVersion
-            conditionalAddProperty(
-                    node, NameConstants.JCR_BASEVERSION,
-                    PropertyType.REFERENCE, false, versionId);
-
-            // jcr:predecessors
-            conditionalAddProperty(
-                    node, NameConstants.JCR_PREDECESSORS,
-                    PropertyType.REFERENCE, true, versionId);
-
             // jcr:isCheckedOut
             conditionalAddProperty(
                     node, NameConstants.JCR_ISCHECKEDOUT,
                     PropertyType.BOOLEAN, false, InternalValue.create(true));
+            
+            // set extra properties only for full versionable nodes
+            if (ent.includesNodeType(NameConstants.MIX_VERSIONABLE)) {
+                // jcr:versionHistory
+                conditionalAddProperty(
+                        node, NameConstants.JCR_VERSIONHISTORY,
+                        PropertyType.REFERENCE, false, historyId);
+
+                // jcr:baseVersion
+                conditionalAddProperty(
+                        node, NameConstants.JCR_BASEVERSION,
+                        PropertyType.REFERENCE, false, versionId);
+
+                // jcr:predecessors
+                conditionalAddProperty(
+                        node, NameConstants.JCR_PREDECESSORS,
+                        PropertyType.REFERENCE, true, versionId);
+            }
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources-filtered/org/apache/jackrabbit/core/repository.properties Thu Apr 16 10:07:31 2009
@@ -53,6 +53,9 @@
 # The presence of this key indicates that this implementation supports versioning.
 option.versioning.supported = true
 
+# The presence of this key indicates that this implementation supports simple versioning.
+option.simple.versioning.supported = true
+
 # The presence of this key indicates that this implementation supports observation.
 option.observation.supported = true
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/JackrabbitRepositoryStub.properties Thu Apr 16 10:07:31 2009
@@ -410,10 +410,11 @@
 # JAVAX.JCR.VERSIONING CONFIGURATION
 # ==============================================================================
 
-# nodetye that is versionable. if it is not, an attempt is made to create versionable nodes
+# nodetype that is versionable. if it is not, an attempt is made to create versionable nodes
 # by adding a mix:versionable mixin-type.
 # NOTE: javax.jcr.tck.nodetype must define a non-versionable nodetype!
 javax.jcr.tck.version.versionableNodeType=test:versionable
+javax.jcr.tck.version.simpleVersionableNodeType=nt:unstructured
 javax.jcr.tck.version.propertyValue=aPropertyValue
 
 # testroot for the version package
@@ -450,6 +451,8 @@
 javax.jcr.tck.RestoreTest.testRestoreWithUUIDConflict.nodename4=test:versionOnParentVersion
 javax.jcr.tck.RestoreTest.testRestoreLabel.nodename4=test:versionOnParentVersion
 javax.jcr.tck.RestoreTest.testRestoreName.nodename4=test:versionOnParentVersion
+javax.jcr.tck.RestoreTest.propertyValue1=version1
+javax.jcr.tck.RestoreTest.propertyValue2=version2
 
 # Test class: WorkspaceRestoreTest
 javax.jcr.tck.WorkspaceRestoreTest.testRestoreLabel.nodename4=test:versionOnParentVersion
@@ -469,3 +472,36 @@
 javax.jcr.tck.OnParentVersionAbortTest.nodetype=nt:unstructured
 javax.jcr.tck.OnParentVersionIgnoreTest.nodename4=test:ignoreOnParentVersion
 javax.jcr.tck.OnParentVersionIgnoreTest.nodetype=nt:unstructured
+
+# ==============================================================================
+# JAVAX.JCR.VERSIONING CONFIGURATION (simple versioning)
+# ==============================================================================
+
+# nodetype that is versionable. if it is not, an attempt is made to create versionable nodes
+# by adding a mix:versionable mixin-type.
+# NOTE: javax.jcr.tck.nodetype must define a non-versionable nodetype!
+javax.jcr.tck.simple.versionableNodeType=nt:unstructured
+javax.jcr.tck.simple.propertyValue=aPropertyValue
+javax.jcr.tck.simple.destination=/testroot/versionableNodeName3
+
+# testroot for the version package
+# the test root must allow versionable and non-versionable nodes being created below
+javax.jcr.tck.simple.testroot=/testroot
+
+# 3 nodes (nodeName1, nodeName2, nodeName3 with nt=versionableNodeType / nt=nonVersionableNodeType will be cloned to 2nd workspace
+# nodename1 > used to persistently create versionable node below testroot
+# nodename2 > used to create second versionable node below testroot (used for restore/workspace.restore with uuid-conflict)
+# nodename3 > used to persistently create non-versionable node below testroot
+javax.jcr.tck.simple.nodename1=versionableNodeName1
+javax.jcr.tck.simple.nodename2=versionableNodeName2
+javax.jcr.tck.simple.nodename3=nonVersionableNodeName1
+
+# nodename 4: versionabel child-node of the first versionable node with nodeName1 and nodetype 'versionableNodeType'
+# used for:
+# + creation of a node in the 2nd workspace, that does not exist in the first workspace
+# + creation of a node in the 2nd workspace, in order to test uuid-conflicts with Workspace.restore.
+# + creation of a sub-node in the default workspace, in order to test uuid-conflicts with Node.restore.
+# + NOTE: the nodetype with 'versionableNodeType' must define its children nodes to either have COPY or VERSION
+#         OPV behaviour in order to successfully test Node.restore and Workspace.restore with uuid conflict.
+javax.jcr.tck.simple.nodename4=childNodeName
+

Modified: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.cnd
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.cnd?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.cnd (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.cnd Thu Apr 16 10:07:31 2009
@@ -53,19 +53,33 @@
 // V E R S I O N I N G
 //------------------------------------------------------------------------------
 
-[mix:versionable] > mix:referenceable
+/**
+ * @since 2.0
+ */
+[mix:simpleVersionable]
+  mixin
+  - jcr:isCheckedOut (boolean) = 'true' mandatory autocreated protected ignore
+
+[mix:versionable] > mix:simpleVersionable, mix:referenceable
   mixin
   - jcr:versionHistory (reference) mandatory protected
     < 'nt:versionHistory'
   - jcr:baseVersion (reference) mandatory protected ignore
     < 'nt:version'
-  - jcr:isCheckedOut (boolean) = 'true' mandatory autocreated protected ignore
   - jcr:predecessors (reference) mandatory protected multiple
     < 'nt:version'
   - jcr:mergeFailed (reference) protected multiple abort
+    /** @since 2.0 */
+  - jcr:activity (reference) protected
+    < 'nt:activity'
+    /** @since 2.0 */
+  - jcr:configuration (reference) protected
+    < 'nt:configuration'
 
 [nt:versionHistory] > nt:base, mix:referenceable
   - jcr:versionableUuid (string) mandatory autocreated protected abort
+    /** @since 2.0 */
+    // - jcr:copiedFrom (weakreference) protected abort < 'nt:version'
   + jcr:rootVersion (nt:version) = nt:version mandatory autocreated protected abort
   + jcr:versionLabels (nt:versionLabels) = nt:versionLabels mandatory autocreated protected abort
   + * (nt:version) = nt:version protected abort
@@ -80,6 +94,9 @@
     < 'nt:version'
   - jcr:successors (reference) protected multiple abort
     < 'nt:version'
+    /** @since 2.0 */
+  - jcr:activity (reference) protected abort
+    < 'nt:activity'
   + jcr:frozenNode (nt:frozenNode) protected abort
 
 [nt:frozenNode] > nt:base, mix:referenceable
@@ -95,6 +112,18 @@
   - jcr:childVersionHistory (reference) mandatory autocreated protected abort
     < 'nt:versionHistory'
 
+/**
+ * @since 2.0
+ */
+[nt:activity] > nt:base, mix:referenceable
+  - jcr:activityTitle (string) mandatory autocreated protected
+
+/**
+ * @since 2.0
+ */
+[nt:configuration] > nt:base, mix:versionable
+  - jcr:root (reference) mandatory autocreated protected
+
 //------------------------------------------------------------------------------
 // N O D E T Y P E S
 //------------------------------------------------------------------------------

Copied: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/AbstractVersionTest.java (from r763147, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/AbstractVersionTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/AbstractVersionTest.java?p2=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/AbstractVersionTest.java&p1=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/AbstractVersionTest.java&r1=763147&r2=765556&rev=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/AbstractVersionTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/AbstractVersionTest.java Thu Apr 16 10:07:31 2009
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.test.api.version;
+package org.apache.jackrabbit.api.jsr283.version.simple;
 
 import org.apache.jackrabbit.test.AbstractJCRTest;
 
@@ -27,7 +27,7 @@
 
 /**
  * <code>AbstractVersionTest</code> is the abstract base class for all
- * versioning related test classes.
+ * simple versioning related test classes.
  */
 public class AbstractVersionTest extends AbstractJCRTest {
 
@@ -46,12 +46,12 @@
 
         // assert that this repository support versioning
         try {
-            NodeType versionableNt = ntMgr.getNodeType(mixVersionable);
+            NodeType versionableNt = ntMgr.getNodeType(mixSimpleVersionable);
             if (versionableNt == null) {
-               fail("Repository does not support Versioning: mixin nodetype 'mix:versionable' is missing.");
+               fail("Repository does not support Versioning: mixin nodetype 'mix:simpleVersionable' is missing.");
             }
         } catch (NoSuchNodeTypeException e) {
-            fail("Repository does not support Versioning: mixin nodetype 'mix:versionable' is missing.");
+            fail("Repository does not support Versioning: mixin nodetype 'mix:simpleVersionable' is missing.");
         }
 
         // retrieve versionable nodetype
@@ -62,7 +62,7 @@
                fail("Property 'versionableNodeType' does not define a valid nodetype: '"+versionableNodeTypeName+"'");
             }
         } catch (NoSuchNodeTypeException e) {
-            fail("Property 'versionableNodeType' does not define an existing nodetype: '"+versionableNodeTypeName+"'");
+            fail("Property 'simpleVersionableNodeType' does not define an existing nodetype: '"+versionableNodeTypeName+"'");
         }
 
         // make sure 'non-versionable' nodetype is properly defined
@@ -134,8 +134,8 @@
      */
     protected Node createVersionableNode(Node parent, String name, NodeType nodetype) throws RepositoryException {
         Node versionableNode = parent.addNode(name, nodetype.getName());
-        if (!nodetype.isNodeType(mixVersionable)) {
-            versionableNode.addMixin(mixVersionable);
+        if (!nodetype.isNodeType(mixSimpleVersionable)) {
+            versionableNode.addMixin(mixSimpleVersionable);
         }
         parent.save();
 

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/AbstractVersionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/BasicTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/BasicTest.java?rev=765556&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/BasicTest.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/BasicTest.java Thu Apr 16 10:07:31 2009
@@ -0,0 +1,58 @@
+/*
+ * 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.api.jsr283.version.simple;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * <code>BasicTest</code> checks if simple versioning is correctly set up
+ *
+ * @test
+ * @sources SVBasicTest.java
+ * @executeClass org.apache.jackrabbit.test.api.version.SVBasicTest
+ * @keywords simple-versioning
+ */
+public class BasicTest extends AbstractVersionTest {
+
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    /**
+     * Test node is simple versionable
+     *
+     * @throws RepositoryException
+     */
+    public void testNodeTypes() throws RepositoryException {
+        assertTrue("Node.isNodeType(mix:simpleVersionable) must return true.",
+                versionableNode.isNodeType(mixSimpleVersionable));
+        assertFalse("Node.isNodeType(mix:versionable) must return false.",
+                versionableNode.isNodeType(mixVersionable));
+    }
+
+    /**
+     * Test if node has a jcr:isCheckedOut property
+     *
+     * @throws RepositoryException
+     */
+    public void testICOProperty() throws RepositoryException {
+        assertTrue("Versionable node must have a jcr:isCheckedOut property.",
+                versionableNode.hasProperty(jcrIsCheckedOut));
+    }
+
+
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/BasicTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/BasicTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev Url

Copied: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckinTest.java (from r763147, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckinTest.java?p2=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckinTest.java&p1=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java&r1=763147&r2=765556&rev=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckinTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckinTest.java Thu Apr 16 10:07:31 2009
@@ -14,22 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.test.api.version;
+package org.apache.jackrabbit.api.jsr283.version.simple;
 
 import javax.jcr.version.Version;
 import javax.jcr.RepositoryException;
-import javax.jcr.Value;
 import javax.jcr.InvalidItemStateException;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import java.util.Arrays;
 
 /**
- * <code>CheckinTest</code> covers tests related to {@link javax.jcr.Node#checkin()}.
+ * <code>CheckinTest</code> covers tests related to {@link javax.jcr.Node#checkin()}
+ * on simple versionable nodes.
  *
  * @test
- * @sources CheckinTest.java
- * @executeClass org.apache.jackrabbit.test.api.version.CheckinTest
- * @keywords versioning
+ * @sources SVCheckinTest.java
+ * @executeClass org.apache.jackrabbit.test.api.version.SVCheckinTest
+ * @keywords simple-versioning
  */
 public class CheckinTest extends AbstractVersionTest {
 
@@ -40,46 +39,6 @@
     }
 
     /**
-     * Test if Node.isCheckedOut() return false after calling Node.checkin()
-     *
-     * @throws javax.jcr.RepositoryException
-     */
-    public void testIsCheckedOut() throws RepositoryException {
-        versionableNode.checkin();
-        assertTrue("After calling Node.checkin() on a versionable node N, N.isCheckedOut() must return false", versionableNode.isCheckedOut() == false);
-    }
-
-    /**
-     * Test if the node's jcr:predecessors property contains an empty value array
-     * after checkin.
-     *
-     * @throws RepositoryException
-     */
-    public void testCheckinRemovesPredecessorProperty() throws RepositoryException {
-
-        versionableNode.checkin();
-        Value[] predecessorsValue = versionableNode.getProperty(jcrPredecessors).getValues();
-
-        assertTrue("Checkin must set the node's jcr:predecessors property to the empty array", predecessorsValue.length == 0);
-    }
-
-    /**
-     * Test if the nodes jcr:predecessors property is copied to the new version
-     * on Node.checkin().
-     *
-     * @throws RepositoryException
-     */
-    public void testPredecessorIsCopiedToNewVersion() throws RepositoryException {
-
-        Value[] nPredecessorsValue = versionableNode.getProperty(jcrPredecessors).getValues();
-
-        Version v = versionableNode.checkin();
-        Value[] vPredecessorsValue = v.getProperty(jcrPredecessors).getValues();
-
-        assertEquals("The versionable checked-out node's jcr:predecessors property is copied to the new version on checkin.", Arrays.asList(nPredecessorsValue), Arrays.asList(vPredecessorsValue));
-    }
-
-    /**
      * Test if Node.checkin() on a checked-in node has no effect.
      *
      * @throws RepositoryException
@@ -97,19 +56,6 @@
     }
 
     /**
-     * Test if versionable node N's jcr:baseVersion property is set to refer to
-     * the new version after checkin.
-     *
-     * @throws RepositoryException
-     */
-    public void testBaseVersionAfterCheckin() throws RepositoryException {
-        Version v = versionableNode.checkin();
-        Value baseVersionRef = versionableNode.getProperty(jcrBaseVersion).getValue();
-
-        assertEquals("Checked-in node's jcr:baseVersion property is set to refer to the version created on checkin.", superuser.getValueFactory().createValue(v), baseVersionRef);
-    }
-
-    /**
      * Test if Node.checkin() throws InvalidItemStateException if the node
      * has unsaved changes pending.
      *

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckinTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckoutTest.java (from r763147, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckoutTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckoutTest.java?p2=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckoutTest.java&p1=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckoutTest.java&r1=763147&r2=765556&rev=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/CheckoutTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckoutTest.java Thu Apr 16 10:07:31 2009
@@ -14,22 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.test.api.version;
+package org.apache.jackrabbit.api.jsr283.version.simple;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Node;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.UnsupportedRepositoryOperationException;
-import javax.jcr.Value;
 
 /**
- * <code>CheckoutTest</code> covers tests related to {@link
- * javax.jcr.Node#checkout()} and {@link javax.jcr.Node#isCheckedOut()}.
+ * <code>SVCheckoutTest</code> covers tests related to {@link
+ * Node#checkout()} and {@link Node#isCheckedOut()} of simple versionable
+ * nodes.
  *
  * @test
- * @sources CheckoutTest.java
- * @executeClass org.apache.jackrabbit.test.api.version.CheckoutTest
- * @keywords versioning
+ * @sources SVCheckoutTest.java
+ * @executeClass org.apache.jackrabbit.test.api.version.SVCheckoutTest
+ * @keywords simple-versioning
  */
 public class CheckoutTest extends AbstractVersionTest {
 
@@ -98,27 +98,4 @@
         versionableNode.checkout();
     }
 
-    /**
-     * Test if Node.checkout() copies the node's jcr:baseVersion to node's
-     * jcr:predecessors property (no save required).
-     */
-    public void testCheckoutCopiesBaseValueToPredecessorProperty() throws RepositoryException {
-        Value baseVersionValue = versionableNode.getProperty(jcrBaseVersion).getValue();
-        versionableNode.checkout();
-        Value[] predecessorsValues = versionableNode.getProperty(jcrPredecessors).getValues();
-
-        // loop over all values of jcr:predecessors property as it's not sure
-        // on which position jcr:baseVersion is copied.
-        boolean foundBaseVersionProp = false;
-        int i = 0;
-        while (i < predecessorsValues.length && !foundBaseVersionProp) {
-            if (predecessorsValues[i].equals(baseVersionValue)) {
-                foundBaseVersionProp = true;
-            }
-            i++;
-        }
-        if (!foundBaseVersionProp) {
-            fail("After calling Node.checkout() the current value of node's jcr:baseVersion must be copied to node's jcr:predecessors property");
-        }
-    }
 }
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CheckoutTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CopyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CopyTest.java?rev=765556&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CopyTest.java (added)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CopyTest.java Thu Apr 16 10:07:31 2009
@@ -0,0 +1,85 @@
+/*
+ * 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.api.jsr283.version.simple;
+
+import javax.jcr.RepositoryException;
+
+import org.apache.jackrabbit.api.jsr283.Workspace;
+import org.apache.jackrabbit.api.jsr283.Node;
+import org.apache.jackrabbit.api.jsr283.version.VersionManager;
+import org.apache.jackrabbit.api.jsr283.version.VersionHistory;
+
+/**
+ * <code>CopyTest</code> checks if simple versionable nodes are copied correctly:
+ *
+ * 15.1.4 Copying Versionable Nodes and Version Lineage
+ * Under both simple and full versioning, when an existing versionable node N is
+ * copied to a new location either in the same workspace or another, and the
+ * repository preserves the versionable mixin (see ยง10.7.4 Dropping Mixins on
+ * Copy):
+ * ? A copy of N, call it M, is created, as usual.
+ * ? A new, empty, version history for M, call it HM, is also created.
+ *
+ * @test
+ * @sources CopyTest.java
+ * @executeClass org.apache.jackrabbit.api.jsr283.version.simple.CopyTest
+ * @keywords simple-versioning
+ */
+public class CopyTest extends AbstractVersionTest {
+
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    public void testCopy() throws RepositoryException {
+        Workspace wsp = (Workspace) superuser.getWorkspace();
+        VersionManager vMgr = wsp.getVersionManager();
+        String srcPath = versionableNode.getPath();
+        String dstPath = getProperty("destination");
+        wsp.copy(srcPath, dstPath);
+
+        // check versionable
+        Node v = (Node) ((org.apache.jackrabbit.api.jsr283.Session) superuser).getNode(dstPath);
+        assertTrue("Copied Node.isNodeType(mix:simpleVersionable) must return true.",
+                v.isNodeType(mixSimpleVersionable));
+        assertFalse("Copied Node.isNodeType(mix:versionable) must return false.",
+                v.isNodeType(mixVersionable));
+
+        // check different version history
+        VersionHistory vh1 = vMgr.getVersionHistory(srcPath);
+        VersionHistory vh2 = vMgr.getVersionHistory(dstPath);
+        assertFalse("Copied node needs a new version history.", vh1.isSame(vh2));
+
+        // check if 1 version
+        assertEquals("Copied node must have 1 version.", 1, getNumberOfVersions(vh2));
+    }
+
+    protected void tearDown() throws Exception {
+        // remove copied node
+        try {
+            String dstPath = getProperty("destination");
+            ((org.apache.jackrabbit.api.jsr283.Session) superuser).getNode(dstPath).remove();
+            testRootNode.save();
+        } catch (Exception e) {
+            log.println("Exception in tearDown: " + e.toString());
+        } finally {
+            super.tearDown();
+        }
+    }
+
+
+}
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CopyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/CopyTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev Url

Copied: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/FrozenNodeTest.java (from r763147, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/FrozenNodeTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/FrozenNodeTest.java?p2=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/FrozenNodeTest.java&p1=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/FrozenNodeTest.java&r1=763147&r2=765556&rev=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/FrozenNodeTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/FrozenNodeTest.java Thu Apr 16 10:07:31 2009
@@ -14,19 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.test.api.version;
+package org.apache.jackrabbit.api.jsr283.version.simple;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
-import javax.jcr.version.Version;
+import org.apache.jackrabbit.api.jsr283.version.Version;
 
 /**
- * <code>CheckinTest</code> covers tests related to {@link javax.jcr.Node#checkin()}.
+ * <code>SVFrozenNodeTest</code> covers tests related to frozen nodes in
+ * simple versioning
  *
  * @test
- * @sources CheckinTest.java
- * @executeClass org.apache.jackrabbit.test.api.version.CheckinTest
- * @keywords versioning
+ * @sources SVFrozenNodeTest.java
+ * @executeClass org.apache.jackrabbit.test.api.version.SVFrozenNodeTest
+ * @keywords simple-versioning
  */
 public class FrozenNodeTest extends AbstractVersionTest {
 
@@ -40,8 +41,8 @@
      * @throws RepositoryException
      */
     public void testFrozenNodeUUUID() throws RepositoryException {
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode);
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode();
         String puuid = n.getProperty(jcrUUID).getValue().getString();
         String nuuid = n.getUUID();
         assertEquals("jcr:uuid needs to be equal to the getUUID() return value.", nuuid, puuid);
@@ -53,8 +54,8 @@
     public void testFrozenChildNodeUUUID() throws RepositoryException {
         versionableNode.addNode("child");
         versionableNode.save();
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode).getNode("child");
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode().getNode("child");
         String puuid = n.getProperty(jcrUUID).getValue().getString();
         String nuuid = n.getUUID();
         assertEquals("jcr:uuid needs to be equal to the getUUID() return value.", nuuid, puuid);
@@ -64,8 +65,11 @@
      * @throws RepositoryException
      */
     public void testFrozenUUUID() throws RepositoryException {
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode);
+        // make versionable node referenceable
+        versionableNode.addMixin(mixReferenceable);
+        versionableNode.save();
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode();
         String fuuid = n.getProperty(jcrFrozenUuid).getValue().getString();
         String ruuid = versionableNode.getUUID();
         assertEquals("jcr:frozenUuid needs to be equal to the getUUID() return value.", ruuid, fuuid);
@@ -76,9 +80,10 @@
      */
     public void testFrozenChildUUUID() throws RepositoryException {
         Node n1 = versionableNode.addNode("child");
+        n1.addMixin(mixReferenceable);
         versionableNode.save();
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode).getNode("child");
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode().getNode("child");
         String fuuid = n.getProperty(jcrFrozenUuid).getValue().getString();
         String ruuid = n1.getUUID();
         assertEquals("jcr:frozenUuid needs to be equal to the getUUID() return value.", ruuid, fuuid);
@@ -89,8 +94,8 @@
      * @throws RepositoryException
      */
     public void testFrozenNodeNodeType() throws RepositoryException {
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode);
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode();
         String puuid = n.getProperty(jcrPrimaryType).getValue().getString();
         String nuuid = n.getPrimaryNodeType().getName();
         assertEquals("jcr:primaryType needs to be equal to the getPrimaryNodeType() return value.", nuuid, puuid);
@@ -102,8 +107,8 @@
     public void testFrozenChildNodeNodeType() throws RepositoryException {
         versionableNode.addNode("child");
         versionableNode.save();
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode).getNode("child");
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode().getNode("child");
         String puuid = n.getProperty(jcrPrimaryType).getValue().getString();
         String nuuid = n.getPrimaryNodeType().getName();
         assertEquals("jcr:primaryType needs to be equal to the getPrimaryNodeType() return value.", nuuid, puuid);
@@ -113,8 +118,8 @@
      * @throws RepositoryException
      */
     public void testFrozenNodeType() throws RepositoryException {
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode);
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode();
         String fuuid = n.getProperty("jcr:frozenPrimaryType").getValue().getString();
         String ruuid = versionableNode.getPrimaryNodeType().getName();
         assertEquals("jcr:frozenPrimaryType needs to be equal to the getPrimaryNodeType() return value.", ruuid, fuuid);
@@ -126,8 +131,8 @@
     public void testFrozenChildNodeType() throws RepositoryException {
         Node n1 = versionableNode.addNode("child");
         versionableNode.save();
-        Version v = versionableNode.checkin();
-        Node n = v.getNode(jcrFrozenNode).getNode("child");
+        Version v = (Version) versionableNode.checkin();
+        Node n = v.getFrozenNode().getNode("child");
         String fuuid = n.getProperty("jcr:frozenPrimaryType").getValue().getString();
         String ruuid = n1.getPrimaryNodeType().getName();
         assertEquals("jcr:frozenPrimaryType needs to be equal to the getPrimaryNodeType() return value.", ruuid, fuuid);

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/FrozenNodeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/FrozenNodeTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url rev

Copied: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/RestoreTest.java (from r763147, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/RestoreTest.java?p2=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/RestoreTest.java&p1=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java&r1=763147&r2=765556&rev=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/RestoreTest.java Thu Apr 16 10:07:31 2009
@@ -14,9 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.test.api.version;
+package org.apache.jackrabbit.api.jsr283.version.simple;
 
 import org.apache.jackrabbit.test.NotExecutableException;
+import org.apache.jackrabbit.api.jsr283.version.VersionHistory;
 
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.version.Version;
@@ -32,17 +33,17 @@
 
 /**
  * <code>RestoreTest</code> covers tests related to the restore methods available
- * on {@link javax.jcr.Node}:
+ * on {@link Node} in simple versioning:
  * <ul>
- * <li>{@link javax.jcr.Node#restore(String, boolean)}</li>
- * <li>{@link javax.jcr.Node#restore(javax.jcr.version.Version, boolean)}</li>
- * <li>{@link javax.jcr.Node#restore(javax.jcr.version.Version, String, boolean)}</li>
+ * <li>{@link Node#restore(String, boolean)}</li>
+ * <li>{@link Node#restore(Version, boolean)}</li>
+ * <li>{@link Node#restore(Version, String, boolean)}</li>
  * </ul>
  *
  * @test
  * @sources RestoreTest.java
- * @executeClass org.apache.jackrabbit.test.api.version.RestoreTest
- * @keywords versioning
+ * @executeClass org.apache.jackrabbit.test.api.jsr283.version.simple.RestoreTest
+ * @keywords simple-versioning
  */
 public class RestoreTest extends AbstractVersionTest {
 
@@ -52,11 +53,19 @@
 
     Node versionableNode2;
 
+    String propertyValue1;
+    String propertyValue2;
+
     protected void setUp() throws Exception {
         super.setUp();
-
+        propertyValue1 = getProperty("propertyValue1");
+        propertyValue2 = getProperty("propertyValue1");
+        versionableNode.setProperty(propertyName1, propertyValue1);
+        versionableNode.save();
         version = versionableNode.checkin();
         versionableNode.checkout();
+        versionableNode.setProperty(propertyName1, propertyValue2);
+        versionableNode.save();
         version2 = versionableNode.checkin();
         versionableNode.checkout();
         rootVersion = versionableNode.getVersionHistory().getRootVersion();
@@ -127,14 +136,14 @@
     }
 
     /**
-     * Test if restoring a node sets the jcr:baseVersion property correctly.
+     * Test if restoring a node restores the correct property
      *
-     * @throws javax.jcr.RepositoryException
+     * @throws RepositoryException
      */
-    public void testRestoreSetsBaseVersion() throws RepositoryException {
+    public void testRestoreCorrectVersion() throws RepositoryException {
         versionableNode.restore(version, true);
-        Version baseV = versionableNode.getBaseVersion();
-        assertTrue("Restoring a node must set node's base version in order to point to the restored version.", version.isSame(baseV));
+        String value = versionableNode.getProperty(propertyName1).getString();
+        assertEquals("Restoring a node must set the correct property.", propertyValue1, value);
     }
 
     /**
@@ -200,7 +209,7 @@
     /**
      * Test calling Node.restore(String, boolean) on a non-versionable node.
      *
-     * @throws javax.jcr.RepositoryException
+     * @throws RepositoryException
      * @see Node#restore(String, boolean)
      */
     public void testRestoreNonVersionableNode() throws RepositoryException {
@@ -215,8 +224,8 @@
     /**
      * Test calling Node.restore(Version, String, boolean) on a non-versionable node.
      *
-     * @throws javax.jcr.RepositoryException
-     * @see Node#restore(javax.jcr.version.Version, String, boolean)
+     * @throws RepositoryException
+     * @see Node#restore(Version, String, boolean)
      */
     public void testRestoreNonVersionableNode2() throws RepositoryException {
         // the 'version' will be restored at location 'foo'.
@@ -232,7 +241,7 @@
     /**
      * Test calling Node.restore(Version, boolean) on a non-versionable node.
      *
-     * @throws javax.jcr.RepositoryException
+     * @throws RepositoryException
      * @see Node#restore(Version, boolean)
      */
     public void testRestoreNonVersionableNode3() throws RepositoryException {
@@ -309,21 +318,13 @@
      * @throws RepositoryException
      */
     public void testRestoreLabel() throws RepositoryException {
-        // V1 of versionable node
-        Version v1 = versionableNode.checkin();
-        String v1Name = v1.getName();
-
         // mark V1 with label test1
-        versionableNode.getVersionHistory().addVersionLabel(v1Name, "test", true);
-
-        // create a new version
-        versionableNode.checkout();
-        Version v2 = versionableNode.checkin();
+        versionableNode.getVersionHistory().addVersionLabel(version.getName(), "test", true);
 
         // restore V1 via label.
         versionableNode.restoreByLabel("test", true);
-        assertEquals("Node.restore('test') not correctly restored",
-                v1Name, versionableNode.getBaseVersion().getName());
+        String value = versionableNode.getProperty(propertyName1).getString();
+        assertEquals("Node.restore('test') not correctly restored", propertyValue1, value);
     }
 
     /**
@@ -455,4 +456,29 @@
         assertEquals("Invalid child node ordering", orderOk, order);
     }
 
+    /**
+     * Tests if restore on simple versioning creates a new version that is
+     * in the correct linear order.
+     */
+    public void testLinearVersions() throws Exception {
+        // first get all linear versions
+        VersionIterator iter = ((VersionHistory) versionableNode.getVersionHistory()).getAllLinearVersions();
+        StringBuffer expected = new StringBuffer();
+        while (iter.hasNext()) {
+            expected.append(iter.nextVersion().getName()).append(",");
+        }
+        // restore version
+        versionableNode.restore(version, true);
+        // append new base version
+        expected.append(versionableNode.getBaseVersion().getName()).append(",");
+
+        // get the version names again
+        iter = ((VersionHistory) versionableNode.getVersionHistory()).getAllLinearVersions();
+        StringBuffer actual = new StringBuffer();
+        while (iter.hasNext()) {
+            actual.append(iter.nextVersion().getName()).append(",");
+        }
+        assertEquals("Node.restore() on simple versioning must create a new version.",
+                expected.toString(), actual.toString());
+    }
 }
\ No newline at end of file

Copied: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/TestAll.java (from r763147, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/TestAll.java?p2=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/TestAll.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java&r1=763147&r2=765556&rev=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/TestAll.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/api/jsr283/version/simple/TestAll.java Thu Apr 16 10:07:31 2009
@@ -14,24 +14,27 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.api.jsr283;
+package org.apache.jackrabbit.api.jsr283.version.simple;
 
-import junit.framework.TestCase;
-import junit.framework.Test;
-import junit.framework.TestSuite;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
 /** <code>TestAll</code>... */
 public class TestAll extends TestCase {
 
     private static Logger log = LoggerFactory.getLogger(TestAll.class);
 
     public static Test suite() {
-        TestSuite suite = new TestSuite("org.apache.jackrabbit.api.jsr283 tests");
+        TestSuite suite = new TestSuite("org.apache.jackrabbit.api.jsr283.version.simple tests");
 
-        suite.addTestSuite(WorkspaceTest.class);
-        suite.addTestSuite(SessionRemoveItemTest.class);
+        suite.addTestSuite(BasicTest.class);
+        suite.addTestSuite(CheckinTest.class);
+        suite.addTestSuite(CheckoutTest.class);
+        suite.addTestSuite(FrozenNodeTest.class);
 
         return suite;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/VersionIteratorImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/VersionIteratorImplTest.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/VersionIteratorImplTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/VersionIteratorImplTest.java Thu Apr 16 10:07:31 2009
@@ -57,6 +57,8 @@
         public boolean isMoreRecent(InternalVersion v) {return false;}
         public boolean isRootVersion() {return false;}
         public InternalVersionItem getParent() {return null;}
+        public InternalVersion getLinearSuccessor(InternalVersion baseVersion) { return null; }
+        public InternalVersion getLinearPredecessor() { return null; }
     }
 
     public void testVersionIterator() throws Exception {

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/AbstractJCRTest.java Thu Apr 16 10:07:31 2009
@@ -115,6 +115,11 @@
     protected String jcrRootVersion;
 
     /**
+     * JCR Name jcr:isCheckedOut using the namespace resolver of the current session.
+     */
+    protected String jcrIsCheckedOut;
+
+    /**
      * JCR Name jcr:baseVersion using the namespace resolver of the current session.
      */
     protected String jcrBaseVersion;
@@ -180,6 +185,11 @@
     protected String mixVersionable;
 
     /**
+     * JCR Name mix:simpleVersionable using the namespace resolver of the current session.
+     */
+    protected String mixSimpleVersionable;
+
+    /**
      * JCR Name mix:lockable using the namespace resolver of the current session.
      */
     protected String mixLockable;
@@ -319,6 +329,7 @@
         jcrFrozenUuid = superuser.getNamespacePrefix(NS_JCR_URI) + ":frozenUuid";
         jcrRootVersion = superuser.getNamespacePrefix(NS_JCR_URI) + ":rootVersion";
         jcrBaseVersion = superuser.getNamespacePrefix(NS_JCR_URI) + ":baseVersion";
+        jcrIsCheckedOut = superuser.getNamespacePrefix(NS_JCR_URI) + ":isCheckedOut";
         jcrUUID = superuser.getNamespacePrefix(NS_JCR_URI) + ":uuid";
         jcrLockOwner = superuser.getNamespacePrefix(NS_JCR_URI) + ":lockOwner";
         jcrlockIsDeep = superuser.getNamespacePrefix(NS_JCR_URI) + ":lockIsDeep";
@@ -331,6 +342,7 @@
         ntFrozenNode = superuser.getNamespacePrefix(NS_NT_URI) + ":frozenNode";
         mixReferenceable = superuser.getNamespacePrefix(NS_MIX_URI) + ":referenceable";
         mixVersionable = superuser.getNamespacePrefix(NS_MIX_URI) + ":versionable";
+        mixSimpleVersionable = superuser.getNamespacePrefix(NS_MIX_URI) + ":simpleVersionable";
         mixLockable = superuser.getNamespacePrefix(NS_MIX_URI) + ":lockable";
         mixShareable = superuser.getNamespacePrefix(NS_MIX_URI) + ":shareable";
         ntQuery = superuser.getNamespacePrefix(NS_NT_URI) + ":query";

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/PredefinedNodeTypeTest.java Thu Apr 16 10:07:31 2009
@@ -107,11 +107,21 @@
         testPredefinedNodeType("mix:referenceable");
     }
 
+    /** Test for the predefined mix:referenceable node type. */
+    public void testShareable() throws NotExecutableException {
+        testPredefinedNodeType("mix:shareable");
+    }
+
     /** Test for the predefined mix:versionable node type. */
     public void testVersionable() throws NotExecutableException {
         testPredefinedNodeType("mix:versionable");
     }
 
+    /** Test for the predefined mix:simpleVersionable node type. */
+    public void testSimpleVersionable() throws NotExecutableException {
+        testPredefinedNodeType("mix:simpleVersionable");
+    }
+
     /** Test for the predefined nt:base node type. */
     public void testBase() throws NotExecutableException {
         testPredefinedNodeType("nt:base");
@@ -172,6 +182,16 @@
         testPredefinedNodeType("nt:version");
     }
 
+    /** Test for the predefined nt:activity node type. */
+    public void testActivity() throws NotExecutableException {
+        testPredefinedNodeType("nt:activity");
+    }
+
+    /** Test for the predefined nt:configuration node type. */
+    public void testConfiguration() throws NotExecutableException {
+        testPredefinedNodeType("nt:configuration");
+    }
+
     /** Test for the predefined nt:frozenNode node type. */
     public void testFrozenNode() throws NotExecutableException {
         testPredefinedNodeType("nt:frozenNode");
@@ -222,11 +242,11 @@
             }
 
             NodeType type = manager.getNodeType(name);
-            String current = getNodeTypeSpec(type);
+            String current = getNodeTypeSpec(type).trim();
             if (!System.getProperty("line.separator").equals("\n")) {
                 current = normalizeLineSeparators(current);
             }
-            String expected = normalizeLineSeparators(spec.toString());
+            String expected = normalizeLineSeparators(spec.toString()).trim();
 
             assertEquals("Predefined node type " + name, expected, current);
         } catch (IOException e) {
@@ -268,8 +288,10 @@
         for (int i = 0; i < supertypes.length; i++) {
             String name = supertypes[i].getName();
             if (name.startsWith("nt:") ||
+                    name.equals("mix:simpleVersionable") ||
                     (name.equals("mix:referenceable") &&
                         (typeName.equals("mix:versionable") ||
+                            typeName.equals("mix:shareable") ||
                             typeName.equals("nt:resource") ||
                             typeName.equals("nt:versionHistory") ||
                             typeName.equals("nt:version") ||

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-shareable.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-shareable.txt?rev=765556&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-shareable.txt (added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-shareable.txt Thu Apr 16 10:07:31 2009
@@ -0,0 +1,10 @@
+NodeTypeName
+  mix:shareable
+Supertypes
+  mix:referenceable
+IsMixin
+  true
+HasOrderableChildNodes
+  false
+PrimaryItemName
+  null
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-shareable.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-simpleVersionable.txt (from r763147, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-versionable.txt)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-simpleVersionable.txt?p2=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-simpleVersionable.txt&p1=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-versionable.txt&r1=763147&r2=765556&rev=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-versionable.txt (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-simpleVersionable.txt Thu Apr 16 10:07:31 2009
@@ -1,7 +1,7 @@
 NodeTypeName
-  mix:versionable
+  mix:simpleVersionable
 Supertypes
-  mix:referenceable
+  []
 IsMixin
   true
 HasOrderableChildNodes
@@ -9,15 +9,6 @@
 PrimaryItemName
   null
 PropertyDefinition
-  Name jcr:baseVersion
-  RequiredType REFERENCE
-  DefaultValues null
-  AutoCreated false
-  Mandatory true
-  OnParentVersion IGNORE
-  Protected true
-  Multiple false
-PropertyDefinition
   Name jcr:isCheckedOut
   RequiredType BOOLEAN
   DefaultValues [true]
@@ -26,30 +17,3 @@
   OnParentVersion IGNORE
   Protected true
   Multiple false
-PropertyDefinition
-  Name jcr:mergeFailed
-  RequiredType REFERENCE
-  DefaultValues null
-  AutoCreated false
-  Mandatory false
-  OnParentVersion ABORT
-  Protected true
-  Multiple true
-PropertyDefinition
-  Name jcr:predecessors
-  RequiredType REFERENCE
-  DefaultValues null
-  AutoCreated false
-  Mandatory true
-  OnParentVersion COPY
-  Protected true
-  Multiple true
-PropertyDefinition
-  Name jcr:versionHistory
-  RequiredType REFERENCE
-  DefaultValues null
-  AutoCreated false
-  Mandatory true
-  OnParentVersion COPY
-  Protected true
-  Multiple false

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-versionable.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-versionable.txt?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-versionable.txt (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/mix-versionable.txt Thu Apr 16 10:07:31 2009
@@ -2,6 +2,7 @@
   mix:versionable
 Supertypes
   mix:referenceable
+  mix:simpleVersionable
 IsMixin
   true
 HasOrderableChildNodes
@@ -9,6 +10,15 @@
 PrimaryItemName
   null
 PropertyDefinition
+  Name jcr:activity
+  RequiredType REFERENCE
+  DefaultValues null
+  AutoCreated false
+  Mandatory false
+  OnParentVersion COPY
+  Protected true
+  Multiple false
+PropertyDefinition
   Name jcr:baseVersion
   RequiredType REFERENCE
   DefaultValues null
@@ -18,12 +28,12 @@
   Protected true
   Multiple false
 PropertyDefinition
-  Name jcr:isCheckedOut
-  RequiredType BOOLEAN
-  DefaultValues [true]
-  AutoCreated true
-  Mandatory true
-  OnParentVersion IGNORE
+  Name jcr:configuration
+  RequiredType REFERENCE
+  DefaultValues null
+  AutoCreated false
+  Mandatory false
+  OnParentVersion COPY
   Protected true
   Multiple false
 PropertyDefinition

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-activity.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-activity.txt?rev=765556&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-activity.txt (added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-activity.txt Thu Apr 16 10:07:31 2009
@@ -0,0 +1,19 @@
+NodeTypeName
+  nt:activity
+Supertypes
+  nt:base
+IsMixin
+  false
+HasOrderableChildNodes
+  false
+PrimaryItemName
+  null
+PropertyDefinition
+  Name jcr:activityTitle
+  RequiredType STRING
+  DefaultValues null
+  AutoCreated true
+  Mandatory true
+  OnParentVersion COPY
+  Protected true
+  Multiple false

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-activity.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-configuration.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-configuration.txt?rev=765556&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-configuration.txt (added)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-configuration.txt Thu Apr 16 10:07:31 2009
@@ -0,0 +1,19 @@
+NodeTypeName
+  nt:configuration
+Supertypes
+  nt:base
+IsMixin
+  false
+HasOrderableChildNodes
+  false
+PrimaryItemName
+  null
+PropertyDefinition
+  Name jcr:root
+  RequiredType REFERENCE
+  DefaultValues null
+  AutoCreated true
+  Mandatory true
+  OnParentVersion COPY
+  Protected true
+  Multiple false
\ No newline at end of file

Propchange: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-configuration.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-version.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-version.txt?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-version.txt (original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/resources/org/apache/jackrabbit/test/api/nodetype/spec/nt-version.txt Thu Apr 16 10:07:31 2009
@@ -19,6 +19,15 @@
   Protected true
   SameNameSiblings false
 PropertyDefinition
+  Name jcr:activity
+  RequiredType REFERENCE
+  DefaultValues null
+  AutoCreated false
+  Mandatory false
+  OnParentVersion ABORT
+  Protected true
+  Multiple false
+PropertyDefinition
   Name jcr:created
   RequiredType DATE
   DefaultValues null

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java?rev=765556&r1=765555&r2=765556&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java (original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java Thu Apr 16 10:07:31 2009
@@ -384,6 +384,10 @@
      */
     public static final Name MIX_VERSIONABLE = FACTORY.create(Name.NS_MIX_URI, "versionable");
     /**
+     * mix:simpleVersionable
+     */
+    public static final Name MIX_SIMPLE_VERSIONABLE = FACTORY.create(Name.NS_MIX_URI, "simpleVersionable");
+    /**
      * mix:shareable
      */
     public static final Name MIX_SHAREABLE = FACTORY.create(Name.NS_MIX_URI, "shareable");