You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by kw...@apache.org on 2021/11/11 14:29:32 UTC

[jackrabbit-oak] branch trunk updated: Revert "OAK-9621 add failing tests for mandatory child nodes"

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3d3cb65  Revert "OAK-9621 add failing tests for mandatory child nodes"
3d3cb65 is described below

commit 3d3cb6592e72fdc4dcb9d0da842688048b3b6bd0
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Nov 11 15:29:06 2021 +0100

    Revert "OAK-9621 add failing tests for mandatory child nodes"
    
    This reverts commit 4f4fdd4572bc87411321304b7fa0bb41ad7d67c4.
---
 .../jackrabbit/oak/jcr/nodetype/NodeTypeTest.java  | 40 ----------------------
 1 file changed, 40 deletions(-)

diff --git a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTest.java b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTest.java
index f191c99..b7c2e7f 100644
--- a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTest.java
+++ b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeTest.java
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.io.IOException;
 import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.List;
@@ -31,7 +30,6 @@ import java.util.UUID;
 
 import javax.jcr.Node;
 import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.ValueFactory;
 import javax.jcr.nodetype.ConstraintViolationException;
@@ -43,7 +41,6 @@ import javax.jcr.nodetype.PropertyDefinitionTemplate;
 
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.cnd.CndImporter;
-import org.apache.jackrabbit.commons.cnd.ParseException;
 import org.apache.jackrabbit.oak.commons.junit.LogCustomizer;
 import org.apache.jackrabbit.oak.fixture.NodeStoreFixture;
 import org.apache.jackrabbit.oak.jcr.AbstractRepositoryTest;
@@ -382,43 +379,6 @@ public class NodeTypeTest extends AbstractRepositoryTest {
     }
 
     @Test
-    public void mandatoryChildNode() throws RepositoryException, ParseException, IOException {
-        Session session = getAdminSession();
-        Node root = session.getRootNode();
-
-        String cnd = "<'test'='http://www.apache.org/jackrabbit/test'>\n" +
-                "[test:MyType] > nt:unstructured\n" +
-                " + * (nt:folder) mandatory";
-
-        CndImporter.registerNodeTypes(new StringReader(cnd), session);
-
-        // add with missing mandatory child node
-        Node n = root.addNode("test", "test:MyType");
-        
-        try {
-            session.save();
-            fail("Must fail with ConstraintViolationException due to missing mandatory child node");
-        } catch (ConstraintViolationException e) {
-            // expected
-            session.refresh(false);
-        }
-
-        // set up correct structure
-        n = root.addNode("test", "test:MyType");
-        Node mandatoryChildNode = n.addNode("child", "nt:folder");
-        session.save();
-
-        // remove mandatory child node
-        try {
-            mandatoryChildNode.remove();
-            fail("Must fail with ConstraintViolationException because this is a mandatory child node of the parent node's node type");
-        } catch (ConstraintViolationException e) {
-            // expected
-            session.refresh(false);
-        }
-    }
-
-    @Test
     public void addReferenceableToExistingType() throws Exception {
         Session session = getAdminSession();
         Node root = session.getRootNode();