KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xmldb > xupdate > unittests > XUpdateTests


1 package org.xmldb.xupdate.unittests;
2
3 /*
4  * The XML:DB Initiative Software License, Version 1.0
5  *
6  *
7  * Copyright (c) 2000-2003 The XML:DB Initiative. All rights
8  * reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  *
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in
19  * the documentation and/or other materials provided with the
20  * distribution.
21  *
22  * 3. The end-user documentation included with the redistribution,
23  * if any, must include the following acknowledgment:
24  * "This product includes software developed by the
25  * XML:DB Initiative (http://www.xmldb.org/)."
26  * Alternately, this acknowledgment may appear in the software itself,
27  * if and wherever such third-party acknowledgments normally appear.
28  *
29  * 4. The name "XML:DB Initiative" must not be used to endorse or
30  * promote products derived from this software without prior written
31  * permission. For written permission, please contact info@xmldb.org.
32  *
33  * 5. Products derived from this software may not be called "XML:DB",
34  * nor may "XML:DB" appear in their name, without prior written
35  * permission of the XML:DB Initiative.
36  *
37  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
41  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48  * SUCH DAMAGE.
49  * ====================================================================
50  *
51  * This software consists of voluntary contributions made by many
52  * individuals on behalf of the XML:DB Initiative. For more information
53  * on the XML:DB Initiative, please see <http://www.xmldb.org/>.
54  */

55
56 /**
57  *
58  * These unittests test the basic functionality of XUpdate.
59  * The list is not complete yet.
60  *
61  */

62 public class XUpdateTests extends LexusTestCase {
63
64   public XUpdateTests(String JavaDoc name) {
65     super(name);
66   }
67
68   /**
69    * Remove tests.
70    *
71    * - Deletion of element nodes
72    * - Deletion of attribute nodes
73    * - Deletion of text nodes should be added
74    * - Deletion of CDATA sections should be added
75    * - Deletion of processing instructions should be added
76    * - Deletion of comments should be added
77    */

78   public void testRemove() throws Exception JavaDoc {
79     mainTest("testRemove");
80   }
81
82   public void testRemoveAttribute() throws Exception JavaDoc {
83     mainTest("testRemoveAttribute");
84   }
85
86   public void testRemoveText() throws Exception JavaDoc {
87     mainTest("testRemoveText");
88   }
89
90   /**
91    * Insert tests.
92    *
93    * - Insertion of element nodes before element
94    * - Insertion of element nodes after element
95    *
96    * - Insertion of element nodes with a namespace before element should be added
97    * - Insertion of element nodes with a namespace after element
98    *
99    * - Insertion of text nodes before element should be added
100    * - Insertion of text nodes after element
101    *
102    * - Insertion of attribute nodes before element
103    * - Insertion of attribute nodes after element
104    *
105    * - Insertion of attribute nodes with a namespace before element should be added
106    * - Insertion of attribute nodes with a namespace after element should be added
107    */

108   public void testInsertBefore() throws Exception JavaDoc {
109     mainTest("testInsertBefore");
110   }
111
112   public void testInsertAfter() throws Exception JavaDoc {
113     mainTest("testInsertAfter");
114   }
115
116   public void testInsertAfterNS() throws Exception JavaDoc {
117     mainTest("testInsertAfterNS");
118   }
119
120   public void testTextInsertAfter() throws Exception JavaDoc {
121     mainTest("testTextInsertAfter");
122   }
123
124   public void testInsertBeforeAttribute() throws Exception JavaDoc {
125     mainTest("testInsertBeforeAttribute");
126   }
127
128   public void testInsertAfterAttribute() throws Exception JavaDoc {
129     mainTest("testInsertAfterAttribute");
130   }
131
132   /**
133    * Rename tests.
134    *
135    * - Changing name element nodes
136    * - Changing name attribute nodes
137
138    * - Changing name element nodes with a namespace should be added
139    * - Changing name attribute nodes with a namespace should be added
140    */

141   public void testRename() throws Exception JavaDoc {
142     mainTest("testRename");
143   }
144
145   public void testRenameAttribute() throws Exception JavaDoc {
146     mainTest("testRenameAttribute");
147   }
148
149   /**
150    * Update tests.
151    *
152    * - Updating element nodes
153    * - Updating attribute nodes
154    * - Updating CDATA-sections should be added
155    * - Updating processing instructions should be added
156    *
157    * - Updating element nodes with a namespace should be added
158    * - Updating attribute nodes with a namespace should be added
159    */

160   public void testUpdate() throws Exception JavaDoc {
161     mainTest("testUpdate");
162   }
163
164   public void testUpdateAttribute() throws Exception JavaDoc {
165     mainTest("testUpdateAttribute");
166   }
167
168   /**
169    * Append tests.
170    *
171    * - Appending element nodes should be added
172    * - Appending text nodes should be added
173    * - Appending attribute nodes
174    * - Appending CDATA sections
175    * - Appending processing instructions should be added
176    *
177    * - Appending element nodes with a namespace should be added
178    * - Appending attribute nodes with a namespace should be added
179    */

180   public void testAppendNS() throws Exception JavaDoc {
181     mainTest("testAppendNS");
182   }
183
184   public void testAppendAttribute() throws Exception JavaDoc {
185     mainTest("testAppendAttribute");
186   }
187
188   public void testAppendCDATA() throws Exception JavaDoc {
189     mainTest("testAppendCDATA");
190   }
191
192   /**
193    * Variable tests.
194    *
195    */

196   public void testVariable() throws Exception JavaDoc {
197     mainTest("testVariable");
198   }
199
200   public void testValueOf() throws Exception JavaDoc {
201     mainTest("testValueOf");
202   }
203
204   /**
205    * test input file with namespace declaration.
206    * Does XPath correctly select nodes?
207    *
208    */

209   public void testInputWithNameSpaces() throws Exception JavaDoc {
210     mainTest("testInputWithNameSpaces");
211   }
212
213   /**
214    * Kimbro staken use-cases.
215    *
216    * http://www.xmldatabases.org/projects/XUpdate-UseCases/
217    *
218    */

219   public void testUseCases() throws Exception JavaDoc {
220     mainTest("use-cases_Insert_Element_Before");
221     mainTest("use-cases_Insert_Element_After");
222     mainTest("use-cases_Append_Element");
223     mainTest("use-cases_Insert_Attribute");
224     /*
225     nodematcher doesn't consider two text-nodes as one
226     */

227     //mainTest("use-cases_Insert_Text_Content");
228
mainTest("use-cases_Insert_XML_Block");
229     /*
230     Same problem as with inserting attributes,
231     inserting the empty text-nodes before document-element causes problems
232     */

233     //mainTest("use-cases_Insert_Processing_Instruction");
234
}
235 }
236
Popular Tags