Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-htmlmonitor-test/src/test/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorTest.java
r1342 r1429 423 423 assertNotNull(nodes); 424 424 425 // wait for only 9 nodes. The directly used GUI elements are 10, but one (the body) is the 426 // parent of the others. input9 is unused and must, therefore, not be logged. 427 assertEquals(9, nodes.size()); 425 // wait for all 10 GUI elements on the same page to be logged although only 9 are used 426 assertEquals(10, nodes.size()); 428 427 429 428 // get input nodes … … 433 432 assertTrue(node instanceof HTMLPageElement); 434 433 assertEquals("HTML", node.getPlatform()); 435 assertTrue(node.isUsed()); 434 435 if (!"input9".equals(((HTMLPageElement) node).getHtmlId())) { 436 assertTrue(node.isUsed()); 437 } 438 else { 439 assertFalse(node.isUsed()); 440 } 436 441 437 442 assertNotNull(guiModel.getChildren(node)); … … 462 467 assertEvent(sequence.get(7), 8, MouseClick.class, nodes.get(7), 255, 4); 463 468 assertEvent(sequence.get(8), 9, Scroll.class, body, 0, 0); 464 assertEvent(sequence.get(9), 10, MouseClick.class, nodes.get( 8), 516, 154);469 assertEvent(sequence.get(9), 10, MouseClick.class, nodes.get(9), 516, 154); 465 470 466 471 } -
trunk/autoquest-htmlmonitor/src/main/java/de/ugoe/cs/autoquest/htmlmonitor/HtmlMonitorOutputWriter.java
r1315 r1429 265 265 /** 266 266 * <p> 267 * dumps a GUI element starting with its parent GUI elements into the log file. Calls itself268 * recursively to traverse for dumping the parents first.267 * ensures that a GUI element, its parents as well as all other GUI elements on the same page 268 * are dumped 269 269 * </p> 270 270 * … … 274 274 if (!loggedGUIElements.contains(guiElement)) { 275 275 276 HtmlGUIElement parent = guiElement.getParent(); 277 String parentId = null; 278 279 if (parent != null) { 280 ensureGuiElementDumped(parent); 281 parentId = parent.getId(); 282 } 283 276 // determine the document as the whole document needs to be dumped. Ensure also that 277 // the server is dumped 278 279 HtmlGUIElement parent = guiElement; 280 HtmlDocument document = null; 281 HtmlServer server = null; 282 283 while (parent != null) { 284 if (parent instanceof HtmlDocument) { 285 document = (HtmlDocument) parent; 286 } 287 else if (parent instanceof HtmlServer) { 288 server = (HtmlServer) parent; 289 } 290 291 parent = parent.getParent(); 292 } 293 294 if (server != null) { 295 dumpGuiElement(server); 296 } 297 298 if (document != null) { 299 dumpGuiStructure(document); 300 } 301 } 302 } 303 304 /** 305 * <p> 306 * dumps the GUI structure provided by the parameter into the log file. Calls itself 307 * recursively to traverse the GUI structure. 308 * </p> 309 * 310 * @param guiStructure the GUI structure to be logged 311 */ 312 private void dumpGuiStructure(HtmlGUIElement guiStructure) { 313 dumpGuiElement(guiStructure); 314 315 if (guiStructure.getChildren() != null) { 316 for (HtmlGUIElement child : guiStructure.getChildren()) { 317 dumpGuiStructure(child); 318 } 319 } 320 } 321 322 /** 323 * <p> 324 * dumps the GUI element provided by the parameter into the log file. 325 * </p> 326 * 327 * @param guiElement the GUI element to be logged 328 */ 329 private void dumpGuiElement(HtmlGUIElement guiElement) { 330 if (!loggedGUIElements.contains(guiElement)) { 284 331 outputWriter.print("<component id=\""); 285 332 outputWriter.print(guiElement.getId()); … … 301 348 } 302 349 303 dumpParam("parent", parentId); 350 if (guiElement.getParent() != null) { 351 dumpParam("parent", guiElement.getParent().getId()); 352 } 304 353 305 354 outputWriter.println("</component>");
Note: See TracChangeset
for help on using the changeset viewer.