jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1158606 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/RepositoryTest.java
Date Wed, 17 Aug 2011 10:01:01 GMT
Author: mduerig
Date: Wed Aug 17 10:01:01 2011
New Revision: 1158606

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

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=1158606&r1=1158605&r2=1158606&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 17 10:01:01 2011
@@ -39,6 +39,7 @@ import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.PathNotFoundException;
 import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
 import javax.jcr.PropertyType;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
@@ -198,6 +199,38 @@ public class RepositoryTest {
     }
 
     @Test
+    public void getNodes() throws RepositoryException {
+        Set<String> expectedChildNodes = new HashSet<String>() {{
+            add("foo");
+            add("bar");
+            add(testNode);
+        }};
+
+        Node root = getNode("/");
+        NodeIterator childNodes = root.getNodes();
+        while (childNodes.hasNext()) {
+            assertTrue(expectedChildNodes.remove(childNodes.nextNode().getName()));
+        }
+        assertTrue(expectedChildNodes.isEmpty());
+    }
+
+    @Test
+    public void getProperties() throws RepositoryException {
+        Set<String> expectedProperties = new HashSet<String>() {{
+            add("intProp");
+            add("mvProp");
+            add("stringProp");
+        }};
+
+        Node node = getNode("/foo");
+        PropertyIterator properties = node.getProperties();
+        while (properties.hasNext()) {
+            assertTrue(expectedProperties.remove(properties.nextProperty().getName()));
+        }
+        assertTrue(expectedProperties.isEmpty());
+    }
+
+    @Test
     public void getNodeByIdentifier() throws RepositoryException {
         Node node = getNode("/foo");
         String id = node.getIdentifier();



Mime
View raw message