Package javax.jcr.nodetype

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


        String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);

        assertTrue("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
                "must return true for a not defined childNodeName if nodeTypeName " +
                "matches the type of a residual child node def",
                nodeType.canAddChildNode(undefinedName, type));
    }

    /**
     * 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


        }

        assertFalse("NodeType.canAddChildNode(String childNodeName, String nodeTypeName) " +
                "must return false for a not defined childNodeName if nodeTypeName " +
                "does not matches the type of a residual child node def",
                nodeType.canAddChildNode(undefinedName, illegalType));
    }
}
View Full Code Here

        String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);

        assertTrue("NodeType.canAddChildNode(String childNodeName) must return " +
                "true for a not defined childNodeName if NodeType has a residual child node " +
                "definition with a defaultPrimaryType",
                nodeType.canAddChildNode(undefinedName));
    }

    /**
     * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
     * true if <code>NodeType</code> contains a residual <code>NodeDef</code>
View Full Code Here

        String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);

        assertFalse("NodeType.canAddChildNode(String childNodeName) must return " +
                "false for a not defiend childNodeName if NodeType has a " +
                "residual child node definition without a defaultPrimaryType",
                nodeType.canAddChildNode(undefinedName));
    }
}
View Full Code Here

        NodeType nodeType = nodeDef.getDeclaringNodeType();

        assertTrue("NodeType.canAddChildNode(String childNodeName) must return " +
                "true if child node def 'childNodeName' defines a defaultPrimaryType.",
                nodeType.canAddChildNode(nodeDef.getName()));
    }

    /**
     * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
     * true if <code>NodeType</code> contains a <code>NodeDef</code>  named
View Full Code Here

        NodeType nodeType = nodeDef.getDeclaringNodeType();

        assertFalse("NodeType.canAddChildNode(String childNodeName) must return false " +
                "if child node def 'childNodeName' does not define a defaultPrimaryType.",
                nodeType.canAddChildNode(nodeDef.getName()));
    }

    /**
     * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
     * true if <code>NodeType</code> nor does contain a <code>NodeDef</code>  named
View Full Code Here

        NodeType nodeType = nodeDef.getDeclaringNodeType();
        String undefinedName = NodeTypeUtil.getUndefinedChildNodeName(nodeType);

        assertFalse("NodeType.canAddChildNode(String childNodeName) must return " +
                "false if 'childNodeName' is a undefined child node def",
                nodeType.canAddChildNode(undefinedName));
    }

    /**
     * Tests if <code>NodeType.canAddChildNode(String childNodeName)</code> returns
     * true if <code>NodeType</code> contains a residual <code>NodeDef</code>
View Full Code Here

   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(new ByteArrayInputStream("test".getBytes()), SpoolConfig
            .getDefaultSpoolConfig())}));
View Full Code Here

   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(new ByteArrayInputStream("test".getBytes()), SpoolConfig
            .getDefaultSpoolConfig())}));
      assertFalse(type.canSetProperty("jcr:notFound", new BinaryValue(new ByteArrayInputStream("test".getBytes()),
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

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.