Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

[abbot-users] [abbot - Developers] Costello slowing down while

From:"SourceForge.net" [noreply@masked-domain]
Sent on:Wed, 23 Apr 2008 01:25:11 -0700

Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4922509
By: jvdp00

Hello,

I'm currently automating the insertion of assertions for a complete dialog:
basically I'm looking iteratively for all components in a dialog, and for certain
types (textfield, combo, checkbox, ...) I'm adding a couple of tests automatically.
It is already working fine, except for the fact that the process is slowing
down after a few dialogs. For a first dialog, it is very fast, say 50 tests
in a couple of seconds. For the next dialog it is still ok. For a 3rd dialog
I have to wait maybe one minute, and the time is further increasing
exponentially.

I have tried to find where the time goes to:

- One problem was the automatic highlighting of the last inserted test in the
List. This step is not necessary since many other tests will be inserted afterwards.
I could exclude it by commenting the following lines in method "addStep(Step
step)" of ScriptEditor:
scriptTable.setRowSelectionInterval(row, row);
scriptTable.setCursorLocation(row + 1);
setActionsEnabledState();
The same piece of code could be used after inserting all the tests.

- The other problem that I cannot solve is somewhere in the stack of method
"getComponentReference(Component comp)" of ScriptEditor. This function has to
be called for each component for which an assertion will be added. When digging
into it I found out that most of the time goes to one method "matchExisting(final
Component comp, Collection existing)" of ComponentReference, and more specifically
in the following while loop:
while (iter.hasNext()) {
ComponentReference ref = (ComponentReference)iter.next();
if (comp == ref.getCachedLookup(ref.resolver.getHierarchy())
|| comp == ref.resolveComponent(comp, empty)) {
matches.put(ref, Boolean.TRUE);
}
}
It looks to me that some maps are rebuilt every time for each component for
which the reference has to be found, and this takes more and more time because
some maps get bigger and bigger when more and more dialogs are in use.

I'm afraid that I know too little of the code to find a more efficient way to
get references for all the components in the dialog. Could there be some procedure
taking advantage of the fact that all components are in the same hierarchy under
the selected dialog, and that they do not change during the insertion of the
many tests?

Any help would be highly appreciated!

Joost



______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=168263

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
abbot-users mailing list
[abbot-users@masked-domain]
https://lists.sourceforge.net/lists/listinfo/abbot-users
Found what you were looking for? If not - continue at Wiki Index

 
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources
FitNesse Resources