/** {@inheritDoc} */ public boolean canRemoveItem(String name) throws RemoteException { return type.canRemoveItem(name); }
/** * Tests if canSetProperty(String propertyName, Value value) where value is * null returns the same as canRemoveItem */ public void testValueNull() throws NotExecutableException, RepositoryException { PropertyDefinition propDef = NodeTypeUtil.locatePropertyDef(session, NodeTypeUtil.ANY_PROPERTY_TYPE, false, false, false, false); if (propDef == null) { throw new NotExecutableException("No not protected property def found."); } NodeType nodeType = propDef.getDeclaringNodeType(); assertEquals("nodeType.canSetProperty(String propertyName, Value value) " + "where value is null must return the same result as " + "nodeType.canRemoveItem(String propertyName).", nodeType.canRemoveItem(propDef.getName()), nodeType.canSetProperty(propDef.getName(), (Value) null)); }
/** * Tests if canSetProperty(String propertyName, Value[] values) where values * is null returns the same as canRemoveItem */ public void testMultipleValuesNull() throws NotExecutableException, RepositoryException { PropertyDefinition propDef = NodeTypeUtil.locatePropertyDef(session, NodeTypeUtil.ANY_PROPERTY_TYPE, true, false, false, false); if (propDef == null) { throw new NotExecutableException("No not protected, multiple property def found"); } NodeType nodeType = propDef.getDeclaringNodeType(); assertEquals("nodeType.canSetProperty(String propertyName, Value[] values) " + "where values is null must return the same result as " + "nodeType.canRemoveItem(String propertyName)", nodeType.canRemoveItem(propDef.getName()), nodeType.canSetProperty(propDef.getName(), (Value[]) null)); }
/** * Tests if {@link NodeType#canRemoveItem(String)} and * {@link NodeType#canRemoveNode(String)} return true * if the specified node is not a protected nor a mandatory * child node. */ public void testRemovableChildNode() throws NotExecutableException, RepositoryException { NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false); if (nodeDef == null) { throw new NotExecutableException("No mandatory property def found."); } NodeType type = nodeDef.getDeclaringNodeType(); assertTrue("NodeType.canRemoveItem(String itemName) must return true " + "if itemName is not a protected nor a mandatory child node def.", type.canRemoveItem(nodeDef.getName())); assertTrue("NodeType.canRemoveNode(String nodeName) must return true " + "if nodeName is not a protected nor a mandatory child node def.", type.canRemoveNode(nodeDef.getName())); }
/** * Tests if {@link NodeType#canRemoveItem(String)} and * {@link NodeType#canRemoveNode(String)} return * false if the specified node is a protected child node. */ public void testProtectedChildNode() throws NotExecutableException, RepositoryException { NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, false); if (nodeDef == null) { throw new NotExecutableException("No mandatory property def found."); } NodeType type = nodeDef.getDeclaringNodeType(); assertFalse("NodeType.canRemoveItem(String itemName) must return false " + "if itemName is a protected child node def.", type.canRemoveItem(nodeDef.getName())); assertFalse("NodeType.canRemoveNode(String nodeName) must return false " + "if nodeName is a protected child node def.", type.canRemoveNode(nodeDef.getName())); }
/** * Tests if {@link NodeType#canRemoveItem(String)} and * {@link NodeType#canRemoveProperty(String)} return false * if the specified property is a protected property. */ public void testProtectedProperty() throws NotExecutableException, RepositoryException { PropertyDefinition propDef = NodeTypeUtil.locatePropertyDef(session, true, false); if (propDef == null) { throw new NotExecutableException("No protected property def found."); } NodeType type = propDef.getDeclaringNodeType(); assertFalse("NodeType.canRemoveItem(String itemName) must return false " + "if itemName is a protected property def.", type.canRemoveItem(propDef.getName())); assertFalse("NodeType.canRemoveProperty(String propertyName) must return false " + "if propertyName is a protected property def.", type.canRemoveProperty(propDef.getName())); }
/** * Tests if {@link NodeType#canRemoveItem(String)} and * {@link NodeType#canRemoveProperty(String)} return false * if the specified property is a mandatory property. */ public void testMandatoryProperty() throws NotExecutableException, RepositoryException { PropertyDefinition propDef = NodeTypeUtil.locatePropertyDef(session, false, true); if (propDef == null) { throw new NotExecutableException("No mandatory property def found."); } NodeType type = propDef.getDeclaringNodeType(); assertFalse("NodeType.canRemoveItem(String itemName) must return false " + "if itemName is a mandatory property def.", type.canRemoveItem(propDef.getName())); assertFalse("NodeType.canRemoveProperty(String propertyName) must return false " + "if propertyName is a mandatory property def.", type.canRemoveProperty(propDef.getName())); }
/** * Tests that {@link NodeType#canRemoveItem(String)} and * {@link NodeType#canRemoveProperty(String)} return true * if the specified property is not a protected nor a mandatory * property. */ public void testRemovableProperty() throws NotExecutableException, RepositoryException { PropertyDefinition propDef = NodeTypeUtil.locatePropertyDef(session, false, false); if (propDef == null) { throw new NotExecutableException("No mandatory property def found."); } NodeType type = propDef.getDeclaringNodeType(); assertTrue("NodeType.canRemoveItem(String itemName) must return true " + "if itemName is not a protected nor a mandatory property def.", type.canRemoveItem(propDef.getName())); assertTrue("NodeType.canRemoveProperty(String propertyName) must return true " + "if propertyName is not a protected nor a mandatory property def.", type.canRemoveProperty(propDef.getName())); }
/** * Tests if {@link NodeType#canRemoveItem(String)} and * {@link NodeType#canRemoveNode(String)} return * false if the specified node is a mandatory child node. */ public void testMandatoryChildNode() throws NotExecutableException, RepositoryException { NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, true, false); if (nodeDef == null) { throw new NotExecutableException("No mandatory property def found."); } NodeType type = nodeDef.getDeclaringNodeType(); assertFalse("NodeType.canRemoveItem(String itemName) must return false " + "if itemName is a mandatory child node def.", type.canRemoveItem(nodeDef.getName())); assertFalse("NodeType.canRemoveNode(String nodeName) must return false " + "if nodeName is a mandatory child node def.", type.canRemoveNode(nodeDef.getName())); } }