KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > core > TaskTest


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.tasklist.core;
21
22 import java.beans.PropertyChangeListener JavaDoc;
23 import java.beans.PropertyChangeEvent JavaDoc;
24 import java.util.ArrayList JavaDoc;
25 import java.util.List JavaDoc;
26 import junit.framework.TestCase;
27
28 /**
29  *
30  * @author Petr Kuzel
31  */

32 public class TaskTest extends TestCase {
33
34     public TaskTest(String JavaDoc testName) {
35         super(testName);
36     }
37
38     /**
39      * Test of clear method, of class org.netbeans.modules.tasklist.core.Task.
40      */

41     public void testClear() {
42         System.out.println("testClear");
43
44         // TODO add your test code below by replacing the default call to fail.
45

46     }
47     
48     /**
49      * Test of getLevel method, of class org.netbeans.modules.tasklist.core.Task.
50      */

51     public void testGetLevel() {
52         System.out.println("testGetLevel");
53         
54         // TODO add your test code below by replacing the default call to fail.
55

56     }
57     
58     /**
59      * Test of setSummary method, of class org.netbeans.modules.tasklist.core.Task.
60      */

61     public void testSetSummary() {
62         System.out.println("testSetSummary");
63         
64         // TODO add your test code below by replacing the default call to fail.
65

66     }
67     
68     /**
69      * Test of setDetails method, of class org.netbeans.modules.tasklist.core.Task.
70      */

71     public void testSetDetails() {
72         System.out.println("testSetDetails");
73         
74         // TODO add your test code below by replacing the default call to fail.
75

76     }
77     
78     /**
79      * Test of setPriority method, of class org.netbeans.modules.tasklist.core.Task.
80      */

81     public void testSetPriority() {
82         System.out.println("testSetPriority");
83         
84         // TODO add your test code below by replacing the default call to fail.
85

86     }
87     
88     /**
89      * Test of isVisitable method, of class org.netbeans.modules.tasklist.core.Task.
90      */

91     public void testIsVisitable() {
92         System.out.println("testIsVisitable");
93         
94         // TODO add your test code below by replacing the default call to fail.
95

96     }
97     
98     /**
99      * Test of setVisitable method, of class org.netbeans.modules.tasklist.core.Task.
100      */

101     public void testSetVisitable() {
102         System.out.println("testSetVisitable");
103         
104         // TODO add your test code below by replacing the default call to fail.
105

106     }
107
108     /**
109      * Test of getDisplayName method, of class org.netbeans.modules.tasklist.core.Task.
110      */

111     public void testGetDisplayName() {
112         System.out.println("testGetDisplayName");
113         
114         // TODO add your test code below by replacing the default call to fail.
115

116     }
117     
118     /**
119      * Test of recursivePropertyChange method, of class org.netbeans.modules.tasklist.core.Task.
120      */

121     public void testRecursivePropertyChange() {
122         System.out.println("testRecursivePropertyChange");
123         
124         // TODO add your test code below by replacing the default call to fail.
125

126     }
127     
128     /**
129      * Test of getSubtasks method, of class org.netbeans.modules.tasklist.core.Task.
130      */

131     public void testGetSubtasks() {
132         System.out.println("testGetSubtasks");
133         
134         // TODO add your test code below by replacing the default call to fail.
135

136     }
137     
138     /**
139      * Test of addSubtask method, of class org.netbeans.modules.tasklist.core.Task.
140      */

141     public void testAddSubtask() {
142         System.out.println("testAddSubtask");
143
144         Task task = new Task("Root", null);
145         final Task c1 = new Task("Child 1", null);
146         final Task c2 = new Task("Child 2", null);
147
148         ObservableList list = new TaskList();
149
150         final boolean tlCallbacks[] = new boolean[2];
151         
152         list.addTaskListener(new TaskListener() {
153             public void selectedTask(Task t) {
154                 System.out.println("selectedTask:" + t);
155             }
156
157             public void warpedTask(Task t) {
158                 System.out.println("warpedTask:" + t);
159             }
160
161             public void addedTask(Task t) {
162                 System.out.println("addedTask:" + t);
163                 if (t == c1) tlCallbacks[0] = true;
164                 if (t == c2) tlCallbacks[1] = true;
165             }
166
167             public void removedTask(Task pt, Task t, int index) {
168                 System.out.println("removedTask:" + t);
169             }
170
171             public void structureChanged(Task t) {
172                 System.out.println("structureChangedTask:" + t);
173                 fail("Unexpected event");
174             }
175         });
176
177         task.addPropertyChangeListener(new PropertyChangeListener JavaDoc() {
178             public void propertyChange(PropertyChangeEvent JavaDoc evt) {
179                 System.out.println("PCE" + evt.getPropertyName() + " " + evt.getNewValue());
180             }
181         });
182
183         task.addSubtask(c1);
184         task.addSubtask(c2);
185         
186         assertTrue(tlCallbacks[0]);
187         assertTrue(tlCallbacks[1]);
188         
189     }
190     
191     /**
192      * Test of addSubtasks method, of class org.netbeans.modules.tasklist.core.Task.
193      * Test fired events.
194      */

195     public void testAddSubtasks() {
196         System.out.println("testAddSubtasks");
197         
198         Task task = new Task("Root", null);
199         final Task c1 = new Task("Child 1", null);
200         final Task c2 = new Task("Child 2", null);
201
202         ObservableList list = new TaskList();
203 // task = list.getRoot();
204
final Task root = task;
205
206         final boolean tlCallbacks[] = new boolean[2];
207         list.addTaskListener(new TaskListener() {
208             public void selectedTask(Task t) {
209                 System.out.println("selectedTask:" + t);
210             }
211
212             public void warpedTask(Task t) {
213                 System.out.println("warpedTask:" + t);
214             }
215
216             public void addedTask(Task t) {
217                 System.out.println("addedTask:" + t);
218                 fail("Unexpected event");
219             }
220
221             public void removedTask(Task pt, Task t, int index) {
222                 System.out.println("removedTask:" + t);
223             }
224
225             public void structureChanged(Task t) {
226                 System.out.println("structureChangedTask:" + t);
227                 if (t == root) tlCallbacks[0] = true;
228             }
229         });
230
231         task.addPropertyChangeListener(new PropertyChangeListener JavaDoc() {
232             public void propertyChange(PropertyChangeEvent JavaDoc evt) {
233                 System.out.println("PCE" + evt.getPropertyName() + " " + evt.getNewValue());
234             }
235         });
236
237         List JavaDoc l = new ArrayList JavaDoc();
238         l.add(c1);
239         l.add(c2);
240         task.addSubtasks(l, true, null);
241         
242         assertTrue(tlCallbacks[0]);
243         
244     }
245     
246     /**
247      * Test of removeSubtask method, of class org.netbeans.modules.tasklist.core.Task.
248      * Test fired events.
249      */

250     public void testRemoveSubtask() {
251         System.out.println("testRemoveSubtask");
252         
253         Task task = new Task("Root", null);
254         final Task c1 = new Task("Child 1", null);
255         final Task c2 = new Task("Child 2", null);
256
257         ObservableList list = new TaskList();
258         task.getRoot();
259
260         List JavaDoc l = new ArrayList JavaDoc();
261         l.add(c1);
262         l.add(c2);
263         task.addSubtasks(l, true, null);
264
265         final boolean tlCallbacks[] = new boolean[2];
266         list.addTaskListener(new TaskListener() {
267             public void selectedTask(Task t) {
268                 System.out.println("selectedTask:" + t);
269             }
270
271             public void warpedTask(Task t) {
272                 System.out.println("warpedTask:" + t);
273             }
274
275             public void addedTask(Task t) {
276                 System.out.println("addedTask:" + t);
277             }
278
279             public void removedTask(Task pt, Task t, int index) {
280                 System.out.println("removedTask:" + t);
281                 if (c1 == t) tlCallbacks[0] = true;
282                 if (c2 == t) tlCallbacks[1] = true;
283             }
284
285             public void structureChanged(Task t) {
286                 System.out.println("structureChangedTask:" + t);
287                 fail("Unexpected event");
288             }
289         });
290
291         task.addPropertyChangeListener(new PropertyChangeListener JavaDoc() {
292             public void propertyChange(PropertyChangeEvent JavaDoc evt) {
293                 System.out.println("PCE" + evt.getPropertyName() + " " + evt.getNewValue());
294             }
295         });
296
297         task.removeSubtask(c1);
298         task.removeSubtask(c2);
299         
300         assertTrue(tlCallbacks[0]);
301         assertTrue(tlCallbacks[1]);
302     }
303     
304     /**
305      * Test of hasSubtasks method, of class org.netbeans.modules.tasklist.core.Task.
306      */

307     public void testHasSubtasks() {
308         System.out.println("testHasSubtasks");
309         
310         // TODO add your test code below by replacing the default call to fail.
311

312     }
313     
314     /**
315      * Test of getParent method, of class org.netbeans.modules.tasklist.core.Task.
316      */

317     public void testGetParent() {
318         System.out.println("testGetParent");
319         
320         // TODO add your test code below by replacing the default call to fail.
321

322     }
323     
324     /**
325      * Test of isParentOf method, of class org.netbeans.modules.tasklist.core.Task.
326      */

327     public void testIsParentOf() {
328         System.out.println("testIsParentOf");
329         
330         // TODO add your test code below by replacing the default call to fail.
331

332     }
333     
334     /**
335      * Test of setParent method, of class org.netbeans.modules.tasklist.core.Task.
336      */

337     public void testSetParent() {
338         System.out.println("testSetParent");
339         
340         // TODO add your test code below by replacing the default call to fail.
341

342     }
343     
344     /**
345      * Test of isZombie method, of class org.netbeans.modules.tasklist.core.Task.
346      */

347     public void testIsZombie() {
348         System.out.println("testIsZombie");
349         
350         // TODO add your test code below by replacing the default call to fail.
351

352     }
353     
354     /**
355      * Test of generate method, of class org.netbeans.modules.tasklist.core.Task.
356      */

357     public void testGenerate() {
358         System.out.println("testGenerate");
359         
360         // TODO add your test code below by replacing the default call to fail.
361

362     }
363     
364     /**
365      * Test of parse method, of class org.netbeans.modules.tasklist.core.Task.
366      */

367     public void testParse() {
368         System.out.println("testParse");
369         
370         // TODO add your test code below by replacing the default call to fail.
371

372     }
373     
374     /**
375      * Test of setSilentUpdate method, of class org.netbeans.modules.tasklist.core.Task.
376      */

377     public void testSetSilentUpdate() {
378         System.out.println("testSetSilentUpdate");
379         
380         // TODO add your test code below by replacing the default call to fail.
381

382     }
383     
384     /**
385      * Test of setList method, of class org.netbeans.modules.tasklist.core.Task.
386      */

387     public void testSetList() {
388         System.out.println("testSetList");
389         
390         // TODO add your test code below by replacing the default call to fail.
391
// test that is was propagated recursivelly
392
}
393     
394     /**
395      * Test of getList method, of class org.netbeans.modules.tasklist.core.Task.
396      */

397     public void testGetList() {
398         System.out.println("testGetList");
399         
400         // TODO add your test code below by replacing the default call to fail.
401

402     }
403     
404     /**
405      * Test of getSubtaskCountRecursively method, of class org.netbeans.modules.tasklist.core.Task.
406      */

407     public void testGetSubtaskCountRecursively() {
408         System.out.println("testGetSubtaskCountRecursively");
409         
410         // TODO add your test code below by replacing the default call to fail.
411

412     }
413     
414     /**
415      * Test of createNode method, of class org.netbeans.modules.tasklist.core.Task.
416      */

417     public void testCreateNode() {
418         System.out.println("testCreateNode");
419         
420         // TODO add your test code below by replacing the default call to fail.
421

422     }
423     
424     /**
425      * Test of clone method, of class org.netbeans.modules.tasklist.core.Task.
426      */

427     public void testClone() {
428         System.out.println("testClone");
429         
430         // TODO add your test code below by replacing the default call to fail.
431

432     }
433     
434     /**
435      * Test of cloneTask method, of class org.netbeans.modules.tasklist.core.Task.
436      */

437     public void testCloneTask() {
438         System.out.println("testCloneTask");
439         
440         // TODO add your test code below by replacing the default call to fail.
441

442     }
443     
444     /**
445      * Test of getKey method, of class org.netbeans.modules.tasklist.core.Task.
446      */

447     public void testGetKey() {
448         System.out.println("testGetKey");
449         
450         // TODO add your test code below by replacing the default call to fail.
451

452     }
453     
454     /**
455      * Test of getSeed method, of class org.netbeans.modules.tasklist.core.Task.
456      */

457     public void testGetSeed() {
458         System.out.println("testGetSeed");
459         
460         // TODO add your test code below by replacing the default call to fail.
461

462     }
463     
464     /**
465      * Test of copyFrom method, of class org.netbeans.modules.tasklist.core.Task.
466      */

467     public void testCopyFrom() {
468         System.out.println("testCopyFrom");
469         
470         // TODO add your test code below by replacing the default call to fail.
471

472     }
473     
474 }
475
Popular Tags