jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1161451 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Date Thu, 25 Aug 2011 09:02:29 GMT
Author: mduerig
Date: Thu Aug 25 09:02:29 2011
New Revision: 1161451

URL: http://svn.apache.org/viewvc?rev=1161451&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
- test

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java?rev=1161451&r1=1161450&r2=1161451&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Thu Aug 25 09:02:29 2011
@@ -33,6 +33,7 @@ import org.junit.Test;
 
 import javax.imageio.spi.ServiceRegistry;
 import javax.jcr.Binary;
+import javax.jcr.ItemNotFoundException;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.NoSuchWorkspaceException;
 import javax.jcr.Node;
@@ -260,10 +261,15 @@ public class RepositoryTest {
     }
 
     @Test(expected = PathNotFoundException.class)
-    public void getNonExistingNode() throws RepositoryException {
+    public void getNonExistingNodeByPath() throws RepositoryException {
         getNode("/qoo");
     }
 
+    @Test(expected = ItemNotFoundException.class)
+    public void getNonExistingNodeById() throws RepositoryException {
+        getSession().getNodeByIdentifier("foobar");
+    }
+
     @Test
     public void getProperty() throws RepositoryException {
         Property property = getProperty("/foo/stringProp");
@@ -1118,6 +1124,17 @@ public class RepositoryTest {
 
         assertTrue(testNode.isNodeType("mix:referenceable"));
         assertTrue(testNode.hasProperty("jcr:uuid"));
+        String nodeId = testNode.getIdentifier();
+        assertEquals(testNode.getProperty("jcr:uuid").getString(), nodeId);
+
+        Session session2 = getRepository().login();
+        try {
+            Node node2 = session2.getNodeByIdentifier(nodeId);
+            assertEquals(testNode.getPath(), node2.getPath());
+        }
+        finally {
+            session2.logout();
+        }
     }
 
     @Test



Mime
View raw message