[ 
https://issues.apache.org/jira/browse/OAK-5229?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15839737#comment-15839737
 ] 

Thomas Mueller commented on OAK-5229:
-------------------------------------

Another test that failed for me:

{noformat}
Index: 
src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java
===================================================================
--- 
src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java
      (revision 1779322)
+++ 
src/test/java/org/apache/jackrabbit/oak/jcr/security/authorization/NodeTypeManagementTest.java
      (working copy)
@@ -115,7 +115,7 @@
         String ntName = child.getPrimaryNodeType().getName();
 
         try {
-            childNode.setPrimaryType("nt:folder");
+            childNode.setPrimaryType("oak:Unstructured");
             testSession.save();
             fail("TestSession does not have sufficient privileges to change 
the primary type.");
         } catch (AccessDeniedException e) {
@@ -134,7 +134,7 @@
         Node child = (Node) superuser.getItem(childNode.getPath());
         String ntName = child.getPrimaryNodeType().getName();
 
-        String changedNtName = "nt:folder";
+        String changedNtName = "oak:Unstructured";
         child.setPrimaryType(changedNtName);
         testSession.save();
{noformat}

> Using Node.setPrimaryType() should fail if non-matching childnodes
> ------------------------------------------------------------------
>
>                 Key: OAK-5229
>                 URL: https://issues.apache.org/jira/browse/OAK-5229
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.14
>            Reporter: Tobias Bocanegra
>            Assignee: Alex Parvulescu
>            Priority: Critical
>             Fix For: 1.6
>
>         Attachments: OAK-5229.patch
>
>
> 1. Assume the following:
> {noformat}
> /testNode [nt:unstructured]
>   /unstructured_child [nt:unstructured]
> {noformat}
> 2. setting "/testNode".setPrimaryType("nt:folder")
> 3. save the session.
> Altering the primary type works, thus leaving the repository in an 
> inconsistent state.
> Interestingly, subsequent calls to 
> "/testNiode/unstructured_child".setProperty() will fail:
> {noformat}
> javax.jcr.nodetype.ConstraintViolationException: OakConstraint0001: 
> /test_node[[nt:folder]]: No matching definition found for child node 
> unstructured_child with effective type [nt:unstructured]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to