//**************************************************************************
//
//
//                       National Institute Of Standards and Technology
//                                     DTS Version 1.0
//         
//                                     Node Interface
//**************************************************************************
 var i = 2;

function Node()
{
   var tests = new Array (core0001NO(), core0002NO(), core0003NO(),core0004NO(),
                core0005NO(), core0006NO(), core0007NO(), core0008NO(),
		core0009NO(), core0010NO(), core0011NO(), core0012NO(),
                core0013NO(), core0014NO(), core0015NO(), core0016NO(),
                core0017NO(), core0018NO(), core0019NO(), core0020NO(),
                core0021NO(), core0022NO(), core0023NO(), core0024NO(),
                core0025NO(), core0026NO(), core0027NO(), core0028NO(),
                core0029NO(), core0030NO(), core0031NO(), core0032NO(),
                core0033NO(), core0034NO(), core0035NO(), core0036NO(),
                core0038NO(), core0039NO(), core0040NO(),
                core0041NO(), core0042NO(), core0043NO(), core0044NO(),
                core0045NO(), core0046NO(), core0047NO(), core0048NO(),
                core0049NO(), core0050NO(), core0051NO(), core0052NO(),
                core0053NO(), core0054NO(), core0055NO(), core0056NO(),
                core0057NO(), core0058NO(), core0059NO(), core0060NO(),
                core0061NO(), core0062NO(), core0063NO(), core0064NO(),
                core0065NO(), core0066NO(), core0067NO(), core0068NO(),
                core0069NO(), core0070NO(), core0071NO(), core0072NO(),
                core0073NO(), core0074NO(), core0075NO(), core0076NO(),
                core0077NO(), core0078NO(), core0079NO(), core0080NO(),
                core0081NO(), core0082NO(), core0083NO(), core0084NO(),
                core0085NO(), core0087NO(), core0088NO(),
                core0089NO(), core0090NO(), core0091NO(), core0092NO(),
                core0093NO(), core0094NO(), core0095NO(), core0096NO(),
                core0097NO(), core0098NO(), core0099NO(), core0100NO(),
                core0101NO(), core0102NO(), core0103NO()); 

   return tests;

}

//------------------------ test case core-0001NO------------------------
//
// Testing feature - The "nodeType" attribute for an Element node is 
//                   1 (ELEMENT_NODE). 
//
// Testing approach - Retrieve the root node and check its "nodeType" 
//                    attribute.  It should be set to 1. 
//
// Semantic Requirements: 1, 14
//
// Last modification date - March 15, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0001NO()
 {
    var computedValue = 0;
    var expectedValue = ELEMENT_NODE;

   results = new testResults("Core0001NO");

   results.description = "The nodeType attribute for an Element Node "+
                         " should be set to the constant 1.";
//
// The nodeType attribute for the root node should be set to the value 1.
//
    computedValue = getRootNode().nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0001NO --------------------------
//
//------------------------- test case core-0002NO -----------------------------
//
// Testing feature - The "nodeType" attribute for an Attribute node is
//                   2 (ATTRIBUTE_NODE).
//
// Testing approach - Retrieve the first attribute from the last child of
//                    the first employee.  Its "nodeType" attribute is then 
//                    checked, it should be set to 2.
//
// Semantic Requirements: 2, 14 
//
// Last modification date - March 16, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0002NO()
 {
    var computedValue = 0;
    var testNode = "";
    var attrNode = "";
    var expectedValue = ATTRIBUTE_NODE;

   results = new testResults("Core0002NO");
   results.description = "The nodeType attribute for an Attribute Node "+
                         " should be set to the constant 2.";

// 
// Retrieve the targeted data and its type.
//
     testNode = new nodeObject(FIRST,SIXTH);
     attrNode = testNode.node.getAttributeNode("domestic");
     computedValue = attrNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0002NO --------------------------
//
//------------------------- test case core-0003NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a Text node is
//                   3 (TEXT_NODE).
//
// Testing approach - Retrieve the Text data from the last child of the 
//                    first employee and and examine its "nodeType" 
//                    attribute.  It should be set to 3.
//
// Semantic Requirements: 3, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0003NO()
 {
    var computedValue = 0;
    var testNode = "";
    var textNode = "";
    var expectedValue = TEXT_NODE;

   results = new testResults("Core0003NO");
   results.description = "The nodeType attribute for a Text Node "+
                         " should be set to the constant 3.";

//
// Retrieve the targeted data.
//
    testNode = new nodeObject(FIRST,SIXTH);
    textNode = testNode.node.firstChild;
//
// The nodeType attribute should be set to the value 3.
//
    computedValue = textNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0003NO --------------------------
//
//------------------------- test case core-0004NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a CDATASection node is
//                   4 (CDATA_SECTION_NODE).
//
// Testing approach - Retrieve the CDATASection node contained inside
//                    the second child of the second employee and
//                    examine its "nodeType" attribute.  It should be 
//                    set to 4.
//
// Semantic Requirements: 4, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0004NO()
 {
    var computedValue = 0;
    var testNode = "";
    var cDataNode = "";
    var expectedValue = CDATA_SECTION_NODE;

   results = new testResults("Core0004NO");

   results.description = "The nodeType attribute for a CDATASection Node "+
                         " should be set to the constant 4.";
//
// Retrieve the targeted data.
//
     testNode = new nodeObject(SECOND,SECOND);
     cDataNode = testNode.node.lastChild; 
//
// The nodeType attribute should be set to the value 3.
//
     computedValue = cDataNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0004NO --------------------------
//
//------------------------- test case core-0005NO -----------------------------
//
// Testing feature - The "nodeType" attribute for an EntityReference node 
//                   is 5 (ENTITY_REFERENCE_NODE).
//
// Testing approach - Retrieve the first Entity Reference node from the 
//                    last child of the second employee and examine its 
//                    "nodeType" attribute.  It should be set to 5.
//
// Semantic Requirements:  5, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0005NO()
 {
   var computedValue = 0;
   var testNode = "";
   var entRefNode = "";
    var expectedValue = ENTITY_REFERENCE_NODE;

   results = new testResults("Core0005NO");
   results.description = "The nodeType attribute for an EntityReference Node "+
                         " should be set to the constant 5.";

//
// Retrieve the targeted data.
//
     testNode = new nodeObject(SECOND,SIXTH);
     entRefNode = testNode.node.firstChild;
//
// The nodeType attribute should be set to the value 5.
//
    computedValue = entRefNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0005NO --------------------------
//
//------------------------- test case core-0006NO -----------------------------
//
// Testing feature - The "nodeType" attribute for an Entity node 
//                   6 (ENTITY_NODE).
//
// Testing approach - Retrieve the first Entity declaration in the
//                    "DOCTYPE" section of the XML file and examine
//                    its "nodeType" attribute.  It should be set to 6.
//
// Semantic Requirements: 6, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0006NO()
 {
    var computedValue = 0;
    var testNode = "";
    var expectedValue = ENTITY_NODE;

   results = new testResults("Core0006NO");
   results.description = "The nodeType attribute for an Entity Node "+
                         " should be set to the constant 6.";
//
// Get the targeted data and its type.
//
    testNode = getEntity("ent1");
//
// The nodeType attribute should be set to the value 6.
//
    computedValue = testNode.nodeType;

//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0006NO --------------------------
//
//------------------------- test case core-0007NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a ProcessingInstruction
//                   node is 7 (PROCESSING_INSTRUCTION_NODE).
//
// Testing approach - Retrieve the first declaration in the XML file
//                    and examine its "nodeType" attribute.  It should 
//                    be set to 7.
//
// Semantic Requirements: 7, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0007NO()
 {
    var computedValue = 0;
    var testNode = "";
    var expectedValue = PROCESSING_INSTRUCTION_NODE;

   results = new testResults("Core0007NO");
   results.description = "The nodeType attribute for an ProcessingInstruction Node "+
                         " should be set to the constant 7.";
//
//  Get the targeted data.
//
    testNode = getDOMDocument().childNodes(0);
//
// The nodeType attribute should be set to the value 7.
//
    computedValue = testNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0007NO --------------------------
//
//------------------------- test case core-0008NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a comment node is
//                   8 (COMMENT_NODE).
//
// Testing approach - Retrieve the only comment (third child) from the
//                    main DOM document and examine its "nodeType" attribute.  
//                    It should be set to 8.
//
// Semantic Requirements: 8, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0008NO()
 {
   var computedValue = 0;
   var testNode = "";
    var expectedValue = COMMENT_NODE;

   results = new testResults("Core0008NO");
   results.description = "The nodeType attribute for a Comment Node "+
                         " should be set to the constant 8.";
//
// Get the targeted data.
//
    testNode = getDOMDocument().childNodes(2);
//
// The nodeType attribute should be set to the value 8.
//
    computedValue = testNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0008NO --------------------------
//
//------------------------- test case core-0009NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a Document node is
//                   9 (DOCUMENT_NODE).
//
// Testing approach - Retrieve the DOM Document and examine its 
//                    "nodeType" attribute.  It should be set to 9.
//
// Semantic Requirements: 9, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0009NO()
 {
   var computedValue = 0;
   var testNode = "";
    var expectedValue = DOCUMENT_NODE;

   results = new testResults("Core0009NO");
   results.description = "The nodeType attribute for an Document Node "+
                         " should be set to the constant 9.";
//
// Get the targeted data.
//
    testNode = getDOMDocument();
//
// The nodeType attribute should be set to the value 9.
//
    computedValue = testNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0009NO --------------------------
//
//------------------------- test case core-0010NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a DocumentType node is
//                   10 (DOCUMENT_TYPE_NODE).
//
// Testing approach - Retrieve the DOCTYPE declaration (second child) from
//                    the XML file and examine its "nodeType" attribute. 
//                    It should be set to 10.
//
// Semantic Requirements: 10, 14 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0010NO()
 {
    var computedValue = 0;
    var testNode = "";
    var expectedValue = DOCUMENT_TYPE_NODE;

   results = new testResults("Core0010NO");
   results.description = "The nodeType attribute for an DocumentType Node "+
                         " should be set to the constant 10.";
//
// Get the targeted data.
//
     testNode = getDocType();
//
// The nodeType attribute should be set to the value 10.
//
    computedValue = testNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0010NO --------------------------
//
//------------------------- test case core-0011NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a DocumentFragment node
//                   is 11 (DOCUMENT_FRAGMENT_NODE).
//
// Testing approach - Retrieve the whole DOM document and invoke its
//                    "createDocumentFragment()" method and examine the
//                    "nodeType" attribute of the returned node.  It should 
//                    be set to 11.
//
// Semantic Requirements: 11, 14
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0011NO()
 {
   var computedValue = 0;
   var testNode = "";
    var expectedValue = DOCUMENT_FRAGMENT_NODE;

   results = new testResults("Core0011NO");
   results.description = "The nodeType attribute for a DocumentFragment Node "+
                         " should be set to the constant 11.";
//
// Get the targeted data.
//
    testNode = getDOMDocument().createDocumentFragment();
//
// The nodeType attribute should be set to the value 11.
//
    computedValue = testNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0011NO --------------------------
//
//------------------------- test case core-0012NO -----------------------------
//
// Testing feature - The "nodeType" attribute for a notation node is
//                   12 (NOTATION_NODE).
//
// Testing approach - Retrieve the Notation declaration inside the 
//                    DocumentType node and examine its "nodeType"
//                    attribute.  It should be set to 12.
//
// Semantic Requirements: 12, 14
//
// Last modification date - March 31, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0012NO()
 {
    var computedValue = 0;
    var testNode = "";
    var expectedValue = NOTATION_NODE;

   results = new testResults("Core0012NO");
   results.description = "The nodeType attribute for a Notation Node "+
                         " should be set to the constant 12.";
//
// Get the targeted data.
//
     testNode = getNotation("notation1");
//
// The nodeType attribute should be set to the value 12.
//
    computedValue = testNode.nodeType;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0012NO --------------------------
//
//------------------------   test case core-0013NO ----------------------------
//
// Testing feature - The "nodeName" attribute for an Element node is
//                   its tagName.
//
// Testing approach - Retrieve the first Element node (root node) of the 
//                    DOM object and check its "nodeName" attribute.  
//                    It should be equal to its tagName.
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0013NO()
 {
   var computedValue = 0;
   var expectedValue = "staff"; 

   results = new testResults("Core0013NO");
   results.description = "The nodeName attribute for an Element Node " +
                         "should be set to its tagName.";
//
// The nodeName attribute should be set to "staff". 
//
    computedValue = getRootNode().nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0013NO --------------------------
//
//------------------------- test case core-0014NO -----------------------------
//
// Testing feature - The "nodeName" attribute for an Attribute node is
//                   the name of the attribute.
//
// Testing approach - Retrieve the attribute named "domestic" from the last 
//                    child of the first employee.  Its "nodeName" attribute 
//                    is then checked.  It should be set to "domestic".
//
// Semantic Requirements: 13, 15  
//
// Last modification date - March 16, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0014NO()
 {
    var computedValue = 0;
    var expectedValue = "domestic";
    var testNode = "";
    var attrNode = "";

   results = new testResults("Core0014NO");
   results.description = "The nodeName attribute for an Attribute Node " +
                         "should be set to the name of the attribute.";
//
// Retrieve the targeted data.
//
     testNode = new nodeObject(FIRST,SIXTH);
     attrNode = testNode.node.getAttributeNode("domestic"); 
//
// The nodeName attribute should be set to the value "domestic".
//
    computedValue = attrNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0014NO --------------------------
//
//------------------------- test case core-0015NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a text node is
//                   "#text".
//
// Testing approach - Retrieve the Text data from the last child of the
//                    first employee and and examine its "nodeName"
//                    attribute.  It should be set to "#text".
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0015NO()
 {
   var computedValue = 0;
   var expectedValue = "#text";
   var testNode = "";
   var textNode = "";

   results = new testResults("Core0015NO");
   results.description = "The nodeName attribute for a Text Node " +
                         "should be set to \"#text\".";
//
// Retrieve the targeted data.
//
    testNode = new nodeObject(FIRST,SIXTH);
    textNode = testNode.node.firstChild;
//
// The nodeName attribute should be set to the value "#text".
//
    computedValue = textNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0015NO --------------------------
//
//------------------------- test case core-0016NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a CDATASection node is
//                   "#cdata-section".
//
// Testing approach - Retrieve the CDATASection node inside the second 
//                    child of the second employee and examine its "nodeName"
//                    attribute.  It should be set to "#cdata-section".
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0016NO()
 {
   var computedValue = 0;
   var expectedValue = "#cdata-section";
   var testNode = "";
   var cDataNode = "";

   results = new testResults("Core0016NO");
   results.description = "The nodeName attribute for a CDATASection Node " +
                         "should be set to \"#cdata-section\".";
//
// Retrieve the targeted data.
//
    testNode = new nodeObject(SECOND,SECOND);  
    cDataNode = testNode.node.lastChild;;
//
// The nodeName attribute should be set to "#cdata-section".
//
    computedValue = cDataNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0016NO --------------------------
//
//------------------------- test case core-0017NO -----------------------------
//
// Testing feature - The "nodeName" attribute for an EntityReference node
//                   is the name of the entity referenced.
//
// Testing approach - Retrieve the first Entity Reference node from the last 
//                    child of the second employee and examine its
//                    "nodeName" attribute.  It should be set to "ent2".
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0017NO()
 {
   var computedValue = "";
   var expectedValue = "ent2";
   var testNode = "";
   var entRefNode = "";

   results = new testResults("Core0017NO");
   results.description = "The nodeName attribute for an EntityReference Node " +
                         "node should be set to the name of the entity referenced.";
//
// Retrieve the targeted data.
//
    testNode = new nodeObject(SECOND,SIXTH);
    entRefNode = testNode.node.firstChild;
//
// The nodeName attribute should be set to "ent2".
//
    computedValue = entRefNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }
//------------------------ End test case core-0017NO --------------------------
//
//------------------------- test case core-0018NO -----------------------------
//
// Testing feature - The "nodeName" attribute for an Entity node is
//                   the entity name.
//
// Testing approach - Retrieve the first Entity declaration in the
//                    "DOCTYPE" section of the XML file and examine
//                    its "nodeName" attribute.  It should be set to
//                    "ent1" .
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0018NO()
 {
    var computedValue = "";
    var expectedValue = "ent1";
    var testNode = "";

   results = new testResults("Core0018NO");
   results.description = "The nodeName attribute for an Entity Node " +
                         "should be set to the entity name.";
//
// Get the targeted data.
//
    testNode = getEntity("ent1");
//
// The nodeName attribute should be set to "ent1".
//
    computedValue = testNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0018NO --------------------------
//
//------------------------- test case core-0019NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a ProcessingInstruction
//                   node is the target.
//
// Testing approach - Retrieve the first declaration in the XML file
//                    and examine its "nodeName" attribute.  It should
//                    be set to "xml".
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0019NO()
 {
    var computedValue = 0;
    var expectedValue = "xml";
    var testNode = "";

   results = new testResults("Core0019NO");
   results.description = "The nodeName attribute for a ProcessingInstruction "+
                         "Node should be set to the target.";
//
// Get the targeted data.
//
    testNode = getDOMDocument().childNodes(0);
//
// The nodeName attribute should be set to "xml".
//
    computedValue = testNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0019NO --------------------------
//
//------------------------- test case core-0020NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a comment node is
//                   "#comment".
//
// Testing approach - Retrieve the only comment in the XML file (third child)
//                    and examine its "nodeName" attribute.  It should
//                    be set to "#comment".
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0020NO()
 {
   var computedValue = 0;
   var expectedValue = "#comment";
   var testNode = "";

   results = new testResults("Core0020NO");
   results.description = "The nodeName attribute for a comment Node "+
                         "should be set to \"#comment\".";
//
// Get the targeted data.
//
    testNode = getDOMDocument().childNodes(2);      
//
// The nodeName attribute should be set to "#comment".
//
    computedValue = testNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0020NO --------------------------
//
//------------------------- test case core-0021NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a Document node is
//                   "#document".
//
// Testing approach - Retrieve the DOM Document and examine its
//                    "nodeName" attribute.  It should be set to "#document".
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0021NO()
 {
   var computedValue = "";
   var expectedValue = "#document";
   var testNodeNode = "";

   results = new testResults("Core0021NO");
   results.description = "The nodeName attribute for a Document Node "+
                         "should be set to \"#document\".";
//
// Get the targeted data.
//
    testNode = getDOMDocument();
//
// The nodeName attribute should be set to "#document". 
//
    computedValue = testNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0021NO --------------------------
//
//------------------------- test case core-0022NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a DocumentType node is
//                   the document type name.
//
// Testing approach - Retrieve the DOCTYPE declaration (second child) from
//                    the XML file and examine its "nodeName" attribute.
//                    It should be set to "staff". 
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0022NO()
 {
   var computedValue = "";
   var expectedValue = "staff";
   var testNode = "";

   results = new testResults("Core0022NO");
   results.description = "The nodeName attribute for a DocumentType Node " +
                         "should be set to the document type name.";
//
// Get the targeted data.
//
    testNode = getDocType();
//
// The nodeName attribute should be set to "staff".
//
    computedValue = testNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0022NO ------------------------
//
//------------------------- test case core-0023NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a DocumentFragment node
//                   is "#document-fragment".
//
// Testing approach - Retrieve the whole DOM document and invoke its
//                    "createDocumentFragment()" method and examine the
//                    "nodeName" attribute of the returned node.  It should
//                    be set to "#document-fragment". 
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0023NO()
 {
   var computedValue = "";
   var expectedValue = "#document-fragment";
   var testNode = "";

   results = new testResults("Core0023NO");
   results.description = "The nodeName attribute for a DocumentFragment Node "+
                         "should be set to \"#document-fragment\"."
//
// Get the targeted data.
//
    testNode = getDOMDocument().createDocumentFragment();
//
// The nodeName attribute should be set to "#document-fragment".
//
    computedValue = testNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0023NO --------------------------
//
//------------------------- test case core-0024NO -----------------------------
//
// Testing feature - The "nodeName" attribute for a notation node is
//                   the name of the notation.
//
// Testing approach - Retrieve the Notation declaration inside the
//                    DocumentType node and examine its "nodeName"
//                    attribute.  It should be set to "notation1".
//
// Semantic Requirements: 13, 15 
//
// Last modification date - March 30, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0024NO()
 {
   var computedValue = "";
   var expectedValue = "notation1";
   var testNode = "";

   results = new testResults("Core0024NO");
   results.description = "The nodeName attribute for a Notation Node " +
                         "should be set to the notation name.";
//
// Get the targeted data.
//
    testNode = getNotation("notation1");
//
// The nodeName attribute should be set to "notation1".
//
    computedValue = testNode.nodeName;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0024NO --------------------------
//
//------------------------   test case core-0025NO ----------------------------
//
// Testing feature - The "nodeValue" attribute for an Element node is
//                   null.
//
// Testing approach - Retrieve the root node of the DOM object and check
//                    its "nodeValue" attribute.  It should be equal
//                    to null.
//
// Semantic Requirements: 13, 16 
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0025NO()
 {
   var computedValue = "";
   var expectedValue = null;

   results = new testResults("Core0025NO");
   results.description = "The nodeValue attribute for an Element Node " +
                         "should be set to null.";
//
// The nodeValue attribute should be set to null.
//
    computedValue = getRootNode().nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0025NO --------------------------
//
//------------------------- test case core-0026NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for an Attribute node is
//                   the value of the attribute.
//
// Testing approach - Retrieve the attribute named "domestic" from the last 
//                    child of the first employee.  Its "nodeValue" attribute 
//                    is then checked, it should be set to "Yes".
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0026NO()
 {
   var computedValue = "";
   var expectedValue = "Yes";
   var testNode = "";
   var attrNode = "";

   results = new testResults("Core0026NO");
   results.description = "The nodeValue attribute for an Attribute Node " +
                         "should be set to the value of the attribute.";
//
// Get the targeted data.
//
    testNode = new nodeObject(FIRST,SIXTH);
    attrNode = testNode.node.getAttributeNode("domestic");
//
// The nodeType attribute should be set to "Yes".
//
    computedValue = attrNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0026NO --------------------------
//
//------------------------- test case core-0027NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a Text node is
//                   content of the Text node.
//
// Testing approach - Retrieve the Text data from the last child of the
//                    first employee and and examine its "nodeValue"
//                    attribute.  It should be set to 
//                    "1230 North Ave. Dallas, Texas 98551". 
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0027NO()
 {
   var computedValue = "";
   var expectedValue = "1230 North Ave. Dallas, Texas 98551";
   var testNode = "";
   var textNode = "";

   results = new testResults("Core0027NO");
   results.description = "The nodeValue attribute for a Text node " +
                         "should be set to contents of the of the Text node.";
//
// Get the targeted data.
//
    testNode = new nodeObject(FIRST,SIXTH);
    textNode = testNode.node.firstChild;
//
// Retrieve the nodeValue attribute.
//
    computedValue = textNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0027NO --------------------------
//
//------------------------- test case core-0028NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a CDATASection node is
//                   the content of the CDATASection.
//
// Testing approach - Retrieve the first CDATASection node inside the second 
//                    child of the second employee and examine its "nodeValue" 
//                    attribute.  It should be set to "This is a CDATA Section
//                    with EntityReference number 2 &ent2;".
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0028NO()
 {
   var computedValue = 0;
   var expectedValue = "This is a CDATASection with EntityReference number 2 &ent2;";
   var testNode = "";
   var cDataNode = "";

   results = new testResults("Core0028NO");
   results.description = "The nodeValue attribute for a CDATASection Node "+
                         "should be set to the contents of the CDATASection."; 
//
// Retrieve the targeted data.
//
    testNode = new nodeObject(SECOND,SECOND);
    cDataNode = testNode.node.childNodes(1);
//
// Get the "nodeValue" attribute.
//
    computedValue = cDataNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0028NO --------------------------
//
//------------------------- test case core-0029NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for an EntityReference node
//                   is null.
//
// Testing approach - Retrieve the first Entity Reference node from the last
//                    child of the second employee and examine its
//                    "nodeValue" attribute.  It should be set to null.
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 19, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0029NO()
 {
   var computedValue = "";
   var expectedValue = null;
   var testNode = "";
   var entRefNode = "";

   results = new testResults("Core0029NO");
   results.description = "The nodeValue attribute for an EntityReference "+
                         "node should be set to null.";
//
// Get the targeted data.
//
    testNode = new nodeObject(SECOND,SIXTH);
    entRefNode = testNode.node.firstChild;
//
// The nodeValue attribute should be set to null.
//
    computedValue = entRefNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0029NO --------------------------
//
//------------------------- test case core-0030NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for an Entity node
//                   is null.
//
// Testing approach - Retrieve the first Entity declaration in the
//                    "DOCTYPE" section of the XML file and examine
//                    its "nodeValue" attribute.  It should be set to
//                    null.
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 18, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0030NO()
 {
   var computedValue = "";
   var expectedValue = null;
   var testNode = "";

   results = new testResults("Core0030NO");
   results.description = "The nodeValue attribute for an Entity node " +
                         "should be set to null.";
//
// Get the targeted data.
//
    testNode = getEntity("ent1");;
//
// The nodeValue attribute should be set to null.
//
    computedValue = testNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0030NO --------------------------
//
//------------------------- test case core-0031NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a ProcessingInstruction
//                   node is the entire content excluding the target.
//
// Testing approach - Retrieve the first declaration in the XML file
//                    and examine its "nodeValue" attribute.  It should
//                    be set to "version="1.0"".
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 19, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0031NO()
 {
   var computedValue = "";
   var expectedValue = "version=\"1.0\"";
   var testNode = "";

   results = new testResults("Core0031NO");
   results.description = "The nodeValue attribute for a ProcessingInstruction "+
                         "node is the entire contents excluding the target.";
//
// Get the targeted data.
//
    testNode = getDOMDocument().childNodes(0);
//
// The nodeValue attribute should be set to "version="1.0"".
//
    computedValue = testNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0031NO --------------------------
//
//------------------------- test case core-0032NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a comment node is
//                   the content of the comment.
//
// Testing approach - Retrieve the only comment in the XML file (third child)
//                    and examine its "nodeValue" attribute.  It should
//                    be set to " This is comment number 1.".
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 19, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0032NO()
 {
   var computedValue = "";
   var expectedValue = " This is comment number 1.";
   var testNode = "";

   results = new testResults("Core0032NO");
   results.description = "The nodeValue attribute for a comment node " +
                         "should be set to the contents of the comment.";
//
// Get the targeted data.
//
    testNode = getDOMDocument().childNodes(2);
//
// The nodeValue attribute should be set to " This is comment number 1."
//
    computedValue = testNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0032NO --------------------------
//
//------------------------- test case core-0033NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a Document node is
//                   null.
//
// Testing approach - Retrieve the DOM Document and examine its
//                    "nodeValue" attribute.  It should be set to null.
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 19, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0033NO()
 {
   var computedValue = "";
   var expectedValue = null;
   var testNode = "";

   results = new testResults("Core0033NO");
   results.description = "The nodeValue attribute for a Document node "+
                         "should be set to null.";
//
// Get the targeted data.
//
    testNode = getDOMDocument();
//
// The nodeValue attribute should be set to null.
//
    computedValue = testNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0033NO --------------------------
//
//------------------------- test case core-0034NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a DocumentType node is
//                   null.
//
// Testing approach - Retrieve the DOCTYPE declaration (second child) from
//                    the XML file and examine its "nodeValue" attribute.
//                    It should be set to null.
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 19, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0034NO()
 {
   var computedValue = "";
   var expectedValue = null;
   var testNode = "";

   results = new testResults("Core0034NO");
   results.description = "The nodeValue attribute for a DocumentType Node " +
                         "should be set to null.";
//
// Get the targeted data.
//
    testNode = getDOMDocument().childNodes(1);
//
// The nodeValue attribute should be set to null.
//
    computedValue = testNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0034NO ------------------------
//
//------------------------- test case core-0035NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a DocumentFragment node
//                   is null.
//
// Testing approach - Retrieve the whole DOM document and invoke its
//                    "createDocumentFragment()" method and examine the
//                    "nodeValue" attribute of the returned node.  It should
//                    be set to null.
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 19, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0035NO()
 {
   var computedValue = "";
   var expectedValue = null;
   var testNode = "";

   results = new testResults("Core0035NO");
   results.description = "The nodeValue attribute for a DocumentFragment node " +
                         "should be set to null.";
//
// Get the targeted data.
//
    testNode = getDOMDocument().createDocumentFragment();
//
// The nodeValue attribute should be set to null.
//
    computedValue = testNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0035NO --------------------------
//
//------------------------- test case core-0036NO -----------------------------
//
// Testing feature - The "nodeValue" attribute for a notation node is
//                   the name of the notation.
//
// Testing approach - Retrieve the Notation declaration inside the
//                    DocumentType node and examine its nodeValue 
//                    attribute.  It should be set to null.
//
// Semantic Requirements: 13, 16
//
// Last modification date - March 31, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0036NO()
 {
   var computedValue = "";
   var expectedValue = null;
   var testNode = "";

   results = new testResults("Core0036NO");
   results.description = "The nodeValue attribute for a Notation node " +
                         "should be set to null.";
//
// Get the targeted data.
//
    testNode = getNotation("notation1");
//
// The nodeValue attribute should be set to null.
//
    computedValue = testNode.nodeValue;
//
// write out results.
//
    results.expected = expectedValue;
    results.actual = computedValue;

    return results;
 }

//------------------------ End test case core-0036NO --------------------------
//
//------------------------   test case core-0037NO ----------------------------
//
// Testing feature - The "attributes" attribute for an Element node is
//                   a NamedNodeMap.
//
// Testing approach - Retrieve the last child of the third employee
//                    and examine its "attributes" attribute.  It should be 
//                    equal to a NamedNodeMap of its attributes. 
//
// Semantic Requirements: 13, 17
//
// Last modification date - March 19, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------

 function core0037NO()
 {
   var computedValue = "";
   var expectedValue = "";
   var testNode = "";
   var testName = "core-0037NO";

    testString += "The \"attributes\" attribute for an Element node";
    testString += " should be set to a NamedNodeMap.
"; testString += "
"; // // Retrieve the targeted data and its attributes. // testNode = new nodeObject(THIRD,SIXTH); computedValue += testNode.attributes(FIRST).name+" "; computedValue += testNode.attributes(SECOND).name; // // Determine the order of the NamedNodeMap items. // if (computedValue.charAt(0) == "d" && computedValue.charAt(1) == "o") expectedValue = "domestic street"; else expectedValue = "street domestic"; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0037NO -------------------------- // //------------------------- test case core-0038NO ----------------------------- // // Testing feature - The "attributes" attribute for an Attribute node is // null. // // Testing approach - Retrieve the first attribute from the last child of // the first employee and. Its "attributes" attribute // is then checked. It should be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0038NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var attrNode = ""; results = new testResults("Core0038NO"); results.description = "The \"attributes\" attribute for an Attribute node " + "should be set to null."; // // Retrieve the targeted data. // testNode = new nodeObject(FIRST,SIXTH); attrNode = testNode.attributes(FIRST); // // The "attributes" attribute should be set to null. // computedValue = attrNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0038NO -------------------------- // //------------------------- test case core-0039NO ----------------------------- // // Testing feature - The "attributes" attribute for a Text node is // null. // // Testing approach - Retrieve the text data from the last child of the // first employee and examine its "attributes" // attribute. It should be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0039NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var textNode = ""; results = new testResults("Core0039NO"); results.description = "The \"attributes\" attribute for a Text node "+ "should be set to null."; // // Retrieve the targeted data. // testNode = new nodeObject(FIRST,SIXTH); textNode = testNode.node.firstChild; // // The "attributes" attribute should be set to null // computedValue = textNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0039NO -------------------------- // //------------------------- test case core-0040NO ----------------------------- // // Testing feature - The "attributes" attribute for a CDATASection node is // null. // // Testing approach - Retrieve the CDATASection node contained inside // the second child of the second employee and // examine its "attributes" attribute. It should be // set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0040NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var cDataNode = ""; results = new testResults("Core0040NO"); results.description = "The \"attributes\" attribute for a CDATASection "+ "node should be set to null."; // // Retrieve the targeted data. // testNode = new nodeObject(SECOND,SECOND); cDataNode = testNode.node.lastChild; // // The "attributes" attribute should be set to null. // computedValue = cDataNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0040NO -------------------------- // //------------------------- test case core-0041NO ----------------------------- // // Testing feature - The "attributes" attribute for an EntityReference node // is null. // // Testing approach - Retrieve the first Entity Reference node from the last // child of the second employee and examine its // "attributes" attribute. It should be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0041NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var entRefNode = ""; results = new testResults("Core0041NO"); results.description = "The \"attributes\" attribute for an "+ "EntityReference node should be set to null."; // // Retrieve the targeted data. // testNode = new nodeObject(SECOND,SIXTH); entRefNode = testNode.node.firstChild; // // The \"attributes\" attribute should be set to null. // computedValue = entRefNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0041NO -------------------------- // //------------------------- test case core-0042NO ----------------------------- // // Testing feature - The "attributes" attribute for an Entity node // is null. // // Testing approach - Retrieve the first Entity declaration in the // "DOCTYPE" section of the XML file and examine // its "attributes" attribute. It should be set to // null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0042NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0042NO"); results.description = "The \"attributes\" attribute for an Entity node "+ "should be set to null."; // // Get the targeted data. // testNode = getEntity("ent1"); // // The "attributes" attribute should be set to null. // computedValue = testNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0042NO -------------------------- // //------------------------- test case core-0043NO ----------------------------- // // Testing feature - The "attributes" attribute for a ProcessingInstruction // node is null. // // Testing approach - Retrieve the first declaration in the XML file // and examine its "attributes" attribute. It should // be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0043NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0043NO"); results.description = "The \"attributes\" attribute for a "+ "ProcessingInstruction node is null."; // // Get the targeted data. // testNode = getDOMDocument().childNodes(0); // // The "attributes" attribute should be set to null. // computedValue = testNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0043NO -------------------------- // //------------------------- test case core-0044NO ----------------------------- // // Testing feature - The "attributes" attribute for a comment node is // null. // // Testing approach - Retrieve the third child of the DOM document and // examine its "attributes" attribute. It should // be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0044NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0044NO"); results.description = "The \attributes\" attribute for a comment node "+ "should be set to null." // // Get the targeted data. // testNode = getDOMDocument().childNodes(2); // // The "attributes" attribute should be set to null. // computedValue = testNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0044NO -------------------------- // //------------------------- test case core-0045NO ----------------------------- // // Testing feature - The "attributes" attribute for a Document node is // null. // // Testing approach - Retrieve the DOM Document and examine its // "attributes" attribute. It should be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0045NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0045NO"); results.description = "The \"attributes\" attribute for a Document node "+ "should be set to null."; // // Get the targeted data. // testNode = getDOMDocument(); // // The "attributes" attribute should be set to null. // computedValue = testNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0045NO -------------------------- // //------------------------- test case core-0046NO ----------------------------- // // Testing feature - The "attributes" attribute for a DocumentType node is // null. // // Testing approach - Retrieve the DOCTYPE declaration (second child) from // the XML file and examine its "attribute" attribute. // It should be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0046NO() { var computedValue = 0; var expectedValue = null; var testNode = ""; results = new testResults("Core0046NO"); results.description = "The \"attribute\" attribute for a DocumentType "+ "node should be set to null."; // // Get the targeted data. // testNode = getDocType(); // // The "attributes" attribute should be set to null. // computedValue = testNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0046NO ------------------------ // //------------------------- test case core-0047NO --------------------------- // // Testing feature - The "attributes" attribute for a DocumentFragment node // is null. // // Testing approach - Retrieve the whole DOM document and invoke its // "createDocumentFragment()" method and examine the // "attributes" attribute of the returned node. It // should be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0047NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0047NO"); results.description = "The \"attributes\" attribute for a DocumentFragment "+ "node should be set to null."; // // Get the targeted data. // testNode = getDOMDocument().createDocumentFragment(); // // The "attributes" attribute should be set to null. // computedValue = testNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0047NO -------------------------- // //------------------------- test case core-0048NO ----------------------------- // // Testing feature - The "attributes" attribute for a notation node is // null. // // Testing approach - Retrieve the Notation declaration inside the // DocumentType node and examine its "attributes" // attribute. It should be set to null. // // Semantic Requirements: 13, 17 // // Last modification date - March 30, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0048NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0048NO"); results.description = "The \"attributes\" attribute for a Notation node "+ "should be set to null."; // // Get the targeted data. // testNode = getNotation("notation1"); // // The "attributes" attribute should be set to null. // computedValue = testNode.attributes; // // write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0048NO -------------------------- // //------------------------- test case core-0049NO ----------------------------- // // Testing feature - The "parentNode" attribute contains the parent of // this node. // // Testing approach - Retrieve the second employee and examine its // "parentNode" attribute. It should be set // to "staff". // // Semantic Requirements: 18 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0049NO() { var computedValue = ""; var expectedValue = "staff"; var testNode = ""; var testNodeParent; results = new testResults("Core0049NO"); results.description = "The parentNode attribute contains the parent "+ "node of this node."; // // Retrieve the targeted data and access its parent node. // testNode = new nodeObject(SECOND); testNodeParent = testNode.node.parentNode; // // The nodeName attribute should be "staff". // computedValue = testNodeParent.nodeName; // // Write out results // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0049NO -------------------------- // //------------------------- test case core-0050NO ----------------------------- // // Testing feature - The "parentNode" attribute of a node that has just // been created and not yet added to the tree is null. // // Testing approach - Create a new "employee" Element node using the // "createElement(name)" method from the Document // interface. Since this new node has not yet been // added to the tree, its parentNode attribute should // be null. // // Semantic Requirements: 19 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0050NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0050NO"); results.description = "The parentNode attribute of a node that has just "+ "been created, but not yet added to the tree is "+ "null."; // // Create new node and access its parentNode attribute. // testNode = createNode(ELEMENT_NODE,"employee"); computedValue = testNode.parentNode; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0050NO -------------------------- // //------------------------- test case core-0051NO ----------------------------- // // Testing feature - The "parentNode" attribute of a node that has been // been removed from the tree is null. // // Testing approach - Remove the first employee by invoking the // "removeChild(oldChild)" method and examine its // parentNode attribute. It should be set to null. // // Semantic Requirements: 20 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0051NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var removedNode = ""; results = new testResults("Core0051NO"); results.description = "The parentNode attribute of a node that has "+ "been removed from the tree is null."; // // Remove the targeted data and access its parentNode attribute. // testNode = new nodeObject(FIRST); removedNode = getRootNode().removeChild(testNode.node); computedValue = removedNode.parentNode; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0051NO -------------------------- // //------------------------- test case core-0052NO ----------------------------- // // Testing feature - The "childNodes" attribute of a node contains a // NodeList of all the children of this node. // // Testing approach - Retrieve the second employee and examine its // childNodes attribute. It should be NodeList // containing all of its children. The length of // the list should be 9. // // Semantic Requirements: 21 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0052NO() { var computedValue = 0; var expectedValue = 6; var testNode = ""; var nodeList = ""; results = new testResults("Core0052NO"); results.description = "The childNodes attribute of a node contains a "+ "NodeList of all the children of this node."; // // Retrieve targeted data and examine the list length. // testNode = new nodeObject(SECOND); nodeList = testNode.node.childNodes; computedValue = nodeList.length; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0052NO -------------------------- // //------------------------- test case core-0053NO ----------------------------- // // Testing feature - If a node has no children then the NodeList returned // by its childNodes attribute has no nodes. // // Testing approach - Retrieve the textual data from the first child of // of the second employee and examine its childNodes // attribute. It should be NodeList with no nodes // in it. // // Semantic Requirements: 22 // // Last modification date - March 19, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0053NO() { var computedValue = ""; var expectedValue = 0; var testName = "core-0053NO"; var testNode = ""; var noChildNode = ""; results = new testResults("Core0053NO"); results.description = "If a node has no child nodes then the NodeList "+ "returned by its childNodes attribute has no "+ "nodes."; // // Retrieve the targeted data and access its childNodes attribute. // testNode = new nodeObject(SECOND,FIRST); noChildNode = testNode.node.firstChild.childNodes; computedValue = noChildNode.length; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0053NO -------------------------- // //------------------------- test case core-0054NO ----------------------------- // // Testing feature - The NodeList returned by the childNodes attribute is live. // Changes on the node's children are immediately reflected // on the nodes returned by the NodeList. // // Testing approach - Create a NodeList of the children of the second employee // and then add a newly created element (created with the // "createElement" method from the Document interface) to // the second employee by using the "append" method. The // length attribute of the NodeList should reflect this new // addition to the child list. It should now return the // value 7. // // Semantic Requirements: 23 // // Last modification date - March 22, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0054NO() { var computedValue = 0; var expectedValue = 7; var testNode = ""; var nodeList = ""; results = new testResults("Core0054NO"); results.description = "The NodeList returned by the ChildNodes attribute "+ "is live. Changes in the children node are "+ "immediately reflected in the NodeList."; // // Retrieve the targeted data and append a new Element node to it. // testNode = new nodeObject(SECOND); nodeList = testNode.node.childNodes; testNode.node.appendChild(createNode(ELEMENT_NODE,"text3")); computedValue = nodeList.length; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0054NO -------------------------- // //------------------------- test case core-0055NO ----------------------------- // // Testing feature - The firstChild attribute contains the first child of this // node. // // Testing approach - Retrieve the second employee and examine its firstChild // attribute. It should be set to a node whose tag name // "employeeId". // // Semantic Requirements: 24 // // Last modification date - March 22, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0055NO() { var computedValue = ""; var expectedValue = "employeeId"; var testNode = ""; var firstChildNode = ""; results = new testResults("Core0055NO"); results.description = "The firstChild attribute contains the first "+ "child of this node."; // // Retrieve the targeted data. // testNode = new nodeObject(SECOND); firstChildNode = testNode.node.firstChild; // // Its firstChild attribute's tagName should be "employeeId". // computedValue = firstChildNode.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0055NO -------------------------- // //------------------------- test case core-0056NO ----------------------------- // // Testing feature - If there is no first child then the firstChild attribute // returns null. // // Testing approach - Retrieve the Text node from the first child of the first // employee and examine its firstChild attribute. It // should be set to null. // // Semantic Requirements: 25 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0056NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var noChildNode = ""; results = new testResults("Core0056NO"); results.description = "If a node does not have a first child then its "+ "firstChild attribute returns null."; // // Get the targeted data. // testNode = new nodeObject(FIRST,FIRST); noChildNode = testNode.node.firstChild;; // // Its firstChild attribute should be equal to null. // computedValue = noChildNode.firstChild; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0056NO -------------------------- // //------------------------- test case core-0057NO ----------------------------- // // Testing feature - The lastChild attribute contains the last child of this // node. // // Testing approach - Retrieve the second employee and examine its lastChild // attribute. It should be set to a node whose tag name // is "address". // // Semantic Requirements: 26 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0057NO() { var computedValue = ""; var expectedValue = "address"; var testNode = ""; var lastChildNode = ""; results = new testResults("Core0057NO"); results.description = "The lastChild attribute contains the last "+ "child of this node."; // // Retrieve the targeted data and access its lastChild attribute. // testNode = new nodeObject(SECOND); // // Its lastChild attribute should be equal to a node with tag name = "address". // lastChildNode = testNode.node.lastChild; computedValue = lastChildNode.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0057NO -------------------------- // //------------------------- test case core-0058NO ----------------------------- // // Testing feature - If there is no last child then the lastChild attribute // returns null. // // Testing approach - Retrieve the Text node inside the first child of the // second employee and examine its lastChild attribute. // It should be set to null. // // Semantic Requirements: 27 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0058NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var noChildNode = ""; results = new testResults("Core0058NO"); results.description = "If a node does not have a last child then its "+ "lastChild attribute returns null."; // // Retrieve the targeted data. // testNode = new nodeObject(SECOND,FIRST); noChildNode = testNode.node.firstChild; // // Its lastChild attribute should be equal to null. // computedValue = noChildNode.lastChild; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0058NO -------------------------- // //------------------------- test case core-0059NO ----------------------------- // // Testing feature - The previousSibling attribute contains the node // immediately preceding this node. // // Testing approach - Retrieve the second child of the second employee and // examine its previousSibling attribute. It should be set // to a node whose tag name is "employeeId". // // Semantic Requirements: 28 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0059NO() { var computedValue = ""; var expectedValue = "employeeId"; var testNode = ""; var itsPreviousSibling = ""; results = new testResults("Core0059NO"); results.description = "The previousSibling attribute contains the node "+ "immediately preceding this node."; // // Retrieve the targeted data and accesss its previousiSibling attribute. // testNode = new nodeObject(SECOND,SECOND); itsPreviousSibling = testNode.node.previousSibling; // // Its previousSibling attribute should have a tag name = "employeeId". // computedValue = itsPreviousSibling.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0059NO -------------------------- // //------------------------- test case core-0060NO ----------------------------- // // Testing feature - If there is no immediately preceding node then the // previousSibling attribute returns null. // // Testing approach - Retrieve the first child of the of the second employee // employee and examine its previousSibling attribute. // It should be set to null. // // Semantic Requirements: 29 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0060NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0060NO"); results.description = "If there is no node immediately preceding this "+ "node then the previousSibling attribute returns "+ "null."; // // Retrieve the targeted data. // testNode = new nodeObject(SECOND,FIRST); // // Its previousSibling attribute should be equal to null. // computedValue = testNode.node.previousSibling; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0060NO -------------------------- // //------------------------- test case core-0061NO ----------------------------- // // Testing feature - The nextSibling attribute contains the node // immediately following this node. // // Testing approach - Retrieve the first child of the second employee and // examine its nextSibling attribute. It should be set // to a node whose tag name is "name". // // Semantic Requirements: 30 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0061NO() { var computedValue = ""; var expectedValue = "name"; var testNode = ""; var itsNextSibling = ""; results = new testResults("Core0061NO"); results.description = "The nextSibling attribute contains the node "+ "immediately following this node."; // // Retrieve the targeted data and access its nextSibling attribute. // testNode = new nodeObject(SECOND,FIRST); itsNextSibling = testNode.node.nextSibling; // // Its nextSibling attribute should be a node with tag name = "name". // computedValue = itsNextSibling.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0061NO -------------------------- // //------------------------- test case core-0062NO ----------------------------- // // Testing feature - If there is no node immediately following this node // then the nextSibling attribute returns null. // // Testing approach - Retrieve the last child of the second employee // and examine its nextSibling attribute. It should // be set to null. // // Semantic Requirements: 31 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0062NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0062NO"); results.description = "If there is no node immediately following this "+ "node then the nextSibling attribute returns null."; // // Retrieve the targeted data. // testNode = new nodeObject(SECOND,SIXTH); // // Its NextSibling attribute should be equal to null. // computedValue = testNode.node.nextSibling; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0062NO -------------------------- // //------------------------- test case core-0063NO ----------------------------- // // Testing feature - The ownerDocument attribute contains the Document // associated with this node. // // Testing approach - Retrieve the second employee and examine its // ownerDocument attribute. It should contain a // document whose documentElement attribute is equal // to "staff". // // Semantic Requirements: 32 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0063NO() { var computedValue = ""; var expectedValue = "staff"; var testNode = ""; var ownerDoc = ""; results = new testResults("Core0063NO"); results.description = "The ownerDocument attribute contains the Document "+ "associated with this node."; // // Retrieve the targeted data and access its ownerDocument attribute. // testNode = new nodeObject(SECOND); ownerDoc = testNode.node.ownerDocument; // // the nodeName of its root node should be "staff"; // computedValue = ownerDoc.documentElement.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0063NO -------------------------- // //------------------------- test case core-0064NO ----------------------------- // // Testing feature - The ownerDocument attribute returns null if the // target node is itself a Document. // // Testing approach - Retrieve the master document by invoking the // "getDOMDocument()" method then examine the // ownerDocument attribute of the returned object. // It should be null. // // Semantic Requirements: 33 // // Last modification date - March 23, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0064NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; results = new testResults("Core0064NO"); results.description = "The ownerDocument attribute returns null if the "+ "target node is itself a Document."; // // Retrieve the targeted data. // testNode = getDOMDocument(); // // Its ownerDocument attribute should be null. // computedValue = testNode.ownerDocument; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0064NO -------------------------- // //------------------------- test case core-0065NO ----------------------------- // // Testing feature - The insertBefore(newChild,refChild) method inserts the // node newChild before the node refChild. // // Testing approach - Insert a newly created Element node before the fourth // child of the second employee and examine the new child // and the reference child after the insertion for correct // placement. // // Semantic Requirements: 34 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0065NO() { var computedValue = ""; var expectedValue = "newChild salary" var refChild = ""; var newChild = ""; var testNode = ""; results = new testResults("Core0065NO"); results.description = "The insertBefore(newChild,refChild) method inserts "+ "the node newChild before the node refChild."; // // Retrieve targeted data, create a new Element node to insert, define the // reference node, and insert the newly created element. // testNode = new nodeObject(SECOND); refChild = new nodeObject(SECOND,FOURTH); newChild = createNode(ELEMENT_NODE,"newChild"); testNode.node.insertBefore(newChild,refChild.node); // // Check that each node is in the proper position. // computedValue += testNode.subNodes(FOURTH).nodeName+" "; computedValue += testNode.subNodes(FIFTH).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0065NO -------------------------- // //------------------------- test case core-0066NO ----------------------------- // // Testing feature - If the refChild is null then the // insertBefore(newChild,refChild) method inserts the // node newChild at the end of the list of children. // // Testing approach - Retrieve the second employee and invoke the the // insertBefore(newChild,refChild) method with // refChild = null. Under these conditions the // newChild should be added at the end of the list. // The last item in the list is examined after the // insertion. The last Element node of the list // should be "newChild". // // Semantic Requirements: 35 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0066NO() { var computedValue = ""; var expectedValue = "newChild"; var refChild = null; var newChild = ""; var testNode = ""; results = new testResults("Core0066NO"); results.description = "If refChild is null then the insertBefore("+ "newChild,refChild) method inserts the node "+ "newChild at the end of the list."; // // Retrieve targeted data, create a new Element node to insert, define // the reference node and insert the newly created element // testNode = new nodeObject(SECOND); newChild = createNode(ELEMENT_NODE,"newChild"); testNode.node.insertBefore(newChild,refChild); // // Retrieve the node at the end of the list. // computedValue = testNode.node.lastChild.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0066NO -------------------------- // //------------------------- test case core-0067NO ----------------------------- // // Testing feature - If the refChild is a DocumentFragment object then all // its children are inserted in the same order before // the refChild. // // Testing approach - Create a DocumentFragment object and populate it with // two element nodes. Retrieve the second employee // and insert the newly created DocumentFragment before // its fourth child. The second employee should now // have two extra children ("childNode1" and "childNode2") // at positions fourth and fifth respectively. // // Semantic Requirements: 36 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0067NO() { var computedValue = ""; var expectedValue = "newChild1 newChild2"; var testNode = ""; var refChild = ""; var newDocFragment = getDOMDocument().createDocumentFragment(); results = new testResults("Core0067NO"); results.description = "If newChild is a DocumentFragment object, then all "+ "its children are inserted in the same order before "+ "the refChild node."; // // Populate the DocumentFragment object. // newDocFragment.appendChild(createNode(ELEMENT_NODE,"newChild1")); newDocFragment.appendChild(createNode(ELEMENT_NODE,"newChild2")); // // Retrieve targeted data, define reference node and insert new child. // testNode = new nodeObject(SECOND); refChild = new nodeObject(SECOND,FOURTH); testNode.node.insertBefore(newDocFragment,refChild.node); // // Check that all the new nodes are in the proper position. // computedValue += testNode.subNodes(FOURTH).nodeName+" "; computedValue += testNode.subNodes(FIFTH).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0067NO -------------------------- // //------------------------- test case core-0068NO ----------------------------- // // Testing feature - The insertBefore(newChild,refChild) method returns the // node being inserted. // // Testing approach - Insert an Element node before the fourth child // of the second employee and examine the returned // node from the method. The node Element node // returned by the method should be "newChild". // // Semantic Requirements: 37 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0068NO() { var computedValue = ""; var expectedValue = "newChild" var testNode = ""; var refChild = ""; var newChild = ""; var insertedNode = ""; results = new testResults("Core0068NO"); results.description = "The insertBefore(newChild,refChild) method returns "+ "the node being inserted."; // // Retrieve targeted data, define reference and new child nodes and insert // new child. // testNode = new nodeObject(SECOND); refChild = new nodeObject(SECOND,FOURTH); newChild = createNode(ELEMENT_NODE,"newChild"); insertedNode = testNode.node.insertBefore(newChild,refChild.node); // // the returned node should have a nodeName = "newChild" // computedValue = insertedNode.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0068NO -------------------------- // //------------------------- test case core-0069NO ----------------------------- // // Testing feature - If the newChild is already in the tree, The // insertBefore(newChild,refChild) method first // remove it before the insertion takes place. // // Testing approach - Insert a node element (employeeId tag) that is already // present in the tree. The existing node should be // remove first and the new one inserted. The node is // inserted at a different position in the tree to assure // that it was indeed inserted. // // Semantic Requirements: 38 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0069NO() { var computedValue = ""; var expectedValue = "name employeeId"; var refChild = ""; var newChild = ""; var testNode = ""; results = new testResults("Core0069NO"); results.description = "If newChild is already in the tree, it is first "+ "removed before the insertion (from insertBefore"+ "(newChild,refChild) method) takes place."; // // Retrieve targeted data, define reference and new child and insert the // new child. // testNode = new nodeObject(SECOND); newChild = new nodeObject(SECOND,FIRST); refChild = new nodeObject(SECOND,SIXTH); testNode.node.insertBefore(newChild.node,refChild.node); // // the newChild should now be the previous to the last item and the // first child should be one that used to be at the second position. // computedValue += testNode.subNodes(FIRST).nodeName+" "; computedValue += testNode.subNodes(FIFTH).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0069NO -------------------------- // //------------------------- test case core-0070NO ----------------------------- // // Testing feature - The replaceChild(newChild,oldChild) method replaces // the node oldChild with the node newChild. // // Testing approach - Replace the first element of the second employee // with a newly created node element and examine the // first position after the replacement operation is // done. The new element should be "newChild". // // Semantic Requirements: 39 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0070NO() { var computedValue = ""; var expectedValue = "newChild"; var testNode = ""; var refChild = ""; var newChild = ""; results = new testResults("Core0070NO"); results.description = "The replaceChild(newChild,oldChild) method "+ "replaces the node oldChild with the node newChild"; // // Create a new Element node to replace, define the node to be // replaced and replace it. // testNode = new nodeObject(SECOND); oldChild = new nodeObject(SECOND,FIRST); newChild = createNode(ELEMENT_NODE,"newChild"); testNode.node.replaceChild(newChild,oldChild.node); // // Check that the first position contains the new node. // computedValue = testNode.subNodes(FIRST).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0070NO ------------------------ // //------------------------- test case core-0071NO --------------------------- // // Testing feature - If the newChild is already in the tree, it is // first removed before the new one is added // // Testing approach - Retrieve the second employee and replace its last child // with its first child. After the replacement operation // The first child should now be the one that used to be at // the second position in the list and the last one should // be the one that used to be at the first position. // // Semantic Requirements: 40 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0071NO() { var computedValue = ""; var expectedValue = "name employeeId"; var testNode = ""; var oldChild = ""; var newChild = ""; results = new testResults("Core0071NO"); results.description = "If newChild is already in the tree, it is first "+ "removed before the replace(from replaceChild"+ "(newChild,oldChild) method) takes place."; // // Retrieve targeted data, identify new and old children and replace // last child with the new child. // testNode = new nodeObject(SECOND); newChild = new nodeObject(SECOND,FIRST); oldChild = new nodeObject(SECOND,SIXTH); testNode.node.replaceChild(newChild.node,oldChild.node); // // The first item in the list should be the one that used to be at the // second position and the last one should be the one that used to be at // the first position in the list. // computedValue += testNode.subNodes(FIRST).nodeName+" "; computedValue += testNode.subNodes(FIFTH).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0071NO -------------------------- // //------------------------- test case core-0072NO ----------------------------- // // Testing feature - The replaceChild(newChild,oldChild) method returns // the node being replaced. // // Testing approach - Replace the first element of the second employee // with a newly created node element and examine the // the value returned by the replaceChild(newChild,oldChild) // after the replacement operation is done. The returned // node should have a nodeName equal to "employeeId". // // Semantic Requirements: 41 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0072NO() { var computedValue = ""; var expectedValue = "employeeId" var testNode = ""; var oldChild = ""; var newChild = ""; var replacedNode = ""; results = new testResults("Core0072NO"); results.description = "The replaceChild(newChild,oldChild) method returns "+ "the node being replaced."; // // Retrieve the targeted data, define new and old children and replace // old child with new child. // testNode = new nodeObject(SECOND); oldChild = new nodeObject(SECOND,FIRST); newChild = createNode(ELEMENT_NODE,"newChild"); replacedNode = testNode.node.replaceChild(newChild,oldChild.node); // // The returned node should be the one being replaced. // computedValue = replacedNode.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0072NO -------------------------- // //------------------------- test case core-0073NO ----------------------------- // // Testing feature - The removeChild(oldChild) method removes the node // indicated by oldChild. // // Testing approach - Retrieve the second employee and remove its first // child. After the removal operation takes place, the // second employee should have 5 children and the first // one should be the one that used to be at the second // position in the list. // // Semantic Requirements: 42 // // Last modification date - March 24, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0073NO() { var computedValue = ""; var expectedValue = "name 5"; var testNode = ""; var oldChild = ""; results = new testResults("Core0073NO"); results.description = "The removeChild(oldChild) method removes the "+ "node indicated by oldChild."; // // Retrieve targeted data, identify old child and remove it from the // list of children. // testNode = new nodeObject(SECOND); oldChild = new nodeObject(SECOND,FIRST); testNode.node.removeChild(oldChild.node); // // Check that the node was indeed removed from the list. // computedValue += testNode.subNodes(FIRST).nodeName+" "; computedValue += testNode.subNodes.length; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0073NO -------------------------- // //------------------------- test case core-0074NO ----------------------------- // // Testing feature - The removeChild(oldChild) method returns the node // removed. // // Testing approach - Remove the first element of the second employee // and examine the value returned by the // removeChild(oldChild) after removal operation is // done. The returned node should have a tag name equal // to "employeeId". // // Semantic Requirements: 43 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0074NO() { var computedValue = ""; var expectedValue = "employeeId"; var testNode = ""; var oldChild = ""; var removedNode = ""; results = new testResults("Core0074NO"); results.description = "The removeChild(oldChild) method returns the "+ "node removed."; // // Retrieve the targeted data and remove it. // testNode = new nodeObject(SECOND); oldChild = new nodeObject(SECOND,FIRST); removedNode = testNode.node.removeChild(oldChild.node); // // The returned node should be the node removed. // computedValue = removedNode.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0074NO -------------------------- // //------------------------- test case core-0075NO ----------------------------- // // Testing feature - The appendChild(newChild) method adds the node newChild // the end of the list of children of the node. // // Testing approach - Retrieve the second employee and append a new Element // node to its list of children. The last node in the // list is then retrieved and its nodeName attribute // examined. It should be equal to "newChild". // // Semantic Requirements: 44 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0075NO() { var computedValue = ""; var expectedValue = "newChild"; var testNode = ""; var newChild = ""; results = new testResults("Core0075NO"); results.description = "The appendChild(newChild) method adds the node "+ "newChild to the end of the list of children of "+ "the node."; // // Create a new Element node and append it to the end of the list. // testNode = new nodeObject(SECOND); newChild = createNode(ELEMENT_NODE,"newChild"); testNode.node.appendChild(newChild); // // Retrieve the new last child. // computedValue = testNode.subNodes(SEVENTH).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0075NO ------------------------ // //------------------------- test case core-0076NO --------------------------- // // Testing feature - If the newChild is already in the tree, it is first // removed before the new one is appended. // // Testing approach - Retrieve the second employee and its first child, then // append the first child to the end of the list. After // the append operation is done, retrieve the element at // at the top of the list and the one at the end of the // list. The last node should be the one that used to be // at the top of the list and the first one should be the // one that used to be second in the list. // // Semantic Requirements: 45 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0076NO() { var computedValue = ""; var expectedValue = "name employeeId"; var testNode = ""; var newChild = ""; results = new testResults("Core0076NO"); results.description = "If newChild is already in the tree, it is first "; "removed before the append takes place."; // // Retrieve targeted data, define the new child and append it to the // end of the list. // testNode = new nodeObject(SECOND); newChild = new nodeObject(SECOND,FIRST); testNode.node.appendChild(newChild.node); // // Access the relevant new nodes and its nodeName attributes. // computedValue += testNode.subNodes(FIRST).nodeName+" "; computedValue += testNode.subNodes(SIXTH).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0076NO -------------------------- // //------------------------- test case core-0077NO ----------------------------- // // Testing feature - If the newChild is a DocumentFragment object then all // its content is added to the child list of this node. // // Testing approach - Create and populate a new DocumentFragment object and // append it to the second employee. After the append // operation is done then retrieve the new nodes at the // end of the list, they should be the two Element nodes // from the DocumentFragment. // // Semantic Requirements: 46 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0077NO() { var computedValue = ""; var expectedValue = "newChild1 newChild2"; var testNode = ""; var newDocFragment = getDOMDocument().createDocumentFragment(); results = new testResults("Core0077NO"); results.description = "If newChild is a DocumentFragment object, then the "+ "entire content of the DocumentFragment is appended "+ "to the child list of this node." // // Populate the DocumentFragment object. // newDocFragment.appendChild(createNode(ELEMENT_NODE,"newChild1")); newDocFragment.appendChild(createNode(ELEMENT_NODE,"newChild2")); // // Retrieve targeted data and append new DocumentFragment object. // testNode = new nodeObject(SECOND); testNode.node.appendChild(newDocFragment); // // Retrieve all the new nodes from the proper position. // computedValue += testNode.subNodes(SEVENTH).nodeName+" "; computedValue += testNode.subNodes(EIGHT).nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0077NO -------------------------- // //------------------------- test case core-0078NO ----------------------------- // // Testing feature - The appendChild(newChild) method returns the node // added. // // Testing approach - Append a newly created node to the child list of the // second employee and examine the returned value // The returned value should be "newChild". // // Semantic Requirements: 47 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0078NO() { var computedValue = ""; var expectedValue = "newChild"; var testNode = ""; var appendedNode = ""; var newChild = ""; results = new testResults("Core0078NO"); results.description = "The appendChild(newChild) method returns the node "+ "added."; // // Retrieve the targeted data and append a new node to it. // testNode = new nodeObject(SECOND); newChild = createNode(ELEMENT_NODE,"newChild"); appendedNode = testNode.node.appendChild(newChild); // // The returned node should be the node appended. // computedValue = appendedNode.nodeName; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0078NO -------------------------- // //------------------------- test case core-0079NO ----------------------------- // // Testing feature - The hasChildNodes method returns true if the node has // any children. // // Testing approach - Retrieve the root node (tag name = "staff") and // invoke its hasChildNodes() method. It should return // the value true. // // Semantic Requirements: 48 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0079NO() { var computedValue = ""; var expectedValue = true; var testNode = ""; results = new testResults("Core0079NO"); results.description = "The hasChildNodes method returns true if the "+ "node has any children."; // // Retrieve the targeted data and access its hasChilNodes method. // testNode = new nodeObject(SECOND); computedValue = testNode.node.hasChildNodes(); // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0079NO -------------------------- // //------------------------- test case core-0080NO ----------------------------- // // Testing feature - The hasChildNodes method returns false if the node has // no children. // // Testing approach - Retrieve the Text node inside the first child of the // second employee and invoke its hasChildNodes() method. // It should return the value false as this node has no // children. // // Semantic Requirements: 49 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0080NO() { var computedValue = ""; var expectedValue = false var testNode = ""; results = new testResults("Core0080NO"); results.description = "The hasChildNodes method returns false if the "+ "node has no children."; // // Retrieve the targeted data and access its hasChildNodes method. // testNode = new nodeObject(SECOND,FIRST); textNode = testNode.node.firstChild; computedValue = textNode.hasChildNodes(); // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0080NO -------------------------- // //------------------------- test case core-0081NO ----------------------------- // // Testing feature - The cloneNode(deep) method returns a copy of the node only // if deep = false. // // Testing approach - Retrieve the second employee and invoke its // cloneNode(deep) method with deep = false. The // method should clone this node only. The nodeName, // and length of the childNode list are checked, // they should be "employee" and 0. // // Semantic Requirements: 50 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0081NO() { var computedValue = ""; var expectedValue = "employee 0"; var testNode = ""; var clonedNode = ""; results = new testResults("Core0081NO"); results.description = "The cloneNode(deep) method returns a copy of this "+ "node only if deep = false."; // // Retrieve the targeted data and access its cloneNode method. // testNode = new nodeObject(SECOND); clonedNode = testNode.node.cloneNode(false); // // Retrieve values of the cloned node. // computedValue += clonedNode.nodeName+" "; computedValue += clonedNode.childNodes.length; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0081NO -------------------------- // //------------------------- test case core-0082NO ----------------------------- // // Testing feature - The cloneNode(deep) method returns a copy of the node and // the subtree under it if deep = true. // // Testing approach - Retrieve the second employee and invoke its // cloneNode(deep) method with deep = true. The // method should clone this node and the subtree under // it. The tag name of each child of the returned // node is checked to insure the entire subtree under // the second employee was cloned. // // Semantic Requirements: 51 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0082NO() { var computedValue = ""; var expectedValue = "employeeId name position salary gender address "; var testNode = ""; var subTree = ""; var clonedNode = ""; results = new testResults("Core0082NO"); results.description = "The cloneNode(deep) method returns a copy of this "+ "node and the subtree under it if deep = true."; // // Retrieve the targeted data and invoke its cloneNode method. // testNode = new nodeObject(SECOND); clonedNode = testNode.node.cloneNode(true); subTree = clonedNode.childNodes; // // Retrieve the cloned node children. // for (var index = 0;index < subTree.length; index++) computedValue += subTree(index).nodeName+" "; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0082NO -------------------------- // //------------------------- test case core-0083NO ----------------------------- // // Testing feature - The duplicate node returned by the cloneNode(deep) method // has no parent (parentNode = null). // // Testing approach - Retrieve the second employee and invoke its // cloneNode(deep) method with deep = false. The // duplicate node returned by the method should have its // parentNode attribute set to null. // // Semantic Requirements: 52 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0083NO() { var computedValue = ""; var expectedValue = null; var testNode = ""; var clonedNode = ""; results = new testResults("Core0083NO"); results.description = "The duplicate node returned by the cloneNode(deep) "+ "method has no parent (parentNode = null)."; // // Retrieve the targeted data and invoke the cloneNode method. // testNode = new nodeObject(SECOND); clonedNode = testNode.node.cloneNode(false); // // Its parentNode attribute should be null. // computedValue = clonedNode.parentNode; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0083NO -------------------------- // //------------------------- test case core-0084NO ----------------------------- // // Testing feature - The cloneNode(deep) method does not copy text unless it is // deep cloned. (test for deep clone = false) // // Testing approach - Retrieve the fourth child of the second employee and // invoke its cloneNode(deep) method with deep = false. The // duplicate node returned by the method should not copy any // text data contained in this node. // // Semantic Requirements: 53 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0084NO() { var testName = "core-0084NO"; var computedValue = ""; var expectedValue = null; var testNode = ""; var clonedNode = ""; results = new testResults("Core0084NO"); results.description = "The cloneNode(deep) method does not copy any text "+ "unless it is deep cloned(deep = false)."; // // Retrieve the targeted data and invoke its clonedNode method. // testNode = new nodeObject(SECOND,FOURTH) clonedNode = testNode.node.cloneNode(false); // // The cloned node should have no text data in it. // computedValue = clonedNode.lastChild; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0084NO -------------------------- // //------------------------- test case core-0085NO ----------------------------- // // Testing feature - The cloneNode(deep) method does not copy text unless it is // deep cloned. (test for deep clone = true) // // Testing approach - Retrieve the fourth child of the second employee and // invoke its cloneNode(deep) method with deep = true. The // duplicate node returned by the method should copy any // text data contained in this node. // // Semantic Requirements: 53 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0085NO() { var computedValue = ""; var expectedValue = "35,000"; var testNode = ""; var clonedNode = ""; results = new testResults("Core0085NO"); results.description = "The cloneNode(deep) method does not copy any text "+ "unless it is deep cloned(deep = true)."; // // Retrieve the targeted data and invoke its cloneNode method. // testNode = new nodeObject(SECOND,FOURTH); clonedNode = testNode.node.cloneNode(true); // // Retrieve the text data inside the cloned node. // computedValue = clonedNode.lastChild.nodeValue; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0085NO -------------------------- // //------------------------- test case core-0086NO ----------------------------- // // Testing feature - If the cloneNode(deep) method was used to clone an Element // node, all the attributes of the Element are copied (and // their values). // // Testing approach - Retrieve the last child of the second employee and // invoke its cloneNode(deep) method with deep = true. The // duplicate node returned by the method should copy the // attributes associated with this node. // // Semantic Requirements: 54 // // Last modification date - March 25, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0086NO() { var testName = "core-0086NO"; var computedValue = ""; var expectedValue = ""; var testNode = ""; var clonedNode = ""; results = new testResults("Core0086NO"); results.description = "If the cloneNode(deep) method was used to clone an "+ "Element node then all the attributes associated "+ "associated with this node are copied too."; // // Retrieve the targeted data and invoke its cloneNode method. // testNode = new nodeObject(SECOND,SIXTH); clonedNode = testNode.node.cloneNode(true); // // Retreive cloned node and its attributes. // computedValue += clonedNode.attributes(0).nodeName+" "; computedValue += clonedNode.attributes(1).nodeName; // // Determine order of NamedNodeMap items. // if (computedValue.charAt(0) == "d" && computedValue.charAt(1) == "o") expectedValue = "domestic street"; else expectedValue = "street domestic"; // // Write out results. // results.expected = expectedValue; results.actual = computedValue; return results; } //------------------------ End test case core-0086NO -------------------------- // //------------------------- test case core-0087NO ----------------------------- // // Testing feature - The "nodeValue" attribute of a node raises a // NO_MODIFICATION_ALLOWED_ERR DOM exception // if the node is readonly. // // Testing approach - Retrieve the Text node inside the Entity node named // "ent1" and attempt to change its nodeValue attribute. // Since the descendants of Entity nodes are readonly, the // desired exception should be raised. // // Semantic Requirements: 55 // // Last modification date - March 29, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0087NO() { var computedValue = ""; var testNode = ""; var entityDesc = ""; var expectedValue = NO_MODIFICATION_ALLOWED_ERR; results = new testResults("Core0087NO"); results.description = "The \"nodeValue\" attribute of a node raises a "+ "NO_MODIFICATION_ALLOWED_ERR DOMException if the "+ "node is readonly."; // // Retrieve the targeted data. // testNode = getEntity("ent1"); entityDesc = testNode.firstChild; // // attempt to set a value on a readonly node should raise an exception. // try { entityDesc.nodeValue = "ABCD"; } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0087NO ------------------------- // //------------------------- test case core-0088NO ----------------------------- // // Testing feature - The "insertBefore" method of a node raises a // NO_MODIFICATION_ALLOWED_ERR DOMException if // the node is readonly. // // Testing approach - Retrieve the first EntityReference inside the second // employee and invoke the insertBefore(newChild,refChild) // method on its first descendant. Descendants of // EntityReference nodes are readonly and therefore the // desired exception should be raised. This test also // makes use of the "createElement" method from the // Document interface. // // Semantic Requirements: 56 // // Last modification date - April 6, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0088NO() { var computedValue = ""; var testNode = ""; var entityRefNode = ""; var refChild = ""; var newChild = createNode(ELEMENT_NODE,"newChild"); var expectedValue = NO_MODIFICATION_ALLOWED_ERR; results = new testResults("Core0088NO"); results.description = "The \"insertBefore()\" method of a node raises "+ "a NO_MODIFICATION_ALLOWED_ERR DOMException "+ "if this node is readonly."; // // Retrieve targeted data and define reference child. // testNode = new nodeObject(SECOND,SIXTH); entityRefNode = testNode.node.firstChild; refChild = entityRefNode.firstChild; // // Attempt to insert a node to an EntityReference descendant should raise // an exception. // try { entityRefNode.insertBefore(newChild,refChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0088NO ------------------------- // //------------------------- test case core-0089NO ---------------------------- // // Testing feature - The "replaceChild" method of a node raises a // NO_MODIFICATION_ALLOWED_ERR DOMException if the // node is readonly. // // Testing approach - Retrieve the first EntityReference inside the second // employee and invoke the replaceChild(newChild,oldChild) // method where oldChild is one of the EntityReference // descendants. Descendants of EntityReference nodes are // readonly and therefore the desired exception should be // raised. This test also makes use of the "createElement" // method from the Document interface. // // Semantic Requirements: 57 // // Last modification date - April 6, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0089NO() { var computedValue = ""; var testNode = ""; var entityRefNode = ""; var oldChild = ""; var newChild = createNode(ELEMENT_NODE,"newChild"); var expectedValue = NO_MODIFICATION_ALLOWED_ERR; results = new testResults("Core0089NO"); results.description = "The \"replaceChild(newChild, oldChild)\" method "+ "of a node raises a
NO_MODIFICATION_ALLOWED_ERR "+ " DOMexception if this node is readonly."; // // Retrieve targeted data and define oldChild. // testNode = new nodeObject(SECOND,SIXTH); entityRefNode = testNode.node.firstChild; oldChild = entityRefNode.firstChild; // // Attempt to replace a descendant of an EntityReference should raise an // exception. // try { entityRefNode.replaceChild(newChild,oldChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0089NO ------------------------- // //------------------------- test case core-0090NO ---------------------------- // // Testing feature - The "removeChild" method of a node raises a // NO_MODIFICATION_ALLOWED_ERR DOMException if the // node is readonly. // // Testing approach - Retrieve the first EntityReference inside the second // employee and invoke its removeChild(oldChild) method // where oldChild is one of the EntityReference descendants. // Descendants of EntityReference nodes are readonly and // therefore the desired exception should be raised. // // Semantic Requirements: 58 // // Last modification date - April 6, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0090NO() { var computedValue = ""; var entityRefNode = ""; var testNode = ""; var oldChild = ""; var expectedValue = NO_MODIFICATION_ALLOWED_ERR; results = new testResults("Core0090NO"); results.description = "The \"removeChild(oldChild)\" method of a node "+ "raises NO_MODIFICATION_ALLOWED_ERR DOMEXception "+ "if this node is readonly."; // // Retreive targeted data and define oldChild. // testNode = new nodeObject(SECOND,SIXTH); entityRefNode = testNode.node.firstChild; oldChild = entityRefNode.firstChild; // // Attempt to remove a descendant of an EntityReference node should // raise an exception. // try { entityRefNode.removeChild(oldChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0090NO ------------------------- // //------------------------- test case core-0091NO ---------------------------- // // Testing feature - The "appendChild" method of a node raises a // NO_MODIFICATION_ALLOWED_ERR DOMException if // the node is readonly. // // Testing approach - Retrieve the first EntityReference inside the second // employee and invoke its append(newChild) method. // Descendants of EntityReference nodes are readonly and // therefore attempts to append nodes to such podes // should raise the desired exception. This test // also makes use of the "createElement" method from // the Document interface. // // Semantic Requirements: 59 // // Last modification date - April 6, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0091NO() { var computedValue = ""; var entityRefNode = ""; var testNode = ""; var newChild = createNode(ELEMENT_NODE,"newChild"); var expectedValue = NO_MODIFICATION_ALLOWED_ERR; results = new testResults("Core0091NO"); results.description = "The \"appendChild(newChild)\" method of a node "+ "raises NO_MODIFICATION_ALLOWED_ERR DOMException "+ "if this node is readonly."; // // Retrieve targeted data. // testNode = new nodeObject(SECOND,SIXTH); entityRefNode = testNode.node.firstChild; // // Attempt to append nodes to descendants of EntityReference nodes should // raise an exception. // try { entityRefNode.appendChild(newChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0091NO ------------------------- // //------------------------- test case core-0092NO ----------------------------- // // Testing feature - The "insertBefore()" method of a node raises // a HIERARCHY_REQUEST_ERR DOMException if this node // is of a type that does not allow children of the // type of "newChild" to be inserted. // // Testing Approach - Retrieve the root node and attempt to insert a newly // created Attr node. An Element node can not have // children of the "Attr" type, therefore the desired // exception should be raised. // // Semantic Requirements: 60 // // Last modification date - April 7, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0092NO() { var computedValue = ""; var rootNode = ""; var newChild = createNode(ATTRIBUTE_NODE,"newAttribute"); var refChild = ""; var expectedValue = HIERARCHY_REQUEST_ERR; results = new testResults("Core0092NO"); results.description = "The \"insertBefore()\" method of a node raises "+ "a HIERARCHY_REQUEST_ERR DOMException if this node "+ "does not allow nodes of type of \"newChild\" to be "+ "inserted."; // // Retrieve targeted data. // rootNode = getRootNode(); refChild = new nodeObject(SECOND); // // Attempt to insert an invalid child should raise an exception. // try { rootNode.insertBefore(newChild,refChild.node); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0092NO ------------------------- // //------------------------- test case core-0093NO ---------------------------- // // Testing feature - The "insertBefore()" method of a node raises // a HIERARCHY_REQUEST_ERR DOMException if the node // to be inserted is one of this node's ancestors. // // Testing Approach - Retrieve the second employee and attempt to insert // a node that is one of its ancestors (root node). // An attempt to insert such a node should raise the // desired exception. // // Semantic Requirements: 61 // // Last modification date - March 29, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0093NO() { var computedValue = ""; var newChild = ""; var refChild = ""; var secondEmployee = ""; var expectedValue = HIERARCHY_REQUEST_ERR; results = new testResults("Core0093NO"); results.description = "The \"insertBefore()\" method of a node raises "+ "an HIERARCHY_REQUEST_ERR DOMException if the node "+ "to be inserted is one of this node's ancestors."; // // Retrieve targeted data and define reference and new childs. // newChild = getRootNode(); testNode = new nodeObject(SECOND); refChild = testNode.subNodes(FIRST); // // Attempt to insert a node that is one of this node ancestors should // raise an exception. // try { testNode.node.insertBefore(newChild,refChild.node); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0093NO ------------------------- // //------------------------- test case core-0094NO ----------------------------- // // Testing feature - The "replaceChild" method of a node raises a // HIERARCHY_REQUEST_ERR DOMException if this node // is of a type that does not allow children of the // type of "newChild" to be inserted. // // Testing Approach - Retrieve the root node and attempt to replace one of // its children with a newly created Attr node. An // Element node can not have children of the "Attr" // type, therefore the desired exception should be raised. // // Semantic Requirements: 62 // // Last modification date - April 6, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0094NO() { var computedValue = ""; var rootNode = ""; var newChild = createNode(ATTRIBUTE_NODE,"newAttribute"); var oldChild = ""; var expectedValue = HIERARCHY_REQUEST_ERR; results = new testResults("Core0094NO"); results.description = "The \"replaceChild()\" method of a node raises "+ "a HIERARCHY_REQUEST_ERR DOMException if this node "+ "does not allow nodes of type of \"newChild\"."; // // Retrieve targeted data and define oldChild. // rootNode = getRootNode(); oldChild = new nodeObject(SECOND); // // Attempt to replace a child with an invalid child should raise an exception. // try { rootNode.replaceChild(newChild,oldChild.node); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0094NO ------------------------- // //------------------------- test case core-0095NO ---------------------------- // // Testing feature - The "replaceChild()" method of a node raises // a HIERARCHY_REQUEST_ERR DOMException if the node // to be inserted is one of this node's ancestors. // // Testing Approach - Retrieve the second employee and attempt to replace one // of its children with an ancestor node (root node). // An attempt to make such a replacement should raise the // desired exception. // // Semantic Requirements: 63 // // Last modification date - March 29, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0095NO() { var computedValue = ""; var newChild = ""; var oldChild = ""; var testNode = ""; var expectedValue = HIERARCHY_REQUEST_ERR; results = new testResults("Core0095NO"); results.description = "The \"replaceChild()\" method of a node raises "+ "a HIERARCHY_REQUEST_ERR DOMException if the node "+ "to be put is one of this node's ancestors."; // // Retrieve targeted data and define new and old childs. // newChild = getRootNode(); testNode = new nodeObject(SECOND); oldChild = testNode.subNodes(FIRST); // // Attempt to replace a child with an ancestor should raise an exception. // try { testNode.node.replaceChild(newChild,oldChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0095NO ------------------------- // //------------------------- test case core-0096NO ---------------------------- // // Testing feature - The "appendChild" method of a node raises a // HIERARCHY_REQUEST_ERR DOMException if this node // is of a type that does not allow children of the // type of "newChild". // // Testing Approach - Retrieve the root node and attempt to append a // newly created Attr node to it. An Element // node can not have children of the "Attr" type, // therefore the desired exception should be raised. // // Semantic Requirements: 64 // // Last modification date - April 6, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0096NO() { var computedValue = ""; var rootNode = ""; var newChild = createNode(ATTRIBUTE_NODE,"newAttribute"); var expectedValue = HIERARCHY_REQUEST_ERR; results = new testResults("Core0096NO"); results.description = "The \"appendChild()\" method of a node raises "+ "a HIERARCHY_REQUEST_ERR DOMException if this node "+ "does not allow nodes of type of \"newChild\"."; // // Retrieve the targeted data. // rootNode = getRootNode(); // // Attempt to append an invalid child should raise an exception. // try { rootNode.appendChild(newChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0096NO ------------------------- // //------------------------- test case core-0097NO ---------------------------- // // Testing feature - The "appendChild" method of a node raises // an HIERARCHY_REQUEST_ERR DOMException if the node // to be appended is one of this node's ancestors. // // Testing Approach - Retrieve the second employee and attempt to append to // it an ancestor node (root node). An attempt to make // such an insertion should raise the desired exception. // // Semantic Requirements: 65 // // Last modification date - March 29, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0097NO() { var computedValue = ""; var newChild = ""; var testNode = ""; var expectedValue = HIERARCHY_REQUEST_ERR; results = new testResults("Core0097NO"); results.description = "The \"appendChild()\" method of a node raises "+ "a HIERARCHY_REQUEST_ERR DOMException if the node "+ "to append is one of this node's ancestors."; // // Retrieve the targeted data and define the new child. // newChild = getRootNode(); testNode = new nodeObject(SECOND); // // Attempt to replace a child with an ancestor should raise an exception. // try { testNode.node.appendChild(newChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0097NO ------------------------- // //------------------------- test case core-0098NO ---------------------------- // // Testing feature - The "insertBefore" method of a node raises a // NOT_FOUND_ERR DOMException if the reference child is not // child of this node. // // Testing Approach - Retrieve the second employee and attempt to insert // a new node before a reference node that is not // a child of this node. An attempt to insert before a // non child node should raise the desired exception. // // Semantic Requirements: 66 // // Last modification date - March 29, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0098NO() { var computedValue = ""; var newChild = createNode(ELEMENT_NODE,"newChild"); var refChild = createNode(ELEMENT_NODE,"refChild"); var testNode = ""; var expectedValue = NOT_FOUND_ERR; results = new testResults("Core0098NO"); results.description = "The \"insertBefore\" method of a node raises "+ "a NOT_FOUND_ERR DOMException if the reference "+ "child is not a child of this node."; // // Retrieve targeted data. // testNode = new nodeObject(SECOND); // // Attempt to insert before a reference child that is not a child of // this node should raise an exception. // try { testNode.node.insertBefore(newChild,refChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0098NO ----------------------- // //------------------------- test case core-0099NO -------------------------- // // Testing feature - The "replaceChild" method of a node raises a // NOT_FOUND_ERR DOMException if the old child is not // child of this node. // // Testing Approach - Retrieve the second employee and attempt to replace // a node that is not one of its children. An attempt // to replace such a node should raise the desired // exception. // // Semantic Requirements: 67 // // Last modification date - March 29, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0099NO() { var computedValue = ""; var newChild = createNode(ELEMENT_NODE,"newChild"); var oldChild = createNode(ELEMENT_NODE,"oldChild"); var testNode = ""; var expectedValue = NOT_FOUND_ERR; results = new testResults("Core0099NO"); results.description = "The \"replaceChild\" method of a node raises "+ "a NOT_FOUND_ERR DOMException if the old child "+ "is not a child of this node."; // // Retrieve the targeted data.. // testNode = new nodeObject(SECOND); // // Attempt to replace a non child node should raise an exception. // try { testNode.node.replaceChild(newChild,oldChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0099NO ----------------------- // //------------------------- test case core-0100NO -------------------------- // // Testing feature - The "removeChild" method of a node raises a // NOT_FOUND_ERR DOMException if the old child is not // child of this node. // // Testing Approach - Retrieve the second employee and attempt to remove // a node that is not one of its children. An attempt // to remove such a node should raise the desired // exception. // // Semantic Requirements: 68 // // Last modification date - March 30, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0100NO() { var computedValue = ""; var oldChild = createNode(ELEMENT_NODE,"oldChild"); var testNode = ""; var expectedValue = NOT_FOUND_ERR; results = new testResults("Core0100NO"); results.description = "The \"removeChild\" method of a node raises "+ "a NOT_FOUND_ERR DOMException if the old "+ "child is not a child of this node."; // // Retrieve targeted data. // testNode = new nodeObject(SECOND); // // Attempt to remove a non child node should raise an exception. // try { testNode.node.removeChild(oldChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0100NO ----------------------- // //------------------------- test case core-0101NO ---------------------------- // // Testing feature - The "insertBefore" method of a node raises a // WRONG_DOCUMENT_ERR DOMException if the new child was // created from a different document than the one that // created this node. // // Testing Approach - Retrieve the second employee and attempt to insert // a new child that was created from a different // document than the one that created the second employee. // An attempt to insert such a child should raise // the desired exception. // // Semantic Requirements: 69 // // Last modification date - March 30, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0101NO() { var computedValue = ""; var newChild = getOtherDOMDocument().createElement("newChild"); var refChild = ""; var testNode = ""; var expectedValue = WRONG_DOCUMENT_ERR; results = new testResults("Core0101NO"); results.description = "The \"insertBefore\" method of a node raises "+ "a WRONG_DOCUMENT_ERR DOMException if the new "+ "child was created from a document different "+ "from the one that created this node."; // // Retrieve targeted data and define reference child. // testNode = new nodeObject(SECOND); refChild = testNode.subNodes(FOURTH); // // Attempt to insert a child from a different document should raise an // exception. // try { testNode.node.insertBefore(newChild,refChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0101NO ----------------------- // //------------------------- test case core-0102NO -------------------------- // // Testing feature - The "replaceChild" method of a node raises a // WRONG_DOCUMENT_ERR DOMException if the new child was // created from a different document than the one that // created this node. // // Testing Approach - Retrieve the second employee and attempt to // replace one of its children with a node created // from a different document. An attempt to make such // replacement should raise the desired exception. // // Semantic Requirements: 70 // // Last modification date - March 30, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0102NO() { var computedValue = ""; var newChild = getOtherDOMDocument().createElement("newChild"); var oldChild = ""; var testNode = ""; var expectedValue = WRONG_DOCUMENT_ERR; results = new testResults("Core0102NO"); results.description = "The \"replaceChild\" method of a node raises "+ "a WRONG_DOCUMENT_ERR DOMException if the new "+ "child was created from a document different "; "from the one that created this node."; // // Retrieve targeted data and define oldChild. // testNode = new nodeObject(SECOND); oldChild = testNode.subNodes(FIRST); // // Attempt to replace a child with a child from a different document // should raise an exception. // try { testNode.node.replaceChild(newChild,oldChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0102NO ----------------------- // //------------------------- test case core-0103NO -------------------------- // // Testing feature - The "appendChild" method of a node raises a // WRONG_DOCUMENT_ERR DOMException if the new child was // created from a different document than the one that // created this node. // // Testing Approach - Retrieve the second employee and attempt to append // to it a node that was created from different // document. An attempt to make such an insertion // should raise the desired exception. // // Semantic Requirements: 71 // // Last modification date - March 30, 1999 // // Written by: Carmelo Montanez //---------------------------------------------------------------------------- function core0103NO() { var computedValue = ""; var newChild = getOtherDOMDocument().createElement("newChild"); var testNode = ""; var expectedValue = WRONG_DOCUMENT_ERR; results = new testResults("Core0103NO"); results.description = "The \"appendChild\" method of a node raises a "+ "a WRONG_DOCUMENT_ERR DOMException if the new "+ "child was created from a document different "+ "from the one that created this node."; // // Retrieve the targeted data. // testNode = new nodeObject(SECOND); // // Attempt to append a child from a different document should raise an // exception. // try { testNode.node.appendChild(newChild); } catch(DOMException) { computedValue = DOMException.code; } results.expected = expectedValue; results.actual = computedValue; resetData(); return results; } //------------------------ End test case core-0103NO -----------------------