jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1411755 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Date Tue, 20 Nov 2012 17:37:02 GMT
Author: mduerig
Date: Tue Nov 20 17:37:01 2012
New Revision: 1411755

URL: http://svn.apache.org/viewvc?rev=1411755&view=rev
Log:
OAK-369: missing support for relative path consisting of parent-element
fix test expectations

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1411755&r1=1411754&r2=1411755&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Tue Nov 20 17:37:01 2012
@@ -39,6 +39,7 @@ import javax.jcr.Binary;
 import javax.jcr.GuestCredentials;
 import javax.jcr.InvalidItemStateException;
 import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
 import javax.jcr.NamespaceException;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.NoSuchWorkspaceException;
@@ -170,8 +171,33 @@ public class RepositoryTest extends Abst
         assertEquals("/", root.getPath());
     }
 
+    @Test(expected = PathNotFoundException.class)
+    public void getPropertyDot() throws RepositoryException {
+        Node node = getNode("/foo");
+        node.getProperty(".");
+    }
+
+    @Test(expected = PathNotFoundException.class)
+    public void getPropertyDotDot() throws RepositoryException {
+        Node node = getNode("/foo");
+        node.getProperty("..");
+    }
+
+    @Ignore("OAK-369")
+    @Test
+    public void hasPropertyDot() throws RepositoryException {
+        Node node = getNode("/foo");
+        assertFalse((node.hasNode(".")));  // FIXME: OAK-369
+    }
+
+    @Test
+    public void hasPropertyDotDot() throws RepositoryException {
+        Node node = getNode("/foo");
+        assertFalse((node.hasNode("..")));
+    }
+
     @Test
-    public void getNode2() throws RepositoryException {
+    public void getNodeDot() throws RepositoryException {
         Node node = getNode("/foo");
         Node same = node.getNode(".");
         assertNotNull(same);
@@ -181,21 +207,43 @@ public class RepositoryTest extends Abst
 
     @Ignore("OAK-369") // FIXME: OAK-369
     @Test
-    public void getNode3() throws RepositoryException {
+    public void getNodeDotDot() throws RepositoryException {
         Node node = getNode("/foo");
         Node root = node.getNode("..");
         assertNotNull(root);
         assertEquals("", root.getName());
-        assertTrue("/".equals(root.getPath()));
+        assertTrue(root.isSame(node.getParent()));
     }
 
-    @Ignore("OAK-369") // FIXME: OAK-369
     @Test
-    public void testAddNode() throws RepositoryException {
+    public void hasNodeDot() throws RepositoryException {
+        Node root = getNode("/");
+        assertTrue(root.hasNode("."));
+        Node node = getNode("/foo");
+        assertTrue(node.hasNode("."));
+    }
+
+    @Ignore("OAK-369")
+    @Test
+    public void hasNodeDotDot() throws RepositoryException {
+        Node root = getNode("/");
+        assertFalse(root.hasNode(".."));
+        Node node = getNode("/foo");
+        assertTrue(node.hasNode(".."));  // FIXME OAK-369
+    }
+
+    @Ignore("OAK-369") // FIXME: OAK-369
+    @Test(expected = ItemExistsException.class)
+    public void testAddNodeDot() throws RepositoryException {
         Node node = getNode("/foo");
         // add a node with '..' should fail...
-        Node invalid = node.addNode("..");
-        assertTrue(node.getParent().isSame(node.getNode("..")));
+        node.addNode("..");
+    }
+
+    @Test(expected = ItemExistsException.class)
+    public void testAddNodeDotDot() throws RepositoryException {
+        Node node = getNode("/foo");
+        node.addNode(".");
     }
 
     @Test
@@ -1860,8 +1908,8 @@ public class RepositoryTest extends Abst
             };
 
             obsMgr.addEventListener(listener, Event.NODE_ADDED | Event.NODE_REMOVED | Event.NODE_MOVED
|
-                Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED | Event.PROPERTY_CHANGED |
Event.PERSIST,
-                "/", true, null, null, false);
+                    Event.PROPERTY_ADDED | Event.PROPERTY_REMOVED | Event.PROPERTY_CHANGED
| Event.PERSIST,
+                    "/", true, null, null, false);
 
             // Generate two events
             Node n = getNode(TEST_PATH);



Mime
View raw message