You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2005/07/04 17:51:27 UTC

svn commit: r209096 - in /incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version: VersionHistoryTest.java VersionTest.java

Author: stefan
Date: Mon Jul  4 08:51:26 2005
New Revision: 209096

URL: http://svn.apache.org/viewcvs?rev=209096&view=rev
Log:
JCR-150: Node.getLock() on a lock non-lockable node throws javax.jcr.UnsupportedRepositoryOperationException

fixed test cases accordingly

Modified:
    incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
    incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionTest.java

Modified: incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java?rev=209096&r1=209095&r2=209096&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java (original)
+++ incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java Mon Jul  4 08:51:26 2005
@@ -30,6 +30,7 @@
 import javax.jcr.Value;
 import javax.jcr.PropertyType;
 import javax.jcr.PathNotFoundException;
+import javax.jcr.lock.LockException;
 import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionIterator;
 
@@ -322,13 +323,13 @@
 
     /**
      * Tests if <code>VersionHistory.getLock()</code> throws an {@link
-     * javax.jcr.UnsupportedRepositoryOperationException}
+     * javax.jcr.lock.LockException}
      */
     public void testGetLock() throws Exception {
         try {
             vHistory.getLock();
-            fail("VersionHistory should not be lockable: VersionHistory.getLock() did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("VersionHistory should not be lockable: VersionHistory.getLock() did not throw a LockException");
+        } catch (LockException success) {
         }
     }
 
@@ -574,29 +575,29 @@
     }
 
     /**
-     * Tests if <code>VersionHistory.lock(boolean, boolean)</code> throws an
-     * {@link javax.jcr.UnsupportedRepositoryOperationException}
+     * Tests if <code>VersionHistory.lock(boolean, boolean)</code> throws a
+     * {@link javax.jcr.lock.LockException}
      */
     public void testLock() throws Exception {
         try {
             vHistory.lock(true, true);
-            fail("VersionHistory should not be lockable: VersionHistory.lock(true,true) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("VersionHistory should not be lockable: VersionHistory.lock(true,true) did not throw a LockException");
+        } catch (LockException success) {
         }
         try {
             vHistory.lock(true, false);
-            fail("VersionHistory should not be lockable: VersionHistory.lock(true,false) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("VersionHistory should not be lockable: VersionHistory.lock(true,false) did not throw a LockException");
+        } catch (LockException success) {
         }
         try {
             vHistory.lock(false, true);
-            fail("VersionHistory should not be lockable: VersionHistory.lock(false,true) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("VersionHistory should not be lockable: VersionHistory.lock(false,true) did not throw a LockException");
+        } catch (LockException success) {
         }
         try {
             vHistory.lock(false, false);
-            fail("VersionHistory should not be lockable: VersionHistory.lock(false,false) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("VersionHistory should not be lockable: VersionHistory.lock(false,false) did not throw a UnsupportedRepositoryOperationException");
+        } catch (LockException success) {
         }
     }
 
@@ -800,14 +801,14 @@
     }
 
     /**
-     * Tests if <code>VersionHistory.unlock()</code> throws an {@link
-     * javax.jcr.UnsupportedRepositoryOperationException}
+     * Tests if <code>VersionHistory.unlock()</code> throws a {@link
+     * javax.jcr.lock.LockException}
      */
     public void testUnlock() throws Exception {
         try {
             vHistory.unlock();
-            fail("VersionHistory should not be lockable: VersionHistory.unlock() did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("VersionHistory should not be lockable: VersionHistory.unlock() did not throw a LockException");
+        } catch (LockException success) {
         }
     }
 

Modified: incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionTest.java?rev=209096&r1=209095&r2=209096&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionTest.java (original)
+++ incubator/jackrabbit/trunk/core/src/test/org/apache/jackrabbit/test/api/version/VersionTest.java Mon Jul  4 08:51:26 2005
@@ -28,6 +28,7 @@
 import javax.jcr.PropertyIterator;
 import javax.jcr.Value;
 import javax.jcr.PropertyType;
+import javax.jcr.lock.LockException;
 
 import java.util.GregorianCalendar;
 import java.util.Calendar;
@@ -225,14 +226,14 @@
     }
 
     /**
-     * Tests if <code>Version.getLock()</code> throws an {@link
-     * javax.jcr.UnsupportedRepositoryOperationException}
+     * Tests if <code>Version.getLock()</code> throws a {@link
+     * javax.jcr.lock.LockException}
      */
     public void testGetLock() throws Exception {
         try {
             version.getLock();
-            fail("Version should not be lockable: Version.getLock() did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("Version should not be lockable: Version.getLock() did not throw a LockException");
+        } catch (LockException success) {
         }
     }
 
@@ -450,29 +451,29 @@
     }
 
     /**
-     * Tests if <code>Version.lock(boolean, boolean)</code> throws an {@link
-     * javax.jcr.UnsupportedRepositoryOperationException}
+     * Tests if <code>Version.lock(boolean, boolean)</code> throws a {@link
+     * javax.jcr.lcok.LockException}
      */
     public void testLock() throws Exception {
         try {
             version.lock(true, true);
-            fail("Version should not be lockable: Version.lock(true,true) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("Version should not be lockable: Version.lock(true,true) did not throw a LockException");
+        } catch (LockException success) {
         }
         try {
             version.lock(true, false);
-            fail("Version should not be lockable: Version.lock(true,false) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("Version should not be lockable: Version.lock(true,false) did not throw a LockException");
+        } catch (LockException success) {
         }
         try {
             version.lock(false, true);
-            fail("Version should not be lockable: Version.lock(false,true) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("Version should not be lockable: Version.lock(false,true) did not throw a LockException");
+        } catch (LockException success) {
         }
         try {
             version.lock(false, false);
-            fail("Version should not be lockable: Version.lock(false,false) did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("Version should not be lockable: Version.lock(false,false) did not throw a LockException");
+        } catch (LockException success) {
         }
     }
 
@@ -677,14 +678,14 @@
     }
 
     /**
-     * Tests if <code>Version.unlock()</code> throws an {@link
-     * javax.jcr.UnsupportedRepositoryOperationException}
+     * Tests if <code>Version.unlock()</code> throws a {@link
+     * javax.jcr.lock.LockException}
      */
     public void testUnlock() throws Exception {
         try {
             version.unlock();
-            fail("Version should not be lockable: Version.unlock() did not throw an UnsupportedRepositoryOperationException");
-        } catch (UnsupportedRepositoryOperationException success) {
+            fail("Version should not be lockable: Version.unlock() did not throw a LockException");
+        } catch (LockException success) {
         }
     }