jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1145497 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
Date Tue, 12 Jul 2011 09:05:18 GMT
Author: alexparvulescu
Date: Tue Jul 12 09:05:17 2011
New Revision: 1145497

URL: http://svn.apache.org/viewvc?rev=1145497&view=rev
Log:
JCR-3014 Identifier paths for inexistent items throw exception

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java?rev=1145497&r1=1145496&r2=1145497&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionItemOperation.java
Tue Jul 12 09:05:17 2011
@@ -48,6 +48,14 @@ public abstract class SessionItemOperati
             protected Boolean perform(ItemManager manager, Path path) {
                 return manager.itemExists(path);
             }
+            @Override
+            public Boolean perform(SessionContext context) {
+                try {
+                    return super.perform(context);
+                } catch (RepositoryException e) {
+                    return false;
+                }
+            }
         };
     }
 
@@ -64,6 +72,14 @@ public abstract class SessionItemOperati
             protected Boolean perform(ItemManager manager, Path path) {
                 return manager.propertyExists(path);
             }
+            @Override
+            public Boolean perform(SessionContext context) {
+                try {
+                    return super.perform(context);
+                } catch (RepositoryException e) {
+                    return false;
+                }
+            }
         };
     }
 
@@ -80,6 +96,14 @@ public abstract class SessionItemOperati
             protected Boolean perform(ItemManager manager, Path path) {
                 return manager.nodeExists(path);
             }
+            @Override
+            public Boolean perform(SessionContext context) {
+                try {
+                    return super.perform(context);
+                } catch (RepositoryException e) {
+                    return false;
+                }
+            }
         };
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java?rev=1145497&r1=1145496&r2=1145497&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/integration/SessionImplTest.java
Tue Jul 12 09:05:17 2011
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.integration;
 
 import java.security.AccessControlException;
+import java.util.UUID;
 
 import javax.jcr.Credentials;
 import javax.jcr.PathNotFoundException;
@@ -162,4 +163,17 @@ public class SessionImplTest extends Abs
             // success
         }
     }
+
+    /**
+     * JCR-3014 Identifier paths for inexistent items throw exception
+     * 
+     * @see <a
+     *      href="https://issues.apache.org/jira/browse/JCR-3014">JCR-3014</a>
+     */
+    public void testCheckNonExistingItem() throws Exception {
+        String dummyPath = "[" + UUID.randomUUID() + "]";
+        assertFalse(superuser.itemExists(dummyPath));
+        assertFalse(superuser.nodeExists(dummyPath));
+        assertFalse(superuser.propertyExists(dummyPath));
+    }
 }



Mime
View raw message