jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r161862 - in incubator/jackrabbit/trunk/src: java/org/apache/jackrabbit/core/ java/org/apache/jackrabbit/core/version/ test/org/apache/jackrabbit/test/api/version/
Date Tue, 19 Apr 2005 09:25:46 GMT
Author: mreutegg
Date: Tue Apr 19 02:25:45 2005
New Revision: 161862

URL: http://svn.apache.org/viewcvs?view=rev&rev=161862
Log:
Minor fixes in jackrabbit that caused versioning test cases to fail.

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/RestoreTest.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/WorkspaceRestoreTest.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?view=diff&r1=161861&r2=161862
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Tue Apr 19
02:25:45 2005
@@ -3717,7 +3717,12 @@
         // check state of this instance
         sanityCheck();
 
-        checkLockable();
+        try {
+            checkLockable();
+        } catch (UnsupportedRepositoryOperationException  e) {
+            // a node that is not lockable never holds a lock
+            return false;
+        }
 
         LockManager lockMgr = ((WorkspaceImpl) session.getWorkspace()).getLockManager();
         return lockMgr.holdsLock(this);

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java?view=diff&r1=161861&r2=161862
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
Tue Apr 19 02:25:45 2005
@@ -140,10 +140,13 @@
      */
     public void removeVersionLabel(String label) throws RepositoryException {
         try {
-            session.getVersionManager().setVersionLabel(this,
+            Version existing = session.getVersionManager().setVersionLabel(this,
                     null,
                     QName.fromJCRName(label, session.getNamespaceResolver()),
                     true);
+            if (existing == null) {
+                throw new VersionException("No version with label '" + label + "' exists
in this version history.");
+            }
         } catch (IllegalNameException e) {
             throw new RepositoryException(e);
         } catch (UnknownPrefixException e) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java?view=diff&r1=161861&r2=161862
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
Tue Apr 19 02:25:45 2005
@@ -89,7 +89,7 @@
         this.vMgr = vMgr;
         this.parentId = parentId;
         NDEF_VERSION = ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_ROOTVERSION,
NT_VERSION).getId();
-        NDEF_VERSION_HISTORY = ntReg.getEffectiveNodeType(NT_UNSTRUCTURED).getApplicableChildNodeDef(JCR_ROOTVERSION,
NT_VERSIONHISTORY).getId();
+        NDEF_VERSION_HISTORY = ntReg.getEffectiveNodeType(REP_VERSIONSTORAGE).getApplicableChildNodeDef(JCR_ROOTVERSION,
NT_VERSIONHISTORY).getId();
         NDEF_VERSION_HISTORY_ROOT = ntReg.getEffectiveNodeType(REP_SYSTEM).getApplicableChildNodeDef(JCR_VERSIONSTORAGE,
REP_VERSIONSTORAGE).getId();
         NDEF_VERSION_LABELS = ntReg.getEffectiveNodeType(NT_VERSIONHISTORY).getApplicableChildNodeDef(JCR_VERSIONLABELS,
NT_VERSIONLABELS).getId();
     }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?view=diff&r1=161861&r2=161862
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
Tue Apr 19 02:25:45 2005
@@ -283,7 +283,7 @@
     public Version setVersionLabel(VersionHistory history, QName version,
                                    QName label, boolean move)
             throws RepositoryException {
-        Session session = history.getSession();
+        SessionImpl session = (SessionImpl) history.getSession();
 
         InternalVersionHistory vh = ((VersionHistoryImpl) history).getInternalVersionHistory();
         NodeImpl labelNode = ((VersionHistoryImpl) history).getNode(JCR_VERSIONLABELS);
@@ -320,7 +320,7 @@
             ));
         }
         virtProvider.invalidateItem(new NodeId(vh.getId()));
-        obsMgr.dispatch(events, (SessionImpl) history.getSession());
+        obsMgr.dispatch(events, session);
         return v == null ? null : (VersionImpl) session.getNodeByUUID(v.getId());
     }
 

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/RestoreTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/RestoreTest.java?view=diff&r1=161861&r2=161862
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/RestoreTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/RestoreTest.java
Tue Apr 19 02:25:45 2005
@@ -46,6 +46,7 @@
 public class RestoreTest extends AbstractVersionTest {
 
     Version version;
+    Version version2;
     Version rootVersion;
 
     Node versionableNode2;
@@ -54,6 +55,8 @@
         super.setUp();
 
         version = versionableNode.checkin();
+        versionableNode.checkout();
+        version2 = versionableNode.checkin();
         versionableNode.checkout();
         rootVersion = versionableNode.getVersionHistory().getRootVersion();
 

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/WorkspaceRestoreTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/WorkspaceRestoreTest.java?view=diff&r1=161861&r2=161862
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/WorkspaceRestoreTest.java
(original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/version/WorkspaceRestoreTest.java
Tue Apr 19 02:25:45 2005
@@ -226,7 +226,7 @@
         if (versionableNode.isCheckedOut()) {
             versionableNode.checkin();
         }
-        superuser.getWorkspace().restore(new Version[]{rootVersion}, true);
+        superuser.getWorkspace().restore(new Version[]{version}, true);
     }
 
     /**
@@ -236,7 +236,7 @@
         if (!versionableNode.isCheckedOut()) {
             versionableNode.checkout();
         }
-        superuser.getWorkspace().restore(new Version[]{rootVersion}, true);
+        superuser.getWorkspace().restore(new Version[]{version}, true);
     }
 
 }



Mime
View raw message