DTest.h
上传用户:huihehuasu
上传日期:2007-01-10
资源大小:6948k
文件大小:9k
源码类别:

xml/soap/webservice

开发平台:

C/C++

  1. /*
  2.  * The Apache Software License, Version 1.1
  3.  * 
  4.  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
  5.  * reserved.
  6.  * 
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer. 
  13.  * 
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in
  16.  *    the documentation and/or other materials provided with the
  17.  *    distribution.
  18.  * 
  19.  * 3. The end-user documentation included with the redistribution,
  20.  *    if any, must include the following acknowledgment:  
  21.  *       "This product includes software developed by the
  22.  *        Apache Software Foundation (http://www.apache.org/)."
  23.  *    Alternately, this acknowledgment may appear in the software itself,
  24.  *    if and wherever such third-party acknowledgments normally appear.
  25.  * 
  26.  * 4. The names "Xerces" and "Apache Software Foundation" must
  27.  *    not be used to endorse or promote products derived from this
  28.  *    software without prior written permission. For written 
  29.  *    permission, please contact apache@apache.org.
  30.  * 
  31.  * 5. Products derived from this software may not be called "Apache",
  32.  *    nor may "Apache" appear in their name, without prior written
  33.  *    permission of the Apache Software Foundation.
  34.  * 
  35.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  36.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  37.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  41.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  42.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  43.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  46.  * SUCH DAMAGE.
  47.  * ====================================================================
  48.  * 
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Software Foundation, and was
  51.  * originally based on software copyright (c) 1999, International
  52.  * Business Machines, Inc., http://www.ibm.com .  For more information
  53.  * on the Apache Software Foundation, please see
  54.  * <http://www.apache.org/>.
  55.  */
  56. /*
  57.  * $Log: DTest.h,v $
  58.  * Revision 1.3  2000/03/02 19:55:45  roddey
  59.  * This checkin includes many changes done while waiting for the
  60.  * 1.1.0 code to be finished. I can't list them all here, but a list is
  61.  * available elsewhere.
  62.  *
  63.  * Revision 1.2  2000/02/06 07:48:36  rahulj
  64.  * Year 2K copyright swat.
  65.  *
  66.  * Revision 1.1.1.1  1999/11/09 01:02:38  twl
  67.  * Initial checkin
  68.  *
  69.  * Revision 1.2  1999/11/08 20:42:24  rahul
  70.  * Swat for adding in Product name and CVS comment log variable.
  71.  *
  72.  */
  73. /**
  74.  * This class tests methods for XML DOM implementation
  75.  * 
  76.  * DOMException errors are tested by calls to DOMExceptionsTest from: Main, docBuilder...
  77.  *
  78.  */
  79. #include <dom/DOM.hpp>
  80. #include <dom/DomMemDebug.hpp>
  81. //  define null for compatibility with original Java source code.
  82. #define null 0
  83. class DTest {
  84. public:
  85. static DOM_Element  testElementNode;
  86. static DOM_Attr  testAttributeNode;
  87. static DOM_Text  testTextNode;
  88. static DOM_CDATASection  testCDATASectionNode;
  89. static DOM_EntityReference  testEntityReferenceNode;
  90. static DOM_Entity  testEntityNode;
  91. static DOM_ProcessingInstruction testProcessingInstructionNode;
  92. static DOM_Comment  testCommentNode;
  93. static DOM_Document  testDocumentNode;
  94. static DOM_DocumentType  testDocumentTypeNode;
  95. static DOM_DocumentFragment  testDocumentFragmentNode;
  96. static DOM_Notation  testNotationNode;
  97.     
  98. DTest();
  99. /**
  100.  * version 3.0 01/25/99
  101.  *  
  102.  * @return DOM_Document
  103.  *
  104.  */
  105. DOM_Document createDocument();
  106. /**
  107.  * version 3.0 01/25/99
  108.  * 
  109.  * @return DOM_DocumentType
  110.  * @param name DOMString
  111.  *
  112.  */
  113. DOM_DocumentType createDocumentType(DOM_Document doc, DOMString name);
  114. /**
  115.  * version 3.0 01/25/99
  116.  *  
  117.  * @return org.w3c.dom.DOM_Entity
  118.  * @param doc org.w3c.dom.DOM_Document
  119.  * @param name DOMString
  120.  *
  121.  */
  122. DOM_Entity createEntity(DOM_Document doc, DOMString name);
  123. /**
  124.  * version 3.0 01/25/99
  125.  * 
  126.  * @return org.w3c.dom.DOM_Notation
  127.  * @param doc org.w3c.dom.DOM_Document
  128.  * @param name DOMString
  129.  *
  130.  */
  131. DOM_Notation createNotation(DOM_Document doc, DOMString name);
  132. /**
  133.  * This method builds test documents for the XML DOM implementation
  134.  * version 2.0 10/12/98
  135.  * @param document org.w3c.dom.DOM_Document
  136.  * @param name document's name
  137.  * @param type document's type
  138.  *
  139.  */
  140. void docBuilder(DOM_Document document, DOMString name);
  141. /**
  142.  * version 3.0 01/25/99
  143.  * 
  144.  * @return boolean
  145.  * @param node java.lang.Object
  146.  * @param mNameIndex int
  147.  * @param signatureIndex int
  148.  * @param parameters java.lang.Object[]
  149.  * @param code short
  150.  *
  151.  */
  152. //static bool DOMExceptionsTest(Object node, DOMString methodName, Class[] methodSignature, Object[] parameters, short code) {
  153. /**
  154.  * @param document org.w3c.dom.DOM_Document
  155.  */
  156. void findTestNodes(DOM_Document document);
  157. /**
  158.  * @param document org.w3c.dom.DOM_Document
  159.  */
  160. void findTestNodes(DOM_Node node);
  161. /**
  162.  * This method tests DOM_Attr methods for the XML DOM implementation
  163.  * version 2.0 10/12/98
  164.  * @param document org.w3c.dom.DOM_Document
  165.  *
  166.  */
  167. void testAttr(DOM_Document document);
  168. /**
  169.  * This method tests DOM_CDATASection methods for the XML DOM implementation
  170.  * version 2.0 10/12/98
  171.  * @param document org.w3c.dom.DOM_Document
  172.  *
  173.  */
  174. void testCDATASection(DOM_Document document);
  175. /**
  176.  * This method tests CharacterData methods for the XML DOM implementation
  177.  * version 2.0 10/12/98
  178.  * @param document org.w3c.dom.DOM_Document
  179.  *
  180.  */
  181. void testCharacterData(DOM_Document document);
  182. /**
  183.  * This method tests ChildNodeList methods for the XML DOM implementation
  184.  * version 2.0 10/12/98
  185.  * @param document org.w3c.dom.DOM_Document
  186.  *
  187.  */
  188. void testChildNodeList(DOM_Document document);
  189. /**
  190.  * This method tests DOM_Comment methods for the XML DOM implementation
  191.  * version 1.0 10/12/98
  192.  * @param document org.w3c.dom.DOM_Document
  193.  *
  194.  */
  195. void testComment(DOM_Document document);
  196. /**
  197.  * This method tests DeepNodeList methods for the XML DOM implementation
  198.  * version 2.0 10/12/98
  199.  * @param document org.w3c.dom.DOM_Document
  200.  *
  201.  */
  202. void testDeepNodeList(DOM_Document document);
  203. /**
  204.  * This method tests DOM_Document methods for the XML DOM implementation
  205.  * version 2.0 10/12/98
  206.  * @param document org.w3c.dom.DOM_Document
  207.  *
  208.  *
  209.  **** ALL DOM_Document create methods are run in docBuilder except createAttribute which is in testAttribute**
  210.  */
  211. void testDocument(DOM_Document document);
  212. /**
  213.  * This method tests DOM_DocumentFragment methods for the XML DOM implementation
  214.  * version 2.0 10/12/98
  215.  * @param document org.w3c.dom.DOM_Document
  216.  *
  217.  *
  218.  *
  219.  ********This really isn't needed, only exists to throw NO_MODIFICATION_ALLOWED_ERR ********
  220.  */
  221. void testDocumentFragment(DOM_Document document);
  222. /**
  223.  * This method tests DOM_DocumentType methods for the XML DOM implementation
  224.  * version 2.0 10/12/98
  225.  * @param document org.w3c.dom.DOM_Document
  226.  *
  227.  */
  228. void testDocumentType(DOM_Document document);
  229. /**
  230.  * @param document org.w3c.dom.DOM_Document
  231.  */
  232. void testDOMerrors(DOM_Document document);
  233. /**
  234.  * This method tests DOMImplementation methods for the XML DOM implementation
  235.  * version 2.0 10/12/98
  236.  * @param document org.w3c.dom.DOM_Document
  237.  *
  238.  */
  239. void testDOMImplementation(DOM_Document document);
  240. /**
  241.  * This method tests DOM_Element methods for the XML DOM implementation
  242.  * version 2.0 10/12/98
  243.  * @param document org.w3c.dom.DOM_Document
  244.  *
  245.  */
  246. void testElement(DOM_Document document);
  247. /**
  248.  * This method tests DOM_Entity methods for the XML DOM implementation
  249.  * version 2.0 10/12/98
  250.  * @param document org.w3c.dom.DOM_Document
  251.  *
  252.  */
  253. void testEntity(DOM_Document document);
  254. /**
  255.  * This method tests DOM_EntityReference methods for the XML DOM implementation
  256.  * version 2.0 10/12/98
  257.  * @param document org.w3c.dom.DOM_Document
  258.  *
  259.  */
  260. void testEntityReference(DOM_Document document);
  261. /**
  262.  * This method tests DOM_Node methods for the XML DOM implementation
  263.  * version 2.0 10/12/98
  264.  * @param document org.w3c.dom.DOM_Document
  265.  *
  266.  *
  267.  *
  268.  ********* This is only for a test of cloneNode "deep"*******
  269.  ********* And for error tests*********
  270.  */
  271. void testNode(DOM_Document document);
  272. /**
  273.  * This method tests DOM_Notation methods for the XML DOM implementation
  274.  * version 2.0 10/12/98
  275.  * @param document org.w3c.dom.DOM_Document
  276.  *
  277.  */
  278. void testNotation(DOM_Document document);
  279. /**
  280.  * This method tests DOM_ProcessingInstruction methods for the XML DOM implementation
  281.  * version 2.0 10/12/98
  282.  * @param document org.w3c.dom.DOM_Document
  283.  *
  284.  */
  285. void testPI(DOM_Document document);
  286. /**
  287.  * This method tests DOM_Text methods for the XML DOM implementation
  288.  * version 2.0 10/12/98
  289.  * @param document org.w3c.dom.DOM_Document
  290.  *
  291.  */
  292. void testText(DOM_Document document);
  293. /**
  294.  * 
  295.  * @param node org.w3c.dom.DOM_Node
  296.  * @param node2 org.w3c.dom.DOM_Node
  297.  *
  298.  */
  299. bool treeCompare(DOM_Node node, DOM_Node node2);
  300. };