Пример #1
0
    /*
     * Runs the test case.
     */
    void runTest()
    {
        Document doc;
        NodeList elementList;
        Node nameNode;
        CharacterData child;
        String childData;
        doc = (Document) baseT::load("staff", false);
        elementList = doc.getElementsByTagName(SA::construct_from_utf8("name"));
        nameNode = elementList.item(0);
        child = (CharacterData) nameNode.getFirstChild();
        childData = child.getData();
        baseT::assertEquals("Margaret Martin", childData, __LINE__, __FILE__);

    }
  /*
   * Runs the test case.
   */
  void runTest()
  {
     Document doc;
     NodeList elementList;
     Node nameNode;
     CharacterData child;
     String childData;
     doc = (Document) baseT::load("hc_staff", true);
     elementList = doc.getElementsByTagName(SA::construct_from_utf8("acronym"));
     nameNode = elementList.item(0);
     child = (CharacterData) nameNode.getFirstChild();
     child.deleteData(0, 16);
     childData = child.getData();
     baseT::assertEquals("Dallas, Texas 98551", childData, __LINE__, __FILE__);
 
  }
  /*
   * Runs the test case.
   */
  void runTest()
  {
     Document doc;
     NodeList elementList;
     Node nameNode;
     CharacterData child;
     String childData;
     doc = (Document) baseT::load("staff", true);
     elementList = doc.getElementsByTagName(SA::construct_from_utf8("address"));
     nameNode = elementList.item(0);
     child = (CharacterData) nameNode.getFirstChild();
     child.replaceData(30, 5, SA::construct_from_utf8("98665"));
     childData = child.getData();
     baseT::assertEquals("1230 North Ave. Dallas, Texas 98665", childData, __LINE__, __FILE__);
 
  }
  /*
   * Runs the test case.
   */
  void runTest()
  {
     Document doc;
     NodeList elementList;
     Node nameNode;
     CharacterData child;
     String childValue;
     int childLength;
     doc = (Document) baseT::load("staff", false);
     elementList = doc.getElementsByTagName(SA::construct_from_utf8("name"));
     nameNode = elementList.item(0);
     child = (CharacterData) nameNode.getFirstChild();
     childValue = child.getData();
     childLength = SA::length(childValue);
     baseT::assertEquals(15, childLength, __LINE__, __FILE__);
 
  }