Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeType.canAddChildNode()


   public void testCanModify() throws Exception
   {
      Node node = root.addNode("node1", "nt:resource");
      NodeType type = node.getPrimaryNodeType();
      assertFalse(type.canAddChildNode("jcr:anyNode"));
      assertFalse(type.canAddChildNode("jcr:anyNode", "nt:base"));
      // assertTrue(type.canSetProperty("jcr:data", new BinaryValue("test")));
      assertFalse(type.canSetProperty("jcr:data", new BinaryValue[]{new BinaryValue("test")}));
      assertFalse(type.canSetProperty("jcr:notFound", new BinaryValue("test")));
      // [PN] 06.03.06 Row below commented
      // assertFalse(type.canSetProperty("jcr:data", new StringValue("test")));
View Full Code Here


      node = root.addNode("node2", "nt:file");
      type = node.getPrimaryNodeType();
      // does not work - TODO
      // assertTrue(type.canAddChildNode("jcr:content"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:othernode"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:content", "mix:referenceable"));

      // root.getNode("node2").remove();
View Full Code Here

      node = root.addNode("node2", "nt:file");
      type = node.getPrimaryNodeType();
      // does not work - TODO
      // assertTrue(type.canAddChildNode("jcr:content"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:othernode"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:content", "mix:referenceable"));

      // root.getNode("node2").remove();
      node = root.addNode("node3", "nt:folder");
View Full Code Here

      type = node.getPrimaryNodeType();
      // does not work - TODO
      // assertTrue(type.canAddChildNode("jcr:content"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:othernode"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:content", "mix:referenceable"));

      // root.getNode("node2").remove();
      node = root.addNode("node3", "nt:folder");
      type = node.getPrimaryNodeType();
View Full Code Here

      // does not work - TODO
      // assertTrue(type.canAddChildNode("jcr:content"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:othernode"));
      assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      assertFalse(type.canAddChildNode("jcr:content", "mix:referenceable"));

      // root.getNode("node2").remove();
      node = root.addNode("node3", "nt:folder");
      type = node.getPrimaryNodeType();
      // Residual,
View Full Code Here

      node = root.addNode("node3", "nt:folder");
      type = node.getPrimaryNodeType();
      // Residual,
      // 6.7.22.8 nt:folder, ChildNodeDefinition, Name *
      // RequiredPrimaryType[nt:hierarchyNode]
      assertTrue(type.canAddChildNode("jcr:content", "nt:hierarchyNode"));
      assertFalse(type.canAddChildNode("jcr:othernode"));

      // does not work - TODO
      // assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      // assertTrue(type.canAddChildNode("jcr:content", "mix:referenceable"));
View Full Code Here

      type = node.getPrimaryNodeType();
      // Residual,
      // 6.7.22.8 nt:folder, ChildNodeDefinition, Name *
      // RequiredPrimaryType[nt:hierarchyNode]
      assertTrue(type.canAddChildNode("jcr:content", "nt:hierarchyNode"));
      assertFalse(type.canAddChildNode("jcr:othernode"));

      // does not work - TODO
      // assertTrue(type.canAddChildNode("jcr:content", "nt:unstructured"));
      // assertTrue(type.canAddChildNode("jcr:content", "mix:referenceable"));

View Full Code Here

        String nodeTypeName = nodeDef.getRequiredPrimaryTypes()[0].getName();

        assertTrue("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
                "must return true if childNodeName and nodeTypeName match the " +
                "child node def of NodeType.",
                nodeType.canAddChildNode(childNodeName, nodeTypeName));
    }

    /**
     * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
     * returns false if <code>childNodeName</code> does and <code>nodeTypeName</code>
View Full Code Here

        }

        assertFalse("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
                "must return false if childNodeName does and nodeTypeName does not " +
                "match the child node def of NodeType.",
                nodeType.canAddChildNode(childNodeName, illegalType));
    }

    /**
     * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
     * returns false if <code>childNodeName</code> does not match the <code>NodeDef</code>.
View Full Code Here

        String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);

        assertFalse("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
                "must return false if childNodeName does not match the " +
                "child node def of NodeType.",
                nodeType.canAddChildNode(undefinedName, type));
    }

    /**
     * Tests if <code>NodeType.canAddChildNode(String childNodeName, String nodeTypeName)</code>
     * returns true if <code>childNodeName</code> does not match the <code>NodeDef</code>
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.