001: /*
002: * ====================================================================
003: * JAFFA - Java Application Framework For All
004: *
005: * Copyright (C) 2002 JAFFA Development Group
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: * Redistribution and use of this software and associated documentation ("Software"),
022: * with or without modification, are permitted provided that the following conditions are met:
023: * 1. Redistributions of source code must retain copyright statements and notices.
024: * Redistributions must also contain a copy of this document.
025: * 2. Redistributions in binary form must reproduce the above copyright notice,
026: * this list of conditions and the following disclaimer in the documentation
027: * and/or other materials provided with the distribution.
028: * 3. The name "JAFFA" must not be used to endorse or promote products derived from
029: * this Software without prior written permission. For written permission,
030: * please contact mail to: jaffagroup@yahoo.com.
031: * 4. Products derived from this Software may not be called "JAFFA" nor may "JAFFA"
032: * appear in their names without prior written permission.
033: * 5. Due credit should be given to the JAFFA Project (http://jaffa.sourceforge.net).
034: *
035: * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
036: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
037: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
038: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
039: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
040: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
041: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
042: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
043: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
044: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
045: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
046: * SUCH DAMAGE.
047: * ====================================================================
048: */
049:
050: package org.jaffa.util;
051:
052: import org.apache.log4j.*;
053: import java.io.*;
054: import java.util.*;
055: import junit.framework.*;
056:
057: public class NodeTest extends TestCase {
058: // constants
059: private static final String ROOT = "Root";
060: private static final String N1 = "N1", N11 = "N11";
061: private static final String N2 = "N2", N21 = "N21", N22 = "N22";
062: private static final String N3 = "N3", N31 = "N31", N32 = "N32",
063: N33 = "N33";
064: private static final String N4 = "N4", N41 = "N41", N42 = "N42",
065: N43 = "N43", N44 = "N44";
066: private static final String N5 = "N5", N51 = "N51", N511 = "N511",
067: N5111 = "N5111", N51111 = "N51111", N51112 = "N51112";
068:
069: // fixtures
070: private Node f_node = null;
071:
072: private Node f_node1 = null;
073: private Node f_node11 = null;
074:
075: private Node f_node2 = null;
076: private Node f_node21 = null;
077: private Node f_node22 = null;
078:
079: private Node f_node3 = null;
080: private Node f_node31 = null;
081: private Node f_node32 = null;
082: private Node f_node33 = null;
083:
084: private Node f_node4 = null;
085: private Node f_node41 = null;
086: private Node f_node42 = null;
087: private Node f_node43 = null;
088: private Node f_node44 = null;
089:
090: private Node f_node5 = null;
091: private Node f_node51 = null;
092: private Node f_node511 = null;
093: private Node f_node5111 = null;
094: private Node f_node51111 = null;
095: private Node f_node51112 = null;
096:
097: public NodeTest(java.lang.String testName) {
098: super (testName);
099: }
100:
101: public static void main(java.lang.String[] args) {
102: junit.textui.TestRunner.run(suite());
103: }
104:
105: public static Test suite() {
106: TestSuite suite = new TestSuite(NodeTest.class);
107:
108: return suite;
109: }
110:
111: public void setUp() {
112: f_node1 = new Node(N1);
113: f_node11 = new Node(N11);
114: f_node1.addChild(f_node11);
115:
116: f_node2 = new Node(N2);
117: f_node21 = new Node(N21);
118: f_node22 = new Node(N22);
119: f_node2.addChild(f_node21);
120: f_node2.addChild(f_node22);
121:
122: f_node3 = new Node(N3);
123: f_node31 = new Node(N31);
124: f_node32 = new Node(N32);
125: f_node33 = new Node(N33);
126: f_node3.addChild(f_node31);
127: f_node3.addChild(f_node32);
128: f_node3.addChild(f_node33);
129:
130: f_node4 = new Node(N4);
131: f_node41 = new Node(N41);
132: f_node42 = new Node(N42);
133: f_node43 = new Node(N43);
134: f_node44 = new Node(N44);
135: f_node4.addChild(f_node41);
136: f_node4.addChild(f_node42);
137: f_node4.addChild(f_node43);
138: f_node4.addChild(f_node44);
139:
140: f_node5 = new Node(N5);
141: f_node51 = new Node(N51);
142: f_node511 = new Node(N511);
143: f_node5111 = new Node(N5111);
144: f_node51111 = new Node(N51111);
145: f_node51112 = new Node(N51112);
146: f_node5.addChild(f_node51);
147: f_node51.addChild(f_node511);
148: f_node511.addChild(f_node5111);
149: f_node5111.addChild(f_node51111);
150: f_node5111.addChild(f_node51112);
151:
152: f_node = new Node(ROOT);
153: f_node.addChild(f_node1);
154: f_node.addChild(f_node2);
155: f_node.addChild(f_node3);
156: f_node.addChild(f_node4);
157: f_node.addChild(f_node5);
158: }
159:
160: public void tearDown() {
161: f_node = null;
162:
163: f_node1 = null;
164: f_node11 = null;
165:
166: f_node2 = null;
167: f_node21 = null;
168: f_node22 = null;
169:
170: f_node3 = null;
171: f_node31 = null;
172: f_node32 = null;
173: f_node33 = null;
174:
175: f_node4 = null;
176: f_node41 = null;
177: f_node42 = null;
178: f_node43 = null;
179: f_node44 = null;
180:
181: f_node5 = null;
182: f_node51 = null;
183: f_node511 = null;
184: f_node5111 = null;
185: f_node51111 = null;
186: f_node51112 = null;
187: }
188:
189: /** Test of getId method, of class org.jaffa.util.Node. */
190: public void testGetId() {
191: System.out.println("testGetId");
192:
193: // Add your test code below by replacing the default call to fail.
194: fail("The test case is empty.");
195: }
196:
197: /** Test of getParent method, of class org.jaffa.util.Node. */
198: public void testGetParent() {
199: System.out.println("testGetParent");
200:
201: // Add your test code below by replacing the default call to fail.
202: fail("The test case is empty.");
203: }
204:
205: /** Test of getRoot method, of class org.jaffa.util.Node. */
206: public void testGetRoot() {
207: System.out.println("testGetRoot");
208:
209: // Add your test code below by replacing the default call to fail.
210: fail("The test case is empty.");
211: }
212:
213: /** Test of getChildren method, of class org.jaffa.util.Node. */
214: public void testGetChildren() {
215: System.out.println("testGetChildren");
216:
217: // Add your test code below by replacing the default call to fail.
218: fail("The test case is empty.");
219: }
220:
221: /** Test of getChild method, of class org.jaffa.util.Node. */
222: public void testGetChild() {
223: System.out.println("testGetChild");
224:
225: // Add your test code below by replacing the default call to fail.
226: fail("The test case is empty.");
227: }
228:
229: /** Test of getFromFamilyById method, of class org.jaffa.util.Node. */
230: public void testGetFromFamilyById() {
231: System.out.println("testGetFromFamilyById");
232:
233: // Add your test code below by replacing the default call to fail.
234: fail("The test case is empty.");
235: }
236:
237: /** Test of getName method, of class org.jaffa.util.Node. */
238: public void testGetName() {
239: System.out.println("testGetName");
240:
241: // Add your test code below by replacing the default call to fail.
242: fail("The test case is empty.");
243: }
244:
245: /** Test of setName method, of class org.jaffa.util.Node. */
246: public void testSetName() {
247: System.out.println("testSetName");
248:
249: // Add your test code below by replacing the default call to fail.
250: fail("The test case is empty.");
251: }
252:
253: /** Test of getValue method, of class org.jaffa.util.Node. */
254: public void testGetValue() {
255: System.out.println("testGetValue");
256:
257: // Add your test code below by replacing the default call to fail.
258: fail("The test case is empty.");
259: }
260:
261: /** Test of setValue method, of class org.jaffa.util.Node. */
262: public void testSetValue() {
263: System.out.println("testSetValue");
264:
265: // Add your test code below by replacing the default call to fail.
266: fail("The test case is empty.");
267: }
268:
269: /** Test of getAttributes method, of class org.jaffa.util.Node. */
270: public void testGetAttributes() {
271: System.out.println("testGetAttributes");
272:
273: // Add your test code below by replacing the default call to fail.
274: fail("The test case is empty.");
275: }
276:
277: /** Test of setAttributes method, of class org.jaffa.util.Node. */
278: public void testSetAttributes() {
279: System.out.println("testSetAttributes");
280:
281: // Add your test code below by replacing the default call to fail.
282: fail("The test case is empty.");
283: }
284:
285: /** Test of getAttribute method, of class org.jaffa.util.Node. */
286: public void testGetAttribute() {
287: System.out.println("testGetAttribute");
288:
289: // Add your test code below by replacing the default call to fail.
290: fail("The test case is empty.");
291: }
292:
293: /** Test of setAttribute method, of class org.jaffa.util.Node. */
294: public void testSetAttribute() {
295: System.out.println("testSetAttribute");
296:
297: // Add your test code below by replacing the default call to fail.
298: fail("The test case is empty.");
299: }
300:
301: /** Test of removeAttribute method, of class org.jaffa.util.Node. */
302: public void testRemoveAttribute() {
303: System.out.println("testRemoveAttribute");
304:
305: // Add your test code below by replacing the default call to fail.
306: fail("The test case is empty.");
307: }
308:
309: /** Test of isRoot method, of class org.jaffa.util.Node. */
310: public void testIsRoot() {
311: System.out.println("testIsRoot");
312:
313: // Add your test code below by replacing the default call to fail.
314: fail("The test case is empty.");
315: }
316:
317: /** Test of hasChildren method, of class org.jaffa.util.Node. */
318: public void testHasChildren() {
319: System.out.println("testHasChildren");
320:
321: // Add your test code below by replacing the default call to fail.
322: fail("The test case is empty.");
323: }
324:
325: /** Test of makeRoot method, of class org.jaffa.util.Node. */
326: public void testMakeRoot() {
327: System.out.println("testMakeRoot");
328:
329: // Add your test code below by replacing the default call to fail.
330: fail("The test case is empty.");
331: }
332:
333: /** Test of addChild method, of class org.jaffa.util.Node. */
334: public void testAddChild() {
335: System.out.println("testAddChild");
336:
337: // Add your test code below by replacing the default call to fail.
338: fail("The test case is empty.");
339: }
340:
341: /** Test of removeChild method, of class org.jaffa.util.Node. */
342: public void testRemoveChild() {
343: System.out.println("testRemoveChild");
344:
345: // Add your test code below by replacing the default call to fail.
346: fail("The test case is empty.");
347: }
348:
349: /** Test of removeChildren method, of class org.jaffa.util.Node. */
350: public void testRemoveChildren() {
351: System.out.println("testRemoveChildren");
352:
353: // Add your test code below by replacing the default call to fail.
354: fail("The test case is empty.");
355: }
356:
357: /** Test of printNode method, of class org.jaffa.util.Node. */
358: public void testPrintNode() {
359: System.out.println("testPrintNode");
360:
361: // Add your test code below by replacing the default call to fail.
362: fail("The test case is empty.");
363: }
364:
365: }
|