[927] | 1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany |
---|
| 2 | // |
---|
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 4 | // you may not use this file except in compliance with the License. |
---|
| 5 | // You may obtain a copy of the License at |
---|
| 6 | // |
---|
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 8 | // |
---|
| 9 | // Unless required by applicable law or agreed to in writing, software |
---|
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 12 | // See the License for the specific language governing permissions and |
---|
| 13 | // limitations under the License. |
---|
| 14 | |
---|
[922] | 15 | package de.ugoe.cs.autoquest.tasktrees.treeimpl; |
---|
[445] | 16 | |
---|
[1146] | 17 | import static org.junit.Assert.*; |
---|
[445] | 18 | |
---|
| 19 | import java.util.HashMap; |
---|
[1146] | 20 | import java.util.LinkedList; |
---|
| 21 | import java.util.List; |
---|
[445] | 22 | import java.util.Map; |
---|
| 23 | |
---|
| 24 | import org.junit.Test; |
---|
| 25 | |
---|
[1294] | 26 | import de.ugoe.cs.autoquest.eventcore.Event; |
---|
[1146] | 27 | import de.ugoe.cs.autoquest.eventcore.IEventTarget; |
---|
| 28 | import de.ugoe.cs.autoquest.eventcore.IEventType; |
---|
[922] | 29 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask; |
---|
[1294] | 30 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; |
---|
[922] | 31 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration; |
---|
[1294] | 32 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IIterationInstance; |
---|
[1146] | 33 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional; |
---|
[1294] | 34 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptionalInstance; |
---|
[922] | 35 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection; |
---|
[1294] | 36 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance; |
---|
[922] | 37 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence; |
---|
[1294] | 38 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequenceInstance; |
---|
[1146] | 39 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; |
---|
| 40 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance; |
---|
| 41 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskModel; |
---|
| 42 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskBuilder; |
---|
| 43 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; |
---|
| 44 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInfo; |
---|
| 45 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession; |
---|
| 46 | import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskInfo; |
---|
| 47 | import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskBuilder; |
---|
| 48 | import de.ugoe.cs.autoquest.tasktrees.treeimpl.TaskFactory; |
---|
[922] | 49 | import de.ugoe.cs.autoquest.test.DummyGUIElement; |
---|
| 50 | import de.ugoe.cs.autoquest.test.DummyInteraction; |
---|
[445] | 51 | |
---|
| 52 | /** |
---|
[1294] | 53 | * |
---|
[445] | 54 | */ |
---|
[1146] | 55 | public class TaskModelTest { |
---|
[445] | 56 | |
---|
[557] | 57 | /** */ |
---|
[1411] | 58 | private static final int MAX_TREE_DEPTH = 10; |
---|
[557] | 59 | |
---|
| 60 | /** */ |
---|
[1146] | 61 | private ITaskBuilder taskBuilder = new TaskBuilder(); |
---|
[557] | 62 | |
---|
| 63 | /** */ |
---|
[1146] | 64 | private ITaskFactory taskFactory = new TaskFactory(); |
---|
[557] | 65 | |
---|
| 66 | /** |
---|
[1146] | 67 | * |
---|
[557] | 68 | */ |
---|
| 69 | @Test |
---|
[1146] | 70 | public void test_EventTask_01() throws Exception { |
---|
| 71 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 72 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 73 | |
---|
[1294] | 74 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 75 | |
---|
| 76 | assertNotNull(task); |
---|
| 77 | assertNotNull(task.getId()); |
---|
| 78 | assertTrue(task.equals(task)); |
---|
| 79 | |
---|
[1294] | 80 | IEventTaskInstance instance = (IEventTaskInstance) task.getInstances().iterator().next(); |
---|
| 81 | assertEquals(eventType, instance.getEvent().getType()); |
---|
| 82 | assertEquals(eventTarget, instance.getEvent().getTarget()); |
---|
[1146] | 83 | } |
---|
| 84 | |
---|
| 85 | /** |
---|
| 86 | * |
---|
| 87 | */ |
---|
| 88 | @Test |
---|
| 89 | public void test_EventTask_02() throws Exception { |
---|
| 90 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 91 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 92 | |
---|
[1294] | 93 | IEventTask task1 = createNewEventTask(eventType, eventTarget); |
---|
| 94 | IEventTask task2 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 95 | |
---|
| 96 | // the tasks will not be equal as they should have a different id |
---|
| 97 | assertFalse(task1.equals(task2)); |
---|
| 98 | } |
---|
| 99 | |
---|
| 100 | /** |
---|
| 101 | * |
---|
| 102 | */ |
---|
| 103 | @Test |
---|
| 104 | public void test_EventTask_03() throws Exception { |
---|
| 105 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 106 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 107 | |
---|
[1294] | 108 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
| 109 | ITaskInstance taskInstance1 = createNewTaskInstance(task); |
---|
| 110 | ITaskInstance taskInstance2 = createNewTaskInstance(task); |
---|
[1146] | 111 | |
---|
| 112 | assertFalse(taskInstance1.equals(taskInstance2)); |
---|
| 113 | } |
---|
| 114 | |
---|
| 115 | /** |
---|
| 116 | * |
---|
| 117 | */ |
---|
| 118 | @Test |
---|
| 119 | public void test_Sequence_01() throws Exception { |
---|
| 120 | ISequence task = taskFactory.createNewSequence(); |
---|
| 121 | |
---|
| 122 | assertNotNull(task); |
---|
| 123 | assertNotNull(task.getId()); |
---|
| 124 | assertNotNull(task.getChildren()); |
---|
| 125 | assertEquals(0, task.getChildren().size()); |
---|
| 126 | assertTrue(task.equals(task)); |
---|
| 127 | } |
---|
| 128 | |
---|
| 129 | /** |
---|
| 130 | * |
---|
| 131 | */ |
---|
| 132 | @Test |
---|
| 133 | public void test_Sequence_02() throws Exception { |
---|
| 134 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 135 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 136 | |
---|
[1294] | 137 | IEventTask child = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 138 | |
---|
| 139 | ISequence task = taskFactory.createNewSequence(); |
---|
| 140 | |
---|
| 141 | taskBuilder.addChild(task, child); |
---|
| 142 | |
---|
| 143 | assertNotNull(task.getChildren()); |
---|
| 144 | assertEquals(1, task.getChildren().size()); |
---|
| 145 | assertEquals(child, task.getChildren().get(0)); |
---|
| 146 | } |
---|
| 147 | |
---|
| 148 | /** |
---|
| 149 | * |
---|
| 150 | */ |
---|
| 151 | @Test |
---|
| 152 | public void test_Sequence_03() throws Exception { |
---|
| 153 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 154 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 155 | |
---|
[1294] | 156 | IEventTask child1 = createNewEventTask(eventType, eventTarget); |
---|
| 157 | IEventTask child2 = createNewEventTask(eventType, eventTarget); |
---|
| 158 | IEventTask child3 = createNewEventTask(eventType, eventTarget); |
---|
| 159 | IEventTask child4 = createNewEventTask(eventType, eventTarget); |
---|
| 160 | IEventTask child5 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 161 | |
---|
| 162 | ISequence task = taskFactory.createNewSequence(); |
---|
| 163 | |
---|
| 164 | taskBuilder.addChild(task, child1); |
---|
| 165 | taskBuilder.addChild(task, child2); |
---|
| 166 | taskBuilder.addChild(task, child3); |
---|
| 167 | taskBuilder.addChild(task, child4); |
---|
| 168 | taskBuilder.addChild(task, child5); |
---|
| 169 | |
---|
| 170 | assertNotNull(task.getChildren()); |
---|
| 171 | assertEquals(5, task.getChildren().size()); |
---|
| 172 | assertEquals(child1, task.getChildren().get(0)); |
---|
| 173 | assertEquals(child2, task.getChildren().get(1)); |
---|
| 174 | assertEquals(child3, task.getChildren().get(2)); |
---|
| 175 | assertEquals(child4, task.getChildren().get(3)); |
---|
| 176 | assertEquals(child5, task.getChildren().get(4)); |
---|
| 177 | } |
---|
| 178 | |
---|
| 179 | /** |
---|
| 180 | * |
---|
| 181 | */ |
---|
| 182 | @Test |
---|
| 183 | public void test_Selection_01() throws Exception { |
---|
| 184 | ISelection task = taskFactory.createNewSelection(); |
---|
| 185 | |
---|
| 186 | assertNotNull(task); |
---|
| 187 | assertNotNull(task.getId()); |
---|
| 188 | assertNotNull(task.getChildren()); |
---|
| 189 | assertEquals(0, task.getChildren().size()); |
---|
| 190 | assertTrue(task.equals(task)); |
---|
| 191 | } |
---|
| 192 | |
---|
| 193 | /** |
---|
| 194 | * |
---|
| 195 | */ |
---|
| 196 | @Test |
---|
| 197 | public void test_Selection_02() throws Exception { |
---|
| 198 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 199 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 200 | |
---|
[1294] | 201 | IEventTask child = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 202 | |
---|
| 203 | ISelection task = taskFactory.createNewSelection(); |
---|
| 204 | |
---|
| 205 | taskBuilder.addChild(task, child); |
---|
| 206 | |
---|
| 207 | assertNotNull(task.getChildren()); |
---|
| 208 | assertEquals(1, task.getChildren().size()); |
---|
| 209 | assertEquals(child, task.getChildren().get(0)); |
---|
| 210 | } |
---|
| 211 | |
---|
| 212 | /** |
---|
| 213 | * |
---|
| 214 | */ |
---|
| 215 | @Test |
---|
| 216 | public void test_Selection_03() throws Exception { |
---|
| 217 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 218 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 219 | |
---|
[1294] | 220 | IEventTask child1 = createNewEventTask(eventType, eventTarget); |
---|
| 221 | IEventTask child2 = createNewEventTask(eventType, eventTarget); |
---|
| 222 | IEventTask child3 = createNewEventTask(eventType, eventTarget); |
---|
| 223 | IEventTask child4 = createNewEventTask(eventType, eventTarget); |
---|
| 224 | IEventTask child5 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 225 | |
---|
| 226 | ISelection task = taskFactory.createNewSelection(); |
---|
| 227 | |
---|
| 228 | taskBuilder.addChild(task, child1); |
---|
| 229 | taskBuilder.addChild(task, child2); |
---|
| 230 | taskBuilder.addChild(task, child3); |
---|
| 231 | taskBuilder.addChild(task, child4); |
---|
| 232 | taskBuilder.addChild(task, child5); |
---|
| 233 | |
---|
| 234 | assertNotNull(task.getChildren()); |
---|
| 235 | assertEquals(5, task.getChildren().size()); |
---|
| 236 | assertEquals(child1, task.getChildren().get(0)); |
---|
| 237 | assertEquals(child2, task.getChildren().get(1)); |
---|
| 238 | assertEquals(child3, task.getChildren().get(2)); |
---|
| 239 | assertEquals(child4, task.getChildren().get(3)); |
---|
| 240 | assertEquals(child5, task.getChildren().get(4)); |
---|
| 241 | } |
---|
| 242 | |
---|
| 243 | /** |
---|
| 244 | * |
---|
| 245 | */ |
---|
| 246 | @Test |
---|
| 247 | public void test_Iteration_01() throws Exception { |
---|
| 248 | IIteration task = taskFactory.createNewIteration(); |
---|
| 249 | |
---|
| 250 | assertNotNull(task); |
---|
| 251 | assertNotNull(task.getId()); |
---|
| 252 | assertNull(task.getMarkedTask()); |
---|
| 253 | assertTrue(task.equals(task)); |
---|
| 254 | } |
---|
| 255 | |
---|
| 256 | /** |
---|
| 257 | * |
---|
| 258 | */ |
---|
| 259 | @Test |
---|
| 260 | public void test_Iteration_02() throws Exception { |
---|
| 261 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 262 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 263 | |
---|
[1294] | 264 | IEventTask child = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 265 | |
---|
| 266 | IIteration task = taskFactory.createNewIteration(); |
---|
| 267 | |
---|
| 268 | taskBuilder.setMarkedTask(task, child); |
---|
| 269 | |
---|
| 270 | assertEquals(child, task.getMarkedTask()); |
---|
| 271 | } |
---|
| 272 | |
---|
| 273 | /** |
---|
| 274 | * |
---|
| 275 | */ |
---|
| 276 | @Test |
---|
| 277 | public void test_Iteration_03() throws Exception { |
---|
| 278 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 279 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 280 | |
---|
[1294] | 281 | IEventTask child1 = createNewEventTask(eventType, eventTarget); |
---|
| 282 | IEventTask child2 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 283 | |
---|
| 284 | IIteration task = taskFactory.createNewIteration(); |
---|
| 285 | |
---|
| 286 | taskBuilder.setMarkedTask(task, child1); |
---|
| 287 | taskBuilder.setMarkedTask(task, child2); |
---|
| 288 | |
---|
| 289 | assertEquals(child2, task.getMarkedTask()); |
---|
| 290 | } |
---|
| 291 | |
---|
| 292 | /** |
---|
| 293 | * |
---|
| 294 | */ |
---|
| 295 | @Test |
---|
| 296 | public void test_Optional_01() throws Exception { |
---|
| 297 | IOptional task = taskFactory.createNewOptional(); |
---|
| 298 | |
---|
| 299 | assertNotNull(task); |
---|
| 300 | assertNotNull(task.getId()); |
---|
| 301 | assertNull(task.getMarkedTask()); |
---|
| 302 | assertTrue(task.equals(task)); |
---|
| 303 | } |
---|
| 304 | |
---|
| 305 | /** |
---|
| 306 | * |
---|
| 307 | */ |
---|
| 308 | @Test |
---|
| 309 | public void test_Optional_02() throws Exception { |
---|
| 310 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 311 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 312 | |
---|
[1294] | 313 | IEventTask child = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 314 | |
---|
| 315 | IOptional task = taskFactory.createNewOptional(); |
---|
| 316 | |
---|
| 317 | taskBuilder.setMarkedTask(task, child); |
---|
| 318 | |
---|
| 319 | assertEquals(child, task.getMarkedTask()); |
---|
| 320 | } |
---|
| 321 | |
---|
| 322 | /** |
---|
| 323 | * |
---|
| 324 | */ |
---|
| 325 | @Test |
---|
| 326 | public void test_Optional_03() throws Exception { |
---|
| 327 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 328 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 329 | |
---|
[1294] | 330 | IEventTask child1 = createNewEventTask(eventType, eventTarget); |
---|
| 331 | IEventTask child2 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 332 | |
---|
| 333 | IOptional task = taskFactory.createNewOptional(); |
---|
| 334 | |
---|
| 335 | taskBuilder.setMarkedTask(task, child1); |
---|
| 336 | taskBuilder.setMarkedTask(task, child2); |
---|
| 337 | |
---|
| 338 | assertEquals(child2, task.getMarkedTask()); |
---|
| 339 | } |
---|
| 340 | |
---|
| 341 | /** |
---|
| 342 | * |
---|
| 343 | */ |
---|
| 344 | @Test |
---|
| 345 | public void test_EventTaskInstance_01() throws Exception { |
---|
| 346 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 347 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 348 | |
---|
[1294] | 349 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 350 | |
---|
[1294] | 351 | IEventTaskInstance taskInstance = createNewTaskInstance(task); |
---|
[1146] | 352 | |
---|
| 353 | assertNotNull(taskInstance); |
---|
| 354 | assertEquals(task, taskInstance.getTask()); |
---|
| 355 | assertTrue(taskInstance.equals(taskInstance)); |
---|
| 356 | assertFalse(taskInstance.equals(task)); |
---|
| 357 | } |
---|
| 358 | |
---|
| 359 | /** |
---|
| 360 | * |
---|
| 361 | */ |
---|
| 362 | @Test |
---|
| 363 | public void test_EventTaskInstance_02() throws Exception { |
---|
| 364 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 365 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 366 | |
---|
[1294] | 367 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 368 | |
---|
[1294] | 369 | ITaskInstance taskInstance1 = createNewTaskInstance(task); |
---|
| 370 | ITaskInstance taskInstance2 = createNewTaskInstance(task); |
---|
[1146] | 371 | |
---|
| 372 | assertFalse(taskInstance1.equals(taskInstance2)); |
---|
| 373 | } |
---|
| 374 | |
---|
| 375 | /** |
---|
| 376 | * |
---|
| 377 | */ |
---|
[1411] | 378 | @Test() |
---|
[1146] | 379 | public void test_SequenceInstance_01() throws Exception { |
---|
| 380 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 381 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 382 | |
---|
[1294] | 383 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 384 | |
---|
| 385 | ISequence sequence = taskFactory.createNewSequence(); |
---|
| 386 | |
---|
[1294] | 387 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 388 | ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); |
---|
[1146] | 389 | |
---|
| 390 | taskBuilder.addChild(sequenceInstance, taskInstance); |
---|
| 391 | } |
---|
| 392 | |
---|
| 393 | /** |
---|
| 394 | * |
---|
| 395 | */ |
---|
| 396 | @Test |
---|
| 397 | public void test_SequenceInstance_02() throws Exception { |
---|
| 398 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 399 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 400 | |
---|
[1294] | 401 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 402 | |
---|
| 403 | ISequence sequence = taskFactory.createNewSequence(); |
---|
| 404 | taskBuilder.addChild(sequence, task); |
---|
| 405 | |
---|
[1294] | 406 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 407 | ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); |
---|
[1146] | 408 | |
---|
| 409 | taskBuilder.addChild(sequenceInstance, taskInstance); |
---|
| 410 | |
---|
[1294] | 411 | assertEquals(1, sequenceInstance.size()); |
---|
| 412 | assertEquals(taskInstance, sequenceInstance.get(0)); |
---|
[1146] | 413 | } |
---|
| 414 | |
---|
| 415 | /** |
---|
| 416 | * |
---|
| 417 | */ |
---|
| 418 | @Test |
---|
| 419 | public void test_SequenceInstance_03() throws Exception { |
---|
| 420 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 421 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 422 | |
---|
[1294] | 423 | IEventTask task1 = createNewEventTask(eventType, eventTarget); |
---|
| 424 | IEventTask task2 = createNewEventTask(eventType, eventTarget); |
---|
| 425 | IEventTask task3 = createNewEventTask(eventType, eventTarget); |
---|
| 426 | IEventTask task4 = createNewEventTask(eventType, eventTarget); |
---|
| 427 | IEventTask task5 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 428 | |
---|
| 429 | ISequence sequence = taskFactory.createNewSequence(); |
---|
| 430 | taskBuilder.addChild(sequence, task1); |
---|
| 431 | taskBuilder.addChild(sequence, task2); |
---|
| 432 | taskBuilder.addChild(sequence, task3); |
---|
| 433 | taskBuilder.addChild(sequence, task4); |
---|
| 434 | taskBuilder.addChild(sequence, task5); |
---|
| 435 | |
---|
[1294] | 436 | ITaskInstance taskInstance1 = createNewTaskInstance(task1); |
---|
| 437 | ITaskInstance taskInstance2 = createNewTaskInstance(task2); |
---|
| 438 | ITaskInstance taskInstance3 = createNewTaskInstance(task3); |
---|
| 439 | ITaskInstance taskInstance4 = createNewTaskInstance(task4); |
---|
| 440 | ITaskInstance taskInstance5 = createNewTaskInstance(task5); |
---|
| 441 | ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); |
---|
[1146] | 442 | |
---|
| 443 | taskBuilder.addChild(sequenceInstance, taskInstance1); |
---|
| 444 | taskBuilder.addChild(sequenceInstance, taskInstance2); |
---|
| 445 | taskBuilder.addChild(sequenceInstance, taskInstance3); |
---|
| 446 | taskBuilder.addChild(sequenceInstance, taskInstance4); |
---|
| 447 | taskBuilder.addChild(sequenceInstance, taskInstance5); |
---|
| 448 | |
---|
[1294] | 449 | assertEquals(5, sequenceInstance.size()); |
---|
| 450 | assertEquals(taskInstance1, sequenceInstance.get(0)); |
---|
| 451 | assertEquals(taskInstance2, sequenceInstance.get(1)); |
---|
| 452 | assertEquals(taskInstance3, sequenceInstance.get(2)); |
---|
| 453 | assertEquals(taskInstance4, sequenceInstance.get(3)); |
---|
| 454 | assertEquals(taskInstance5, sequenceInstance.get(4)); |
---|
[1146] | 455 | } |
---|
| 456 | |
---|
| 457 | /** |
---|
| 458 | * |
---|
| 459 | */ |
---|
| 460 | @Test(expected=IllegalArgumentException.class) |
---|
| 461 | public void test_SelectionInstance_01() throws Exception { |
---|
| 462 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 463 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 464 | |
---|
[1294] | 465 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 466 | |
---|
| 467 | ISelection selection = taskFactory.createNewSelection(); |
---|
| 468 | |
---|
[1294] | 469 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 470 | ISelectionInstance selectionInstance = createNewTaskInstance(selection); |
---|
[1146] | 471 | |
---|
[1294] | 472 | taskBuilder.setChild(selectionInstance, taskInstance); |
---|
[1146] | 473 | } |
---|
| 474 | |
---|
| 475 | /** |
---|
| 476 | * |
---|
| 477 | */ |
---|
| 478 | @Test |
---|
| 479 | public void test_SelectionInstance_02() throws Exception { |
---|
| 480 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 481 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 482 | |
---|
[1294] | 483 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 484 | |
---|
| 485 | ISelection selection = taskFactory.createNewSelection(); |
---|
| 486 | taskBuilder.addChild(selection, task); |
---|
| 487 | |
---|
[1294] | 488 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 489 | ISelectionInstance selectionInstance = createNewTaskInstance(selection); |
---|
[1146] | 490 | |
---|
[1294] | 491 | taskBuilder.setChild(selectionInstance, taskInstance); |
---|
[1146] | 492 | |
---|
[1294] | 493 | assertNotNull(selectionInstance.getChild()); |
---|
| 494 | assertEquals(taskInstance, selectionInstance.getChild()); |
---|
[1146] | 495 | } |
---|
| 496 | |
---|
| 497 | /** |
---|
| 498 | * |
---|
| 499 | */ |
---|
[1294] | 500 | @Test |
---|
[1146] | 501 | public void test_SelectionInstance_03() throws Exception { |
---|
| 502 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 503 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 504 | |
---|
[1294] | 505 | IEventTask task1 = createNewEventTask(eventType, eventTarget); |
---|
| 506 | IEventTask task2 = createNewEventTask(eventType, eventTarget); |
---|
| 507 | IEventTask task3 = createNewEventTask(eventType, eventTarget); |
---|
| 508 | IEventTask task4 = createNewEventTask(eventType, eventTarget); |
---|
| 509 | IEventTask task5 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 510 | |
---|
| 511 | ISelection selection = taskFactory.createNewSelection(); |
---|
| 512 | taskBuilder.addChild(selection, task1); |
---|
| 513 | taskBuilder.addChild(selection, task2); |
---|
| 514 | taskBuilder.addChild(selection, task3); |
---|
| 515 | taskBuilder.addChild(selection, task4); |
---|
| 516 | taskBuilder.addChild(selection, task5); |
---|
| 517 | |
---|
[1294] | 518 | ITaskInstance taskInstance1 = createNewTaskInstance(task1); |
---|
| 519 | ITaskInstance taskInstance2 = createNewTaskInstance(task2); |
---|
| 520 | ISelectionInstance selectionInstance = createNewTaskInstance(selection); |
---|
[1146] | 521 | |
---|
[1294] | 522 | taskBuilder.setChild(selectionInstance, taskInstance1); |
---|
| 523 | taskBuilder.setChild(selectionInstance, taskInstance2); |
---|
| 524 | |
---|
| 525 | assertEquals(taskInstance2, selectionInstance.getChild()); |
---|
[1146] | 526 | } |
---|
| 527 | |
---|
| 528 | /** |
---|
| 529 | * |
---|
| 530 | */ |
---|
[1411] | 531 | @Test() |
---|
[1146] | 532 | public void test_IterationInstance_01() throws Exception { |
---|
| 533 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 534 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 535 | |
---|
[1294] | 536 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 537 | |
---|
| 538 | IIteration iteration = taskFactory.createNewIteration(); |
---|
| 539 | |
---|
[1294] | 540 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 541 | IIterationInstance iterationInstance = createNewTaskInstance(iteration); |
---|
[1146] | 542 | |
---|
| 543 | taskBuilder.addChild(iterationInstance, taskInstance); |
---|
| 544 | } |
---|
| 545 | |
---|
| 546 | /** |
---|
| 547 | * |
---|
| 548 | */ |
---|
| 549 | @Test |
---|
| 550 | public void test_IterationInstance_02() throws Exception { |
---|
| 551 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 552 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 553 | |
---|
[1294] | 554 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 555 | |
---|
| 556 | IIteration iteration = taskFactory.createNewIteration(); |
---|
| 557 | taskBuilder.setMarkedTask(iteration, task); |
---|
| 558 | |
---|
[1294] | 559 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 560 | IIterationInstance iterationInstance = createNewTaskInstance(iteration); |
---|
[1146] | 561 | |
---|
| 562 | taskBuilder.addChild(iterationInstance, taskInstance); |
---|
| 563 | |
---|
[1294] | 564 | assertEquals(1, iterationInstance.size()); |
---|
| 565 | assertEquals(taskInstance, iterationInstance.get(0)); |
---|
[1146] | 566 | } |
---|
| 567 | |
---|
| 568 | /** |
---|
| 569 | * |
---|
| 570 | */ |
---|
| 571 | @Test(expected=IllegalArgumentException.class) |
---|
| 572 | public void test_IterationInstance_03() throws Exception { |
---|
| 573 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 574 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 575 | |
---|
[1294] | 576 | IEventTask task1 = createNewEventTask(eventType, eventTarget); |
---|
| 577 | IEventTask task2 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 578 | |
---|
| 579 | IIteration iteration = taskFactory.createNewIteration(); |
---|
| 580 | taskBuilder.setMarkedTask(iteration, task1); |
---|
| 581 | taskBuilder.setMarkedTask(iteration, task2); |
---|
| 582 | |
---|
[1294] | 583 | ITaskInstance taskInstance1 = createNewTaskInstance(task1); |
---|
| 584 | IIterationInstance iterationInstance = createNewTaskInstance(iteration); |
---|
[1146] | 585 | |
---|
| 586 | taskBuilder.addChild(iterationInstance, taskInstance1); |
---|
| 587 | } |
---|
| 588 | |
---|
| 589 | /** |
---|
| 590 | * |
---|
| 591 | */ |
---|
| 592 | @Test |
---|
| 593 | public void test_IterationInstance_04() throws Exception { |
---|
| 594 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 595 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 596 | |
---|
[1294] | 597 | IEventTask task1 = createNewEventTask(eventType, eventTarget); |
---|
| 598 | IEventTask task2 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 599 | |
---|
| 600 | IIteration iteration = taskFactory.createNewIteration(); |
---|
| 601 | taskBuilder.setMarkedTask(iteration, task1); |
---|
| 602 | taskBuilder.setMarkedTask(iteration, task2); |
---|
| 603 | |
---|
[1294] | 604 | ITaskInstance taskInstance2 = createNewTaskInstance(task2); |
---|
| 605 | IIterationInstance iterationInstance = createNewTaskInstance(iteration); |
---|
[1146] | 606 | |
---|
| 607 | taskBuilder.addChild(iterationInstance, taskInstance2); |
---|
| 608 | |
---|
[1294] | 609 | assertEquals(1, iterationInstance.size()); |
---|
| 610 | assertEquals(taskInstance2, iterationInstance.get(0)); |
---|
[1146] | 611 | } |
---|
| 612 | |
---|
| 613 | /** |
---|
| 614 | * |
---|
| 615 | */ |
---|
[1411] | 616 | @Test() |
---|
[1146] | 617 | public void test_OptionalInstance_01() throws Exception { |
---|
| 618 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 619 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 620 | |
---|
[1294] | 621 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 622 | |
---|
| 623 | IOptional optional = taskFactory.createNewOptional(); |
---|
| 624 | |
---|
[1294] | 625 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 626 | IOptionalInstance optionalInstance = createNewTaskInstance(optional); |
---|
[1146] | 627 | |
---|
[1294] | 628 | taskBuilder.setChild(optionalInstance, taskInstance); |
---|
[1146] | 629 | } |
---|
| 630 | |
---|
| 631 | /** |
---|
| 632 | * |
---|
| 633 | */ |
---|
| 634 | @Test |
---|
| 635 | public void test_OptionalInstance_02() throws Exception { |
---|
| 636 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 637 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 638 | |
---|
[1294] | 639 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 640 | |
---|
| 641 | IOptional optional = taskFactory.createNewOptional(); |
---|
| 642 | taskBuilder.setMarkedTask(optional, task); |
---|
| 643 | |
---|
[1294] | 644 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 645 | IOptionalInstance optionalInstance = createNewTaskInstance(optional); |
---|
[1146] | 646 | |
---|
[1294] | 647 | taskBuilder.setChild(optionalInstance, taskInstance); |
---|
[1146] | 648 | |
---|
[1294] | 649 | assertNotNull(optionalInstance.getChild()); |
---|
| 650 | assertEquals(taskInstance, optionalInstance.getChild()); |
---|
[1146] | 651 | } |
---|
| 652 | |
---|
| 653 | /** |
---|
| 654 | * |
---|
| 655 | */ |
---|
| 656 | @Test(expected=IllegalArgumentException.class) |
---|
| 657 | public void test_OptionalInstance_03() throws Exception { |
---|
| 658 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 659 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 660 | |
---|
[1294] | 661 | IEventTask task1 = createNewEventTask(eventType, eventTarget); |
---|
| 662 | IEventTask task2 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 663 | |
---|
| 664 | IOptional optional = taskFactory.createNewOptional(); |
---|
| 665 | taskBuilder.setMarkedTask(optional, task1); |
---|
| 666 | taskBuilder.setMarkedTask(optional, task2); |
---|
| 667 | |
---|
[1294] | 668 | ITaskInstance taskInstance1 = createNewTaskInstance(task1); |
---|
| 669 | IOptionalInstance optionalInstance = createNewTaskInstance(optional); |
---|
[1146] | 670 | |
---|
[1294] | 671 | taskBuilder.setChild(optionalInstance, taskInstance1); |
---|
[1146] | 672 | } |
---|
| 673 | |
---|
| 674 | /** |
---|
| 675 | * |
---|
| 676 | */ |
---|
| 677 | @Test |
---|
| 678 | public void test_OptionalInstance_04() throws Exception { |
---|
| 679 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 680 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 681 | |
---|
[1294] | 682 | IEventTask task1 = createNewEventTask(eventType, eventTarget); |
---|
| 683 | IEventTask task2 = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 684 | |
---|
| 685 | IOptional optional = taskFactory.createNewOptional(); |
---|
| 686 | taskBuilder.setMarkedTask(optional, task1); |
---|
| 687 | taskBuilder.setMarkedTask(optional, task2); |
---|
| 688 | |
---|
[1294] | 689 | ITaskInstance taskInstance2 = createNewTaskInstance(task2); |
---|
| 690 | IOptionalInstance optionalInstance = createNewTaskInstance(optional); |
---|
[1146] | 691 | |
---|
[1294] | 692 | taskBuilder.setChild(optionalInstance, taskInstance2); |
---|
[1146] | 693 | |
---|
[1294] | 694 | assertNotNull(optionalInstance.getChild()); |
---|
| 695 | assertEquals(taskInstance2, optionalInstance.getChild()); |
---|
[1146] | 696 | } |
---|
| 697 | |
---|
| 698 | /** |
---|
| 699 | * |
---|
| 700 | */ |
---|
| 701 | @Test |
---|
| 702 | public void test_UserSession_01() throws Exception { |
---|
| 703 | IUserSession userSession = taskFactory.createUserSession(); |
---|
| 704 | |
---|
| 705 | assertNotNull(userSession); |
---|
[1402] | 706 | assertEquals(0, userSession.size()); |
---|
[1146] | 707 | } |
---|
| 708 | |
---|
| 709 | /** |
---|
| 710 | * |
---|
| 711 | */ |
---|
| 712 | @Test |
---|
| 713 | public void test_UserSession_02() throws Exception { |
---|
| 714 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 715 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 716 | |
---|
[1294] | 717 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 718 | |
---|
| 719 | IUserSession userSession = taskFactory.createUserSession(); |
---|
| 720 | |
---|
[1294] | 721 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
[1146] | 722 | |
---|
| 723 | taskBuilder.addExecutedTask(userSession, taskInstance); |
---|
| 724 | |
---|
[1402] | 725 | assertEquals(1, userSession.size()); |
---|
| 726 | assertEquals(taskInstance, userSession.get(0)); |
---|
[1146] | 727 | } |
---|
| 728 | |
---|
| 729 | /** |
---|
| 730 | * |
---|
| 731 | */ |
---|
| 732 | @Test |
---|
| 733 | public void test_UserSession_03() throws Exception { |
---|
| 734 | IEventType eventType = new DummyInteraction("interaction", 1); |
---|
| 735 | IEventTarget eventTarget = new DummyGUIElement("elem"); |
---|
| 736 | |
---|
[1294] | 737 | IEventTask task = createNewEventTask(eventType, eventTarget); |
---|
[1146] | 738 | ISequence sequence = taskFactory.createNewSequence(); |
---|
| 739 | ISelection selection = taskFactory.createNewSelection(); |
---|
| 740 | IIteration iteration = taskFactory.createNewIteration(); |
---|
| 741 | IOptional optional = taskFactory.createNewOptional(); |
---|
| 742 | |
---|
| 743 | taskBuilder.addChild(sequence, task); |
---|
| 744 | taskBuilder.addChild(selection, task); |
---|
| 745 | taskBuilder.setMarkedTask(iteration, task); |
---|
| 746 | taskBuilder.setMarkedTask(optional, task); |
---|
| 747 | |
---|
[1294] | 748 | ITaskInstance taskInstance = createNewTaskInstance(task); |
---|
| 749 | ISequenceInstance sequenceInstance = createNewTaskInstance(sequence); |
---|
| 750 | ISelectionInstance selectionInstance = createNewTaskInstance(selection); |
---|
| 751 | IIterationInstance iterationInstance = createNewTaskInstance(iteration); |
---|
| 752 | IOptionalInstance optionalInstance = createNewTaskInstance(optional); |
---|
[1146] | 753 | |
---|
[1294] | 754 | taskBuilder.addChild(sequenceInstance, createNewTaskInstance(task)); |
---|
| 755 | taskBuilder.setChild(selectionInstance, createNewTaskInstance(task)); |
---|
| 756 | taskBuilder.addChild(iterationInstance, createNewTaskInstance(task)); |
---|
| 757 | taskBuilder.setChild(optionalInstance, createNewTaskInstance(task)); |
---|
[1146] | 758 | |
---|
| 759 | IUserSession userSession = taskFactory.createUserSession(); |
---|
| 760 | |
---|
| 761 | taskBuilder.addExecutedTask(userSession, taskInstance); |
---|
| 762 | taskBuilder.addExecutedTask(userSession, sequenceInstance); |
---|
| 763 | taskBuilder.addExecutedTask(userSession, selectionInstance); |
---|
| 764 | taskBuilder.addExecutedTask(userSession, iterationInstance); |
---|
| 765 | taskBuilder.addExecutedTask(userSession, optionalInstance); |
---|
| 766 | |
---|
[1402] | 767 | assertEquals(5, userSession.size()); |
---|
| 768 | assertEquals(taskInstance, userSession.get(0)); |
---|
| 769 | assertEquals(sequenceInstance, userSession.get(1)); |
---|
| 770 | assertEquals(selectionInstance, userSession.get(2)); |
---|
| 771 | assertEquals(iterationInstance, userSession.get(3)); |
---|
| 772 | assertEquals(optionalInstance, userSession.get(4)); |
---|
[1146] | 773 | } |
---|
| 774 | |
---|
| 775 | /** |
---|
| 776 | * |
---|
| 777 | */ |
---|
| 778 | @Test |
---|
[557] | 779 | public void testRandomTrees() throws Exception { |
---|
| 780 | int noOfTrees = 10; |
---|
| 781 | int noOfMaxChildren = 8; |
---|
| 782 | int maxDepth = MAX_TREE_DEPTH; |
---|
| 783 | |
---|
| 784 | for (int i = 0; i < noOfTrees; i++) { |
---|
[1146] | 785 | System.err.println("\niteration " + (i + 1) + ":"); |
---|
| 786 | System.err.println(" creating tasks"); |
---|
| 787 | Map<ITask, ITaskInfo> expectedTaskInfos = new HashMap<ITask, ITaskInfo>(); |
---|
| 788 | ITask task = createTaskTree(noOfMaxChildren, maxDepth, expectedTaskInfos); |
---|
| 789 | if (!(task instanceof ISequence)) { |
---|
| 790 | ISequence sequence = taskFactory.createNewSequence(); |
---|
| 791 | taskBuilder.addChild(sequence, task); |
---|
| 792 | task = sequence; |
---|
| 793 | } |
---|
| 794 | else { |
---|
| 795 | expectedTaskInfos.remove(task); |
---|
| 796 | } |
---|
| 797 | |
---|
[1411] | 798 | //new TaskTreeEncoder().encode(task, System.err); |
---|
| 799 | |
---|
[1294] | 800 | ISequenceInstance sequenceInstance = |
---|
| 801 | (ISequenceInstance) instantiateTask(task, noOfMaxChildren); |
---|
[1146] | 802 | |
---|
| 803 | System.err.println(" creating user session"); |
---|
| 804 | |
---|
| 805 | IUserSession session = taskFactory.createUserSession(); |
---|
| 806 | |
---|
[1294] | 807 | for (ITaskInstance child : sequenceInstance) { |
---|
[1146] | 808 | taskBuilder.addExecutedTask(session, child); |
---|
| 809 | } |
---|
| 810 | |
---|
| 811 | List<IUserSession> sessions = new LinkedList<IUserSession>(); |
---|
| 812 | sessions.add(session); |
---|
| 813 | |
---|
[1411] | 814 | //new TaskTreeEncoder().encode(session, System.err); |
---|
| 815 | |
---|
[1294] | 816 | ITaskModel taskModel = taskFactory.createTaskModel(sessions); |
---|
[557] | 817 | |
---|
| 818 | System.err.println(" validating task tree"); |
---|
[1146] | 819 | Map<ITask, ITaskInfo> actualTaskInfos = new HashMap<ITask, ITaskInfo>(); |
---|
| 820 | |
---|
[1294] | 821 | for (ITask currentTask : taskModel.getTasks()) { |
---|
| 822 | actualTaskInfos.put(currentTask, taskModel.getTaskInfo(currentTask)); |
---|
[1146] | 823 | } |
---|
| 824 | |
---|
| 825 | assertMapsEqual(expectedTaskInfos, actualTaskInfos); |
---|
[557] | 826 | } |
---|
[445] | 827 | } |
---|
| 828 | |
---|
[557] | 829 | /** |
---|
[1146] | 830 | * |
---|
[557] | 831 | */ |
---|
[1146] | 832 | private void assertMapsEqual(Map<ITask, ITaskInfo> map1, |
---|
| 833 | Map<ITask, ITaskInfo> map2) |
---|
[445] | 834 | { |
---|
[557] | 835 | try { |
---|
| 836 | if (map1 == null) { |
---|
| 837 | assertNull(map2); |
---|
| 838 | return; |
---|
| 839 | } |
---|
| 840 | |
---|
| 841 | assertEquals(map1.size(), map2.size()); |
---|
| 842 | |
---|
[1146] | 843 | for (Map.Entry<ITask, ITaskInfo> entry : map1.entrySet()) { |
---|
| 844 | ITaskInfo value2 = map2.get(entry.getKey()); |
---|
[557] | 845 | assertNotNull(value2); |
---|
| 846 | assertEquals(entry.getValue().getTask(), value2.getTask()); |
---|
[1132] | 847 | //assertEquals(entry.getValue().getNoOfOccurencesInTree(), |
---|
| 848 | // value2.getNoOfOccurencesInTree()); |
---|
[557] | 849 | } |
---|
| 850 | } |
---|
| 851 | catch (AssertionError e) { |
---|
| 852 | dumpMap(map1); |
---|
| 853 | dumpMap(map2); |
---|
[1411] | 854 | |
---|
| 855 | if (map1.size() > map2.size()) { |
---|
| 856 | for (ITask task : map2.keySet()) { |
---|
| 857 | map1.remove(task); |
---|
| 858 | } |
---|
| 859 | |
---|
| 860 | System.err.println("difference: "); |
---|
| 861 | dumpMap(map1); |
---|
| 862 | } |
---|
| 863 | else if (map2.size() > map1.size()) { |
---|
| 864 | for (ITask task : map1.keySet()) { |
---|
| 865 | map2.remove(task); |
---|
| 866 | } |
---|
| 867 | |
---|
| 868 | System.err.println("difference: "); |
---|
| 869 | dumpMap(map2); |
---|
| 870 | } |
---|
| 871 | |
---|
[557] | 872 | throw e; |
---|
| 873 | } |
---|
[445] | 874 | } |
---|
[557] | 875 | |
---|
| 876 | /** |
---|
[1146] | 877 | * |
---|
[557] | 878 | */ |
---|
[1146] | 879 | private void dumpMap(Map<ITask, ITaskInfo> map) { |
---|
[557] | 880 | System.err.println(); |
---|
| 881 | |
---|
| 882 | if (map == null) { |
---|
| 883 | System.err.println("map is null"); |
---|
| 884 | } |
---|
| 885 | else { |
---|
| 886 | System.err.println("map:"); |
---|
[1146] | 887 | for (Map.Entry<ITask, ITaskInfo> entry : map.entrySet()) { |
---|
[1411] | 888 | int lineLength = 2; |
---|
[557] | 889 | System.err.print(" "); |
---|
| 890 | System.err.print(entry.getKey()); |
---|
[1411] | 891 | lineLength += entry.getKey().toString().length(); |
---|
| 892 | for (int i = lineLength; i < 70; i++) { |
---|
[557] | 893 | System.err.print(" "); |
---|
| 894 | } |
---|
[1411] | 895 | lineLength = 60; |
---|
[557] | 896 | System.err.print(" : "); |
---|
[1411] | 897 | lineLength += 3; |
---|
| 898 | System.err.print(entry.getValue()); |
---|
| 899 | lineLength += entry.getValue().toString().length(); |
---|
| 900 | for (int i = lineLength; i < 140; i++) { |
---|
| 901 | System.err.print(" "); |
---|
| 902 | } |
---|
| 903 | System.err.print(" : "); |
---|
| 904 | System.err.println(entry.getKey().getDescription()); |
---|
[557] | 905 | } |
---|
| 906 | } |
---|
| 907 | |
---|
| 908 | System.err.println(); |
---|
[445] | 909 | } |
---|
| 910 | |
---|
[557] | 911 | /** |
---|
[1146] | 912 | * |
---|
[557] | 913 | */ |
---|
[1146] | 914 | private ITask createTaskTree(int maxNoOfChildren, |
---|
| 915 | int maxDepth, |
---|
| 916 | Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 917 | throws Exception |
---|
[445] | 918 | { |
---|
[557] | 919 | |
---|
[1146] | 920 | ITask task; |
---|
[557] | 921 | |
---|
| 922 | // integrating the maximum depth here assures, that either something between 0 and 8 will |
---|
| 923 | // be the type, or if the max depth decreases near 0 only event tasks will be created |
---|
| 924 | // to finish the tree creation |
---|
[1146] | 925 | int type = randomize(Math.min(10, maxDepth)); |
---|
[557] | 926 | |
---|
| 927 | switch (type) |
---|
[445] | 928 | { |
---|
[557] | 929 | case 0: { |
---|
| 930 | // System.err.print("creating new event task "); |
---|
[1146] | 931 | task = createNewEventTask(taskInfos); |
---|
[557] | 932 | break; |
---|
| 933 | } |
---|
| 934 | case 1: { |
---|
| 935 | // System.err.print("reusing event task "); |
---|
[1146] | 936 | task = reuseEventTask(taskInfos); |
---|
[557] | 937 | break; |
---|
| 938 | } |
---|
| 939 | case 2: { |
---|
| 940 | // System.err.println("creating new sequence {"); |
---|
[1146] | 941 | task = createNewSequence(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 942 | break; |
---|
| 943 | } |
---|
| 944 | case 3: { |
---|
| 945 | // System.err.println("reusing sequence {"); |
---|
[1146] | 946 | task = reuseSequence(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 947 | break; |
---|
| 948 | } |
---|
| 949 | case 4: { |
---|
| 950 | // System.err.println("creating new selection {"); |
---|
[1146] | 951 | task = createNewSelection(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 952 | break; |
---|
| 953 | } |
---|
| 954 | case 5: { |
---|
| 955 | // System.err.println("reusing selection {"); |
---|
[1146] | 956 | task = reuseSelection(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 957 | break; |
---|
| 958 | } |
---|
| 959 | case 6: { |
---|
| 960 | // System.err.println("creating new iteration {"); |
---|
[1146] | 961 | task = createNewIteration(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 962 | break; |
---|
| 963 | } |
---|
| 964 | case 7: { |
---|
| 965 | // System.err.println("reusing iteration {"); |
---|
[1146] | 966 | task = reuseIteration(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 967 | break; |
---|
| 968 | } |
---|
[1146] | 969 | case 8: { |
---|
| 970 | // System.err.println("creating new optional {"); |
---|
| 971 | task = createNewOptional(maxNoOfChildren, maxDepth, taskInfos); |
---|
| 972 | break; |
---|
| 973 | } |
---|
| 974 | case 9: { |
---|
| 975 | // System.err.println("reusing optional {"); |
---|
| 976 | task = reuseOptional(maxNoOfChildren, maxDepth, taskInfos); |
---|
| 977 | break; |
---|
| 978 | } |
---|
[557] | 979 | default: { |
---|
| 980 | // System.err.print("creating new event task per default "); |
---|
[1146] | 981 | task = createNewEventTask(taskInfos); |
---|
[557] | 982 | } |
---|
[445] | 983 | } |
---|
[557] | 984 | |
---|
[1146] | 985 | return task; |
---|
[445] | 986 | } |
---|
| 987 | |
---|
[557] | 988 | /** |
---|
[1146] | 989 | * |
---|
[557] | 990 | */ |
---|
[1146] | 991 | private ITask createNewEventTask(Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 992 | throws Exception |
---|
[445] | 993 | { |
---|
[557] | 994 | Thread.sleep(2); |
---|
| 995 | long id = System.currentTimeMillis(); |
---|
[1294] | 996 | IEventTask task = createNewEventTask |
---|
[1146] | 997 | (new DummyInteraction("interaction" + id, 1), new DummyGUIElement("elem" + id)); |
---|
[557] | 998 | |
---|
[1146] | 999 | taskInfos.put(task, new TaskInfo(task)); |
---|
[557] | 1000 | |
---|
| 1001 | return task; |
---|
[445] | 1002 | } |
---|
[557] | 1003 | |
---|
| 1004 | /** |
---|
[1146] | 1005 | * |
---|
[557] | 1006 | */ |
---|
[1146] | 1007 | private ITask reuseEventTask(Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 1008 | throws Exception |
---|
[445] | 1009 | { |
---|
[1146] | 1010 | ITask eventTask = reuseTask(taskInfos, IEventTask.class); |
---|
| 1011 | |
---|
| 1012 | if (eventTask == null) { |
---|
| 1013 | eventTask = createNewEventTask(taskInfos); |
---|
[557] | 1014 | } |
---|
[445] | 1015 | |
---|
[1146] | 1016 | return eventTask; |
---|
[445] | 1017 | } |
---|
[557] | 1018 | |
---|
| 1019 | /** |
---|
[1146] | 1020 | * |
---|
[557] | 1021 | */ |
---|
[1146] | 1022 | private ITask createNewSequence(int maxNoOfChildren, |
---|
| 1023 | int maxDepth, |
---|
| 1024 | Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 1025 | throws Exception |
---|
[445] | 1026 | { |
---|
[1146] | 1027 | ISequence sequence = taskFactory.createNewSequence(); |
---|
[557] | 1028 | |
---|
[1146] | 1029 | // ensure at the minimum 2 children |
---|
| 1030 | int noOfChildren = randomize(2, maxNoOfChildren); |
---|
[557] | 1031 | |
---|
| 1032 | for (int i = 0; i < noOfChildren; i++) { |
---|
[1146] | 1033 | ITask child = createTaskTree(maxNoOfChildren, maxDepth - 1, taskInfos); |
---|
[1411] | 1034 | |
---|
| 1035 | //((Task) child).setDescription(sequence.toString()); |
---|
[1146] | 1036 | taskBuilder.addChild(sequence, child); |
---|
[445] | 1037 | } |
---|
[557] | 1038 | |
---|
[1146] | 1039 | taskInfos.put(sequence, new TaskInfo(sequence)); |
---|
[557] | 1040 | return sequence; |
---|
[445] | 1041 | } |
---|
[557] | 1042 | |
---|
| 1043 | /** |
---|
[1146] | 1044 | * |
---|
[557] | 1045 | */ |
---|
[1146] | 1046 | private ITask reuseSequence(int maxNoOfChildren, |
---|
| 1047 | int maxDepth, |
---|
| 1048 | Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 1049 | throws Exception |
---|
[445] | 1050 | { |
---|
[1146] | 1051 | ITask sequence = reuseTask(taskInfos, ISequence.class); |
---|
| 1052 | |
---|
| 1053 | if (sequence == null) { |
---|
| 1054 | sequence = createNewSequence(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 1055 | } |
---|
| 1056 | |
---|
[1146] | 1057 | return sequence; |
---|
| 1058 | } |
---|
[557] | 1059 | |
---|
[1146] | 1060 | /** |
---|
| 1061 | * |
---|
| 1062 | */ |
---|
| 1063 | private ITask createNewSelection(int maxNoOfChildren, |
---|
| 1064 | int maxDepth, |
---|
| 1065 | Map<ITask, ITaskInfo> taskInfos) |
---|
| 1066 | throws Exception |
---|
| 1067 | { |
---|
| 1068 | ISelection selection = taskFactory.createNewSelection(); |
---|
| 1069 | |
---|
| 1070 | // ensure at the minimum 1 child |
---|
| 1071 | int noOfChildren = randomize(1, maxNoOfChildren); |
---|
| 1072 | |
---|
[1411] | 1073 | Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); |
---|
[1146] | 1074 | for (int i = 0; i < noOfChildren; i++) { |
---|
[1294] | 1075 | ITask child; |
---|
| 1076 | do { |
---|
[1411] | 1077 | childrenTaskInfos.clear(); |
---|
| 1078 | child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); |
---|
[1294] | 1079 | } |
---|
| 1080 | while (child instanceof ISelection); |
---|
| 1081 | |
---|
[1411] | 1082 | //((Task) child).setDescription(selection.toString()); |
---|
[1146] | 1083 | taskBuilder.addChild(selection, child); |
---|
[1411] | 1084 | taskInfos.putAll(childrenTaskInfos); |
---|
[557] | 1085 | } |
---|
| 1086 | |
---|
[1146] | 1087 | taskInfos.put(selection, new TaskInfo(selection)); |
---|
| 1088 | return selection; |
---|
[445] | 1089 | } |
---|
| 1090 | |
---|
[557] | 1091 | /** |
---|
[1146] | 1092 | * |
---|
[557] | 1093 | */ |
---|
[1146] | 1094 | private ITask reuseSelection(int maxNoOfChildren, |
---|
| 1095 | int maxDepth, |
---|
| 1096 | Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 1097 | throws Exception |
---|
[445] | 1098 | { |
---|
[1146] | 1099 | ITask selection = reuseTask(taskInfos, ISelection.class); |
---|
| 1100 | |
---|
| 1101 | if (selection == null) { |
---|
| 1102 | selection = createNewSelection(maxNoOfChildren, maxDepth, taskInfos); |
---|
[445] | 1103 | } |
---|
[557] | 1104 | |
---|
| 1105 | return selection; |
---|
[445] | 1106 | } |
---|
| 1107 | |
---|
[557] | 1108 | /** |
---|
| 1109 | * |
---|
| 1110 | */ |
---|
[1146] | 1111 | private ITask createNewIteration(int maxNoOfChildren, |
---|
| 1112 | int maxDepth, |
---|
| 1113 | Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 1114 | throws Exception |
---|
[445] | 1115 | { |
---|
[1146] | 1116 | IIteration iteration = taskFactory.createNewIteration(); |
---|
[445] | 1117 | |
---|
[1411] | 1118 | Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); |
---|
[1294] | 1119 | ITask child; |
---|
| 1120 | do { |
---|
[1411] | 1121 | childrenTaskInfos.clear(); |
---|
| 1122 | child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); |
---|
[1294] | 1123 | } |
---|
| 1124 | while ((child instanceof IOptional) || (child instanceof IIteration)); |
---|
| 1125 | |
---|
[1411] | 1126 | //((Task) child).setDescription(iteration.toString()); |
---|
[1146] | 1127 | taskBuilder.setMarkedTask(iteration, child); |
---|
[1411] | 1128 | taskInfos.putAll(childrenTaskInfos); |
---|
[557] | 1129 | |
---|
[1146] | 1130 | taskInfos.put(iteration, new TaskInfo(iteration)); |
---|
| 1131 | return iteration; |
---|
| 1132 | } |
---|
[557] | 1133 | |
---|
[1146] | 1134 | /** |
---|
| 1135 | * |
---|
| 1136 | */ |
---|
| 1137 | private ITask reuseIteration(int maxNoOfChildren, |
---|
| 1138 | int maxDepth, |
---|
| 1139 | Map<ITask, ITaskInfo> taskInfos) |
---|
| 1140 | throws Exception |
---|
| 1141 | { |
---|
| 1142 | ITask iteration = reuseTask(taskInfos, IIteration.class); |
---|
| 1143 | |
---|
| 1144 | if (iteration == null) { |
---|
| 1145 | iteration = createNewIteration(maxNoOfChildren, maxDepth, taskInfos); |
---|
[557] | 1146 | } |
---|
| 1147 | |
---|
[1146] | 1148 | return iteration; |
---|
[445] | 1149 | } |
---|
[557] | 1150 | |
---|
| 1151 | /** |
---|
| 1152 | * |
---|
| 1153 | */ |
---|
[1146] | 1154 | private ITask createNewOptional(int maxNoOfChildren, |
---|
| 1155 | int maxDepth, |
---|
| 1156 | Map<ITask, ITaskInfo> taskInfos) |
---|
[557] | 1157 | throws Exception |
---|
[445] | 1158 | { |
---|
[1146] | 1159 | IOptional optional = taskFactory.createNewOptional(); |
---|
[445] | 1160 | |
---|
[1411] | 1161 | Map<ITask, ITaskInfo> childrenTaskInfos = new HashMap<ITask, ITaskInfo>(); |
---|
[1294] | 1162 | ITask child; |
---|
| 1163 | do { |
---|
[1411] | 1164 | childrenTaskInfos.clear(); |
---|
| 1165 | child = createTaskTree(maxNoOfChildren, maxDepth - 1, childrenTaskInfos); |
---|
[1294] | 1166 | } |
---|
| 1167 | while (child instanceof IOptional); |
---|
| 1168 | |
---|
[1411] | 1169 | //((Task) child).setDescription(optional.toString()); |
---|
[1146] | 1170 | taskBuilder.setMarkedTask(optional, child); |
---|
[1411] | 1171 | taskInfos.putAll(childrenTaskInfos); |
---|
[445] | 1172 | |
---|
[1146] | 1173 | taskInfos.put(optional, new TaskInfo(optional)); |
---|
| 1174 | return optional; |
---|
| 1175 | } |
---|
[557] | 1176 | |
---|
[1146] | 1177 | /** |
---|
| 1178 | * |
---|
| 1179 | */ |
---|
| 1180 | private ITask reuseOptional(int maxNoOfChildren, |
---|
| 1181 | int maxDepth, |
---|
| 1182 | Map<ITask, ITaskInfo> taskInfos) |
---|
| 1183 | throws Exception |
---|
| 1184 | { |
---|
| 1185 | ITask optional = reuseTask(taskInfos, IOptional.class); |
---|
| 1186 | |
---|
| 1187 | if (optional == null) { |
---|
| 1188 | optional = createNewOptional(maxNoOfChildren, maxDepth, taskInfos); |
---|
| 1189 | } |
---|
| 1190 | |
---|
| 1191 | return optional; |
---|
[445] | 1192 | } |
---|
[557] | 1193 | |
---|
| 1194 | /** |
---|
[1146] | 1195 | * |
---|
[557] | 1196 | */ |
---|
[1146] | 1197 | private ITask reuseTask(Map<ITask, ITaskInfo> taskInfos, Class<? extends ITask> type) |
---|
[557] | 1198 | throws Exception |
---|
[445] | 1199 | { |
---|
[1146] | 1200 | int noOfTasks = 0; |
---|
[557] | 1201 | |
---|
[1146] | 1202 | for (Map.Entry<ITask, ITaskInfo> entry : taskInfos.entrySet()) { |
---|
| 1203 | if (type.isInstance(entry.getKey())) { |
---|
| 1204 | noOfTasks++; |
---|
[557] | 1205 | } |
---|
[445] | 1206 | } |
---|
[557] | 1207 | |
---|
[1146] | 1208 | if (noOfTasks > 0) { |
---|
| 1209 | noOfTasks = randomize(noOfTasks); |
---|
[557] | 1210 | |
---|
[1146] | 1211 | for (Map.Entry<ITask, ITaskInfo> entry : taskInfos.entrySet()) { |
---|
| 1212 | if (type.isInstance(entry.getKey())) { |
---|
| 1213 | if (--noOfTasks <= 0) { |
---|
| 1214 | return entry.getKey(); |
---|
[557] | 1215 | } |
---|
| 1216 | } |
---|
| 1217 | } |
---|
| 1218 | } |
---|
| 1219 | else { |
---|
[1146] | 1220 | return null; |
---|
[557] | 1221 | } |
---|
| 1222 | |
---|
| 1223 | throw new RuntimeException("this is an implementation error"); |
---|
[445] | 1224 | } |
---|
| 1225 | |
---|
[1146] | 1226 | /** |
---|
| 1227 | * |
---|
| 1228 | */ |
---|
| 1229 | private ITaskInstance instantiateTask(ITask task, int maxIterationCount) throws Exception { |
---|
[1294] | 1230 | ITaskInstance instance = createNewTaskInstance(task); |
---|
[1146] | 1231 | |
---|
| 1232 | if (task instanceof ISequence) { |
---|
| 1233 | for (ITask child : ((ISequence) task).getChildren()) { |
---|
[1294] | 1234 | taskBuilder.addChild |
---|
| 1235 | ((ISequenceInstance) instance, instantiateTask(child, maxIterationCount)); |
---|
[1146] | 1236 | } |
---|
| 1237 | } |
---|
| 1238 | else if (task instanceof ISelection) { |
---|
| 1239 | List<ITask> children = ((ISelection) task).getChildren(); |
---|
| 1240 | int index = randomize(children.size()); |
---|
[1294] | 1241 | taskBuilder.setChild((ISelectionInstance) instance, |
---|
| 1242 | instantiateTask(children.get(index),maxIterationCount)); |
---|
[1146] | 1243 | } |
---|
| 1244 | else if (task instanceof IIteration) { |
---|
| 1245 | int count = randomize(maxIterationCount); |
---|
| 1246 | ITask child = ((IIteration) task).getMarkedTask(); |
---|
| 1247 | |
---|
| 1248 | for (int i = 0; i < count; i++) { |
---|
[1294] | 1249 | taskBuilder.addChild |
---|
| 1250 | ((IIterationInstance) instance, instantiateTask(child, maxIterationCount)); |
---|
[1146] | 1251 | } |
---|
| 1252 | } |
---|
| 1253 | else if (task instanceof IOptional) { |
---|
| 1254 | ITask child = ((IOptional) task).getMarkedTask(); |
---|
| 1255 | |
---|
| 1256 | if (randomize(1) == 0) { |
---|
[1294] | 1257 | taskBuilder.setChild((IOptionalInstance) instance, |
---|
| 1258 | instantiateTask(child, maxIterationCount)); |
---|
[1146] | 1259 | } |
---|
| 1260 | } |
---|
| 1261 | |
---|
| 1262 | return instance; |
---|
| 1263 | } |
---|
| 1264 | |
---|
| 1265 | /** |
---|
| 1266 | * |
---|
| 1267 | */ |
---|
| 1268 | private int randomize(int max) throws Exception { |
---|
| 1269 | return randomize(0, max); |
---|
| 1270 | } |
---|
| 1271 | |
---|
| 1272 | /** |
---|
| 1273 | * |
---|
| 1274 | */ |
---|
| 1275 | private int randomize(int min, int max) throws Exception { |
---|
| 1276 | if (min > max) { |
---|
| 1277 | throw new IllegalArgumentException("min must always be smaller or equal than max"); |
---|
| 1278 | } |
---|
| 1279 | |
---|
| 1280 | int deviation = max - min; |
---|
| 1281 | int value = (int) (Math.random() * deviation); |
---|
| 1282 | |
---|
| 1283 | return value + min; |
---|
| 1284 | } |
---|
[1294] | 1285 | |
---|
| 1286 | /** |
---|
| 1287 | * |
---|
| 1288 | */ |
---|
| 1289 | protected IEventTask createNewEventTask(IEventType eventType, IEventTarget eventTarget) { |
---|
| 1290 | IEventTask eventTask = taskFactory.createNewEventTask(eventType + " --> " + eventTarget); |
---|
| 1291 | taskFactory.createNewTaskInstance(eventTask, new Event(eventType, eventTarget)); |
---|
| 1292 | return eventTask; |
---|
| 1293 | } |
---|
| 1294 | |
---|
| 1295 | /** |
---|
| 1296 | * |
---|
| 1297 | */ |
---|
| 1298 | private ITaskInstance createNewTaskInstance(ITask task) { |
---|
| 1299 | if (task instanceof IEventTask) { |
---|
| 1300 | return createNewTaskInstance((IEventTask) task); |
---|
| 1301 | } |
---|
| 1302 | else if (task instanceof ISequence) { |
---|
| 1303 | return createNewTaskInstance((ISequence) task); |
---|
| 1304 | } |
---|
| 1305 | else if (task instanceof ISelection) { |
---|
| 1306 | return createNewTaskInstance((ISelection) task); |
---|
| 1307 | } |
---|
| 1308 | else if (task instanceof IIteration) { |
---|
| 1309 | return createNewTaskInstance((IIteration) task); |
---|
| 1310 | } |
---|
| 1311 | else if (task instanceof IOptional) { |
---|
| 1312 | return createNewTaskInstance((IOptional) task); |
---|
| 1313 | } |
---|
| 1314 | |
---|
| 1315 | throw new IllegalArgumentException("unknown type of task"); |
---|
| 1316 | } |
---|
| 1317 | |
---|
| 1318 | /** |
---|
| 1319 | * |
---|
| 1320 | */ |
---|
| 1321 | private IEventTaskInstance createNewTaskInstance(IEventTask task) { |
---|
| 1322 | IEventTaskInstance existingInstance = |
---|
| 1323 | (IEventTaskInstance) task.getInstances().iterator().next(); |
---|
| 1324 | return taskFactory.createNewTaskInstance(task, existingInstance.getEvent()); |
---|
| 1325 | } |
---|
| 1326 | |
---|
| 1327 | /** |
---|
| 1328 | * |
---|
| 1329 | */ |
---|
| 1330 | private ISequenceInstance createNewTaskInstance(ISequence task) { |
---|
| 1331 | return taskFactory.createNewTaskInstance(task); |
---|
| 1332 | } |
---|
| 1333 | |
---|
| 1334 | /** |
---|
| 1335 | * |
---|
| 1336 | */ |
---|
| 1337 | private ISelectionInstance createNewTaskInstance(ISelection task) { |
---|
| 1338 | return taskFactory.createNewTaskInstance(task); |
---|
| 1339 | } |
---|
| 1340 | |
---|
| 1341 | /** |
---|
| 1342 | * |
---|
| 1343 | */ |
---|
| 1344 | private IIterationInstance createNewTaskInstance(IIteration task) { |
---|
| 1345 | return taskFactory.createNewTaskInstance(task); |
---|
| 1346 | } |
---|
| 1347 | |
---|
| 1348 | /** |
---|
| 1349 | * |
---|
| 1350 | */ |
---|
| 1351 | private IOptionalInstance createNewTaskInstance(IOptional task) { |
---|
| 1352 | return taskFactory.createNewTaskInstance(task); |
---|
| 1353 | } |
---|
| 1354 | |
---|
[445] | 1355 | } |
---|