* match the <code>NodeDef</code>.
*/
public void testDefinedAndLegalType()
throws NotExecutableException, RepositoryException {
NodeDefinition nodeDef = NodeTypeUtil.locateChildNodeDef(session, false, false, false);
if (nodeDef == null) {
throw new NotExecutableException("No child node def with " +
"defaultPrimaryType found");
}
NodeType nodeType = nodeDef.getDeclaringNodeType();
String childNodeName = nodeDef.getName();
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));