code coverage tool for java webstart/jnlp application
I have been searching for some time for a code coverage tool that will work with my client/sever application, but I have been unable to find a compatible tool.
My applic开发者_如何学Goation stores images on a server, then displays them though a client which is launched via java webstart/jnlp file.
Any recommendations would be appreciated. I have already tried emma & clover, with no results. open source or commercials solutions are acceptable. thanks!
Instrument the classes with any of the code coverage tools you like (e.g. cobertura, which writes a local file cobertura.ser which can then be used for the report generation in a separate step).
Then, instead of running the signed or unsigned (which wouldn't work anyway) Applet directly in the browser, use the AppletViewer environment. The viewer runs the Applet in a privileged environment, without the Java Plugin Sandbox and thus the code coverage tool can do its work and write the report file.
Many of the code coverage tools use byte-code weaving and only write their results using a shutdown hook - when the VM shuts down. That is probably not working when used in a browser, since that's a special VM. Not sure, but maybe the Java Plugin starts a separate VM for Applets which is never being shut down.
精彩评论