jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1376036 - in /jackrabbit/oak/trunk/oak-jcr: pom.xml src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java src/test/resources/repositoryStubImpl.properties
Date Wed, 22 Aug 2012 13:25:21 GMT
Author: reschke
Date: Wed Aug 22 13:25:21 2012
New Revision: 1376036

URL: http://svn.apache.org/viewvc?rev=1376036&view=rev
Log:
OAK-6: add config for SetPropertyNodeTest

Modified:
    jackrabbit/oak/trunk/oak-jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/TestContentLoader.java
    jackrabbit/oak/trunk/oak-jcr/src/test/resources/repositoryStubImpl.properties

Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1376036&r1=1376035&r2=1376036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Wed Aug 22 13:25:21 2012
@@ -53,7 +53,6 @@ org.apache.jackrabbit.test.api.NodeOrder
 org.apache.jackrabbit.test.api.NodeOrderableChildNodesTest#testOrderBeforePlaceAtEndSessionSave<!--OAK-169-->
 org.apache.jackrabbit.test.api.SetValueValueFormatExceptionTest
 org.apache.jackrabbit.test.api.SetValueFormatExceptionTest
-org.apache.jackrabbit.test.api.SetPropertyNodeTest
 org.apache.jackrabbit.test.api.SetPropertyStringTest#testSetSingleStringArrayValueFormatException
 org.apache.jackrabbit.test.api.SetPropertyStringTest#testSetSingleStringArrayValueFormatExceptionWithPropertyType
 org.apache.jackrabbit.test.api.SetPropertyValueTest#testSetSingleValueArrayValueFormatException

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java?rev=1376036&r1=1376035&r2=1376036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java
Wed Aug 22 13:25:21 2012
@@ -59,6 +59,8 @@ public class OakRepositoryStub extends R
         try {
             TestContentLoader loader = new TestContentLoader();
             loader.loadTestContent(session);
+        } catch (Exception e) {
+            e.printStackTrace(System.err);
         } finally {
             session.logout();
         }

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=1376036&r1=1376035&r2=1376036&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
Wed Aug 22 13:25:21 2012
@@ -26,6 +26,11 @@ import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.ValueFactory;
+import javax.jcr.nodetype.NodeDefinitionTemplate;
+import javax.jcr.nodetype.NodeTypeManager;
+import javax.jcr.nodetype.NodeTypeTemplate;
+import javax.jcr.nodetype.PropertyDefinitionTemplate;
+import javax.jcr.version.OnParentVersionAction;
 
 import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.value.BinaryValue;
@@ -41,6 +46,32 @@ public class TestContentLoader {
         session.getWorkspace().getNamespaceRegistry().registerNamespace(
                 "test", "http://www.apache.org/jackrabbit/test");
 
+        NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();
+
+        // TEST NODE TYPES (in Jackrabbit-core: imported from XML file using JackrabbitNodeTypeManager)
+
+        // test:setProperty
+        {
+            NodeTypeTemplate nttmpl = ntm.createNodeTypeTemplate();
+            nttmpl.setName("test:setProperty");
+            nttmpl.setDeclaredSuperTypeNames(new String[] { "nt:base", "mix:referenceable"
});
+
+            NodeDefinitionTemplate ndtmpl = ntm.createNodeDefinitionTemplate();
+            ndtmpl.setName("*");
+            ndtmpl.setRequiredPrimaryTypeNames(new String[] { "test:setProperty" });
+            ndtmpl.setOnParentVersion(OnParentVersionAction.COPY);
+
+            nttmpl.getNodeDefinitionTemplates().add(ndtmpl);
+
+            PropertyDefinitionTemplate pdtmpl = ntm.createPropertyDefinitionTemplate();
+            pdtmpl.setName("*");
+            pdtmpl.setOnParentVersion(OnParentVersionAction.COPY);
+
+            nttmpl.getPropertyDefinitionTemplates().add(pdtmpl);
+
+            ntm.registerNodeType(nttmpl, true);
+        }
+
         Node data = getOrAddNode(session.getRootNode(), "testdata");
         addPropertyTestData(getOrAddNode(data, "property"));
         addQueryTestData(getOrAddNode(data, "query"));

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/resources/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/resources/repositoryStubImpl.properties?rev=1376036&r1=1376035&r2=1376036&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/resources/repositoryStubImpl.properties (original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/resources/repositoryStubImpl.properties Wed Aug
22 13:25:21 2012
@@ -233,7 +233,7 @@ javax.jcr.tck.NodeOrderableChildNodesTes
 
 # Test class: SetPropertyNodeTest
 # nodetype which is referenceable
-javax.jcr.tck.SetPropertyNodeTest.nodetype=nt:unstructured
+javax.jcr.tck.SetPropertyNodeTest.nodetype=test:setProperty
 
 # Test class: SetPropertyValueTest
 # property that allows multiple values



Mime
View raw message