[rfc][icedtea-web] AWTFramework and sample reproducers using it

Jiri Vanek jvanek at redhat.com
Thu Apr 25 03:16:02 PDT 2013

On 04/24/2013 07:27 PM, Jana Fabrikova wrote:


Looks good to me.
Just cosmetic changes:

ImageSeeker, componentfinder, keybvoardAction,mouseAction  - missing license
componentNotFound, awtformatexception - please format code
all jnlp and html files missing headers (yah they exists too :) and vendor RedHat should be 

findAppletByIcon - this name is to strict for it generic action
I would suggest findIcon as base method (which will find left upper corner). Then maybe 
findApplication or findWindow for rest.
And actually findIcon will sustain  my desired findPattern methods from "btw" below.
When thinking about it - marker.png should  be also available from 
tests/test-extensions/net/sourceforge/jnlp/awt(/imagesearch)  (via classLoader.getResource...(), and 
cached as final static image, so the (futre) findIcon(BufferedImage) will be overloaded by 
What do you think?

The wiki manual will be necessary for this, but can go inside as separate change set.
One possible destination  is on classpath wiki, and second may be on as package-info.java file in 
(test-extensions) net.sourceforge.jnlp.awt

In both should be just current basic info and principles. Rest shouldbe readable from javadoc (all 
possible as another change set, but javadoc looks already good to me)
Javadoc is missing in new exception classes, but I do not insists...

Btw - is there some method "findPatternOnScreens(BufferedImage 
pattern),findPatternOnImage(BufferedImage pattern, BufferedImage source) " ?  I believe they are 
somewhere as bases,[1] but I have not found them. Otherwise I looked over your shoulder during 
development and api looks clear and well described

One implementation hint:
Your testcases are laoding patterns from   - buttonIcon = ImageIO.read(new File(test_server_dir_path 
+ "/greenbutton.png")); - it is very wrong. those images (not shared with reprodcuers) MUST be in 
testcas directory, and read as clasloader.getResoource...(). Maybe that change in compilation of 
testcases (Makefile.am) will be needed (to get those images on classapth)
Of course the marker.png must be shared both in testextensions calsspath and in reproducer :(

I would suggest split the patch - to push the test framework asap (with comsetic changes applied)
And push reproducers little bit later after one more round.


One implementation ensurement - I was aware thet epiphany ( or other different suspicious browser) 
was showing new tab as hidden. Do you noted that ?
If so then I'm for disabling it in all AWT tests  in same way as you have disabled opera for some JS 

Thanx for all the work on this!

As some further patch some tests to this extensions will be worthy.

[1] found! Sorry findExactImage/blurred iamge! And as screenshot is oneline of code I do nt think it 
(the findPatternOnScreens(BufferedImage pattern)) is worthy of labour. Sorry.

> Hi,
> the big AWTFramework patch is in the attachment, together with three
> pictures used by the reproducers.
> Thanks for any comments,
> Jana
> ChangeLog:
> 2013-04-24  Jana Fabrikova  <jfabriko at redhat.com>
> * /tests/test-extensions/net/sourceforge/jnlp/closinglisteners/RulesFolowingClosingListener.java:
> 	added a getter method getRules
> 	* tests/test-extensions/net/sourceforge/jnlp/awt/AWTHelper.java:
> 	the most important class of AWTFramework, combines closing listener and
> 	possibility to use mouse and keyboard for input to tests
> 	*
> tests/test-extensions/net/sourceforge/jnlp/awt/AWTFrameworkException.java:
> 	exception that is raised in the framework whenever programmer did not
> 	provide enough information
> 	*
> tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/KeyboardActions.java:
> 	class with utility keyboard methods
> 	*
> tests/test-extensions/net/sourceforge/jnlp/awt/awtactions/MouseActions.java:
> 	class with utility mouse methods
> 	*
> tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentFinder.java:
> 	class for finding components in a screenshot
> 	*
> tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ComponentNotFoundException.java:
> 	exception that can be raised if an important component could not be
> found
> 	*
> tests/test-extensions/net/sourceforge/jnlp/awt/imagesearch/ImageSeeker.java:
> 	class for general image searching
> 	* tests/reproducers/simple/AWTCommonResourcesOnly/resources/marker.png:
> 	reproducer with resources only, contains the default icon marking
> 	applets
> 	1st reproducer: browser tests for mouse clicking on a button in applet,
> 	applet is found using an icon, button is found using colors and in
> 	one case also icon - greenbutton.png
> 	*
> tests/reproducers/simple/AppletAWTRobotUsageSample/resources/AppletAWTRobotUsageSample.html:
> 	*
> tests/reproducers/simple/AppletAWTRobotUsageSample/resources/applet-awtrobot-usage-sample.jnlp:
> 	*
> tests/reproducers/simple/AppletAWTRobotUsageSample/resources/greenbutton.png
> 	*
> tests/reproducers/simple/AppletAWTRobotUsageSample/srcs/AppletAWTRobotUsageSample.java:
> 	*
> tests/reproducers/simple/AppletAWTRobotUsageSample/testcases/AppletAWTRobotUsageSampleTest.java:
> 	2nd reproducer: javaws tests - the same as above, only buttons found
>   	by color
> 	*
> tests/reproducers/simple/JavawsAWTRobotUsageSample/resources/javaws-awtrobot-usage-sample.jnlp:
> 	*
> tests/reproducers/simple/JavawsAWTRobotUsageSample/srcs/JavawsAWTRobotUsageSample.java:
> 	*
> tests/reproducers/simple/JavawsAWTRobotUsageSample/testcases/JavawsAWTRobotUsageSampleTest.java:
> 	3rd reproducer: javaws tests - applet with two labeled buttons,
> 	the applet is found using an icon,
> 	mouse finds the button ButtonA by serching for icon buttonA.png
> 	*
> tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/buttonA.png:
> 	*
> tests/reproducers/simple/JavawsAWTRobotFindsButton/resources/javaws-awtrobot-finds-button.jnlp:
> 	*
> tests/reproducers/simple/JavawsAWTRobotFindsButton/srcs/JavawsAWTRobotFindsButton.java:
> 	*
> tests/reproducers/simple/JavawsAWTRobotFindsButton/testcases/JavawsAWTRobotFindsButtonTest.java:

More information about the distro-pkg-dev mailing list