[RFC][icedtea-web] Test for regression of ServiceManager not setup correctly

Danesh Dadachanji ddadacha at redhat.com
Tue Feb 21 11:07:00 PST 2012


On 17/02/12 06:08 PM, Omair Majid wrote:
> On 02/17/2012 05:34 PM, Danesh Dadachanji wrote:
>> Hi,
>>
>> Here's a test that checks whether or not ServiceManager is setup
>> correctly by the time an applet constructor is called. The constructor
>> uses BasicService and will throw a NPE if it is not setup.
>>
>
> Would it be possible to extend this test to check that services are
> available in init(), start(), stop() and destroy() as well?

This is definitely a good idea, I've added checking in init/start but I 
don't see a way of reaching stop/destroy without the awt robot actually 
closing the applet window. I looked into sending a WINDOW_CLOSING event 
somehow but don't have access to the window object. When that event is 
heard, AppletInstance#destroy() is called (eventually) but the 
application instance is something we don't have access to from within 
the applet itself. I have left the methods and respective test cases 
commented out with FIXMEs, if you'd rather me remove them then let me know.

That's the main reason the killer thread is there though, if (hopefully 
once) we have a way of closing the applet, all the killer threads being 
used just to destroy the applet should be removed.

 >
> There also seem to be some spacing/indentation issues in the patch.

Ah I thought I cleaned this up before sending, fixed in this patch.

>> The test is for checking regression against this changeset:
>> http://icedtea.classpath.org/hg/icedtea-web/rev/221174bcd4ec
>>
>> Thank you very much to Jiri for helping me get this through the door!
>>
>> +2012-02-17  Danesh Dadachanji<ddadacha at redhat.com>
>> +
>> +    Adding test for regression of JNLP API accessibility in constructor
>> +    methods of applets.
>> +    * Makefile.am: Added classes.jar to classpath when compiling
>> jnlp_tests.
>> +    * tests/jnlp_tests/simple/CheckServices/: Tests ServiceManager is
>> setup
>> +    correctly when called from applet constructors.
>
> Please list all the files added or changed.
>

Done below, apologies for being lazy. =)

+2012-02-21  Danesh Dadachanji  <ddadacha at redhat.com>
+
+	Adding test for regression of JNLP API accessibility in constructor
+	methods of applets.
+	* Makefile.am: Added classes.jar to classpath when compiling jnlp_tests.
+	* tests/jnlp_tests/simple/CheckServices/resources/CheckServices.jnlp:
+	New test file added. Tests ServiceManager is setup correctly when called
+	from applet constructors.
+	* tests/jnlp_tests/simple/CheckServices/srcs/CheckServices.java: Same.
+	* 
tests/jnlp_tests/simple/CheckServices/testcases/CheckServicesTests.java:
+	Same as above.
+

> In general, am not sure how good these applet tests might be. We know
> that applets run under javaws use different code paths from applets run
> under a browser. Still it's better to have a few tests than none.

Responding to this in the reply to Jiri's email.

Thanks for the review!

Cheers,
Danesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-applet-jnlp_href.patch
Type: text/x-patch
Size: 11638 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120221/989767d1/test-applet-jnlp_href.patch 


More information about the distro-pkg-dev mailing list