jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1450188 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
Date Tue, 26 Feb 2013 14:32:58 GMT
Author: jukka
Date: Tue Feb 26 14:32:58 2013
New Revision: 1450188

URL: http://svn.apache.org/r1450188
Log:
OAK-657: Add oak:unstructured

Use nt:unstructured for the TCK test content

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java?rev=1450188&r1=1450187&r2=1450188&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
Tue Feb 26 14:32:58 2013
@@ -50,7 +50,7 @@ public class TestContentLoader {
 
         registerTestNodeTypes(session);
 
-        Node data = getOrAddNode(session.getRootNode(), "testdata");
+        Node data = getOrAddNode(session.getRootNode(), "testdata", "nt:unstructured");
         addPropertyTestData(getOrAddNode(data, "property"));
         addQueryTestData(getOrAddNode(data, "query"));
         addNodeTestData(getOrAddNode(data, "node"));
@@ -75,6 +75,15 @@ public class TestContentLoader {
         }
     }
 
+    private static Node getOrAddNode(Node node, String name, String type)
+            throws RepositoryException {
+        try {
+            return node.getNode(name);
+        } catch (PathNotFoundException e) {
+            return node.addNode(name, type);
+        }
+    }
+
     private static Node getOrAddNode(Node node, String name) throws RepositoryException {
         try {
             return node.getNode(name);



Mime
View raw message