Examples of NodeDefinition


Examples of javax.jcr.nodetype.NodeDefinition

     * does not match the <code>NodeDef</code>.
     */
    public void testDefinedAndIllegalType()
            throws NotExecutableException, RepositoryException {

        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);

        if (nodeDef == null) {
            throw new NotExecutableException("No testable node type found.");
        }

        NodeType nodeType = nodeDef.getDeclaringNodeType();
        String childNodeName = nodeDef.getName();

        String legalType = nodeDef.getRequiredPrimaryTypes()[0].getName();
        String illegalType = NodeTypeUtil.getIllegalChildNodeType(manager, legalType);
        if (illegalType == null) {
            throw new NotExecutableException("No illegal node type name found");
        }

View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

     * returns false if <code>nodeTypeName</code> represents a mixin.
     */
    public void testCanAddMixinType()
            throws NotExecutableException, RepositoryException {

        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);

        if (nodeDef == null) {
            throw new NotExecutableException("No testable node type found.");
        }

        NodeType nodeType = nodeDef.getDeclaringNodeType();
        String childNodeName = nodeDef.getName();
        String mixinName;
        NodeTypeIterator it = manager.getMixinNodeTypes();
        if (it.hasNext()) {
            mixinName = it.nextNodeType().getName();
        } else {
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

     * returns false if <code>nodeTypeName</code> represents an abstract node type.
     */
    public void testCanAddAbstractType()
    throws NotExecutableException, RepositoryException {

        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);

        if (nodeDef == null) {
            throw new NotExecutableException("No testable node type found.");
        }

        NodeType nodeType = nodeDef.getDeclaringNodeType();
        String childNodeName = nodeDef.getName();
        String abstractName = null;
        NodeTypeIterator it = manager.getPrimaryNodeTypes();
        while (it.hasNext() && abstractName == null) {
            NodeType nt = it.nextNodeType();
            if (nt.isAbstract()) {
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

     * returns false if <code>childNodeName</code> does not match the <code>NodeDef</code>.
     */
    public void testUndefined()
            throws NotExecutableException, RepositoryException {

        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, true, false);

        if (nodeDef == null) {
            throw new NotExecutableException("No testable node type found.");
        }

        String type = nodeDef.getRequiredPrimaryTypes()[0].getName();
        NodeType nodeType = nodeDef.getDeclaringNodeType();
        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.",
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

     * but <code>nodeTypeName</code> matches the node type of a residual <code>NodeDef</code>.
     */
    public void testResidualAndLegalType()
            throws NotExecutableException, RepositoryException {

        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, true);

        if (nodeDef == null) {
            throw new NotExecutableException("No testable residual child node def.");
        }

        String type = nodeDef.getRequiredPrimaryTypes()[0].getName();
        NodeType nodeType = nodeDef.getDeclaringNodeType();
        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",
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

     * <code>NodeDef</code>.
     */
    public void testResidualAndIllegalType()
            throws NotExecutableException, RepositoryException {

        NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, true);

        if (nodeDef == null) {
            throw new NotExecutableException("No testable residual child node def.");
        }

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

        String legalType = nodeDef.getRequiredPrimaryTypes()[0].getName();
        String illegalType = NodeTypeUtil.getIllegalChildNodeType(manager, legalType);
        if (illegalType == null) {
            throw new NotExecutableException("No illegal node type name found");
        }

View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

     * @param def
     * @return
     */
    public NodeDefinition getNodeDefinition(QNodeDefinition def) {
        synchronized (ndCache) {
            NodeDefinition ndi = (NodeDefinition) ndCache.get(def);
            if (ndi == null) {
                ndi = new NodeDefinitionImpl(def, this, resolver());
                ndCache.put(def, ndi);
            }
            return ndi;
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

                }
            }
            synchronized (ndCache) {
                Iterator iter = ndCache.values().iterator();
                while (iter.hasNext()) {
                    NodeDefinition nd = (NodeDefinition) iter.next();
                    if (name.equals(nd.getDeclaringNodeType().getName())) {
                        iter.remove();
                    }
                }
            }
        } catch (NamespaceException e) {
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

                }
            }
            synchronized (ndCache) {
                Iterator iter = ndCache.values().iterator();
                while (iter.hasNext()) {
                    NodeDefinition nd = (NodeDefinition) iter.next();
                    if (name.equals(nd.getDeclaringNodeType().getName())) {
                        iter.remove();
                    }
                }
            }
        } catch (NamespaceException e) {
View Full Code Here

Examples of javax.jcr.nodetype.NodeDefinition

     */
    public void testRestoreWithUUIDConflict() throws RepositoryException, NotExecutableException {
        try {
            Node naa = createVersionableNode(versionableNode, nodeName4, versionableNodeType);
            // Verify that nodes used for the test have proper opv behaviour
            NodeDefinition nd = naa.getDefinition();
            if (nd.getOnParentVersion() != OnParentVersionAction.COPY && nd.getOnParentVersion() != OnParentVersionAction.VERSION) {
                throw new NotExecutableException("Child nodes must have OPV COPY or VERSION in order to be able to test Node.restore with uuid conflict.");
            }

            Version v = versionableNode.checkin();
            versionableNode.checkout();
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.