jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1163665 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Date Wed, 31 Aug 2011 15:32:43 GMT
Author: mduerig
Date: Wed Aug 31 15:32:43 2011
New Revision: 1163665

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

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=1163665&r1=1163664&r2=1163665&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
Wed Aug 31 15:32:43 2011
@@ -733,6 +733,35 @@ public class RepositoryTest {
     }
 
     @Test
+    @Ignore("Fix Microkernel index") // fixme fix Microkernel index
+    public void references2() throws RepositoryException, IOException {
+        Node parentNode = getNode(testPath);
+        Node referee = getSession().getNode("/foo");
+        referee.addMixin("mix:referenceable");
+        getSession().save();
+
+        addProperty(parentNode, "reference1", getSession().getValueFactory().createValue(referee));
+        addProperty(parentNode, "reference2", getSession().getValueFactory().createValue(referee));
+        PropertyIterator references = referee.getReferences();
+
+        Set<String> expected = new HashSet<String>() {{
+            add("reference1");
+            add("reference2");
+        }};
+        
+        while (references.hasNext()) {
+            assertTrue(expected.remove(references.nextProperty().getName()));
+        }
+        assertTrue(expected.isEmpty());
+
+        parentNode.setProperty("reference1", (String) null);
+        getSession().save();
+        references = referee.getReferences();
+        assertTrue(references.hasNext());
+        assertEquals("reference2", references.nextProperty().getName());
+    }
+
+    @Test
     public void addMultiValuedReference() throws RepositoryException {
         Node parentNode = getNode(testPath);
         Node referee = getSession().getNode("/foo");



Mime
View raw message