1 19 20 package org.netbeans.modules.tasklist.core; 21 22 import java.beans.PropertyChangeListener ; 23 import java.beans.PropertyChangeEvent ; 24 import java.util.ArrayList ; 25 import java.util.List ; 26 import junit.framework.TestCase; 27 28 32 public class TaskTest extends TestCase { 33 34 public TaskTest(String testName) { 35 super(testName); 36 } 37 38 41 public void testClear() { 42 System.out.println("testClear"); 43 44 46 } 47 48 51 public void testGetLevel() { 52 System.out.println("testGetLevel"); 53 54 56 } 57 58 61 public void testSetSummary() { 62 System.out.println("testSetSummary"); 63 64 66 } 67 68 71 public void testSetDetails() { 72 System.out.println("testSetDetails"); 73 74 76 } 77 78 81 public void testSetPriority() { 82 System.out.println("testSetPriority"); 83 84 86 } 87 88 91 public void testIsVisitable() { 92 System.out.println("testIsVisitable"); 93 94 96 } 97 98 101 public void testSetVisitable() { 102 System.out.println("testSetVisitable"); 103 104 106 } 107 108 111 public void testGetDisplayName() { 112 System.out.println("testGetDisplayName"); 113 114 116 } 117 118 121 public void testRecursivePropertyChange() { 122 System.out.println("testRecursivePropertyChange"); 123 124 126 } 127 128 131 public void testGetSubtasks() { 132 System.out.println("testGetSubtasks"); 133 134 136 } 137 138 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 () { 178 public void propertyChange(PropertyChangeEvent 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 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 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 () { 232 public void propertyChange(PropertyChangeEvent evt) { 233 System.out.println("PCE" + evt.getPropertyName() + " " + evt.getNewValue()); 234 } 235 }); 236 237 List l = new ArrayList (); 238 l.add(c1); 239 l.add(c2); 240 task.addSubtasks(l, true, null); 241 242 assertTrue(tlCallbacks[0]); 243 244 } 245 246 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 l = new ArrayList (); 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 () { 292 public void propertyChange(PropertyChangeEvent 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 307 public void testHasSubtasks() { 308 System.out.println("testHasSubtasks"); 309 310 312 } 313 314 317 public void testGetParent() { 318 System.out.println("testGetParent"); 319 320 322 } 323 324 327 public void testIsParentOf() { 328 System.out.println("testIsParentOf"); 329 330 332 } 333 334 337 public void testSetParent() { 338 System.out.println("testSetParent"); 339 340 342 } 343 344 347 public void testIsZombie() { 348 System.out.println("testIsZombie"); 349 350 352 } 353 354 357 public void testGenerate() { 358 System.out.println("testGenerate"); 359 360 362 } 363 364 367 public void testParse() { 368 System.out.println("testParse"); 369 370 372 } 373 374 377 public void testSetSilentUpdate() { 378 System.out.println("testSetSilentUpdate"); 379 380 382 } 383 384 387 public void testSetList() { 388 System.out.println("testSetList"); 389 390 } 393 394 397 public void testGetList() { 398 System.out.println("testGetList"); 399 400 402 } 403 404 407 public void testGetSubtaskCountRecursively() { 408 System.out.println("testGetSubtaskCountRecursively"); 409 410 412 } 413 414 417 public void testCreateNode() { 418 System.out.println("testCreateNode"); 419 420 422 } 423 424 427 public void testClone() { 428 System.out.println("testClone"); 429 430 432 } 433 434 437 public void testCloneTask() { 438 System.out.println("testCloneTask"); 439 440 442 } 443 444 447 public void testGetKey() { 448 System.out.println("testGetKey"); 449 450 452 } 453 454 457 public void testGetSeed() { 458 System.out.println("testGetSeed"); 459 460 462 } 463 464 467 public void testCopyFrom() { 468 System.out.println("testCopyFrom"); 469 470 472 } 473 474 } 475 | Popular Tags |