From: Mark D. <Mar...@sa...> - 2005-06-29 14:20:50
|
I'm not really sure how applets work... Normally the cobertura.ser file = is updated only when the JVM exits. So if you access the applet from a = web browser, would you have to exit the web browser to cause the JVM to = be killed? Also, applets run on the machine you access them with, not = the machine they're served from, right? (So the cobertura.ser would be = written to the client's hard drive.) I have a feeling they're the same = in this case, but that might be something to look out for. -Mark=20 > -----Original Message----- > From: cob...@li...=20 > [mailto:cob...@li...] On=20 > Behalf Of Mick Francis > Sent: Wednesday, June 29, 2005 10:06 AM > To: 'cob...@li...' > Subject: [Cobertura-devel] Use with Applets >=20 > Sorry if this is a dumb question, but how can I get cobertura=20 > to work with a > JApplet? > It just doesn't seem to write to the cobertura.ser file. I've done the > following: >=20 > 1) Added: > -Dnet.sourceforge.cobertura.datafile=3DC:/cobertura.ser > to the java runtime params in the plugin control panel,=20 > and checked that > System.getProperty("net.sourceforge.cobertura.datafile") agrees. >=20 > 2) The Applet is in a signed jar along with all the other=20 > classes that are > required. If > I add a "public static main(String[] args) {...}" method,=20 > and run this > from the command > line, the cobertura.ser file is accessed as it should be. >=20 > The Applet is able to create and write to files as part of its > functionality, so this > isn't the issue. >=20 > 3) I've searched all my drives for cobertura.ser files, and=20 > there are no > others. >=20 > Any help very gratefully received! >=20 > Thanks, >=20 > Mick. >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 > This message has been scanned for viruses by MailController -=20 > www.MailController.altohiway.com >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. = http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dclick > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel >=20 |
From: Mick F. <mic...@li...> - 2005-06-29 14:29:35
|
Hi Jeremy, Thanks for the reply. The Applet runs in Internet Explorer. I've looked at the .class files in the .jar, and they all contain instrumentation. The fact that it works when I run the 'main' method (added for testing) from the command line (using exactly the same .jar file) implies to me that the problem lies somewhere in the Applet mechanism... Mick. -----Original Message----- From: Jeremy Thomerson [mailto:jer...@gm...] Sent: 29 June 2005 15:27 To: Mark Doliner Cc: Mick Francis; cob...@li... Subject: Re: [Cobertura-devel] Use with Applets I guess to follow up on this to see if we can help, the most important question would be: how are you running the applet? 98% of the time when we get these questions (although we haven't necessarily had any for an applet yet), it's that the instrumented classes either aren't in the runtime classpath or are below the un-instrumented classes. Have you verified that the classes in your jar are the instrumented ones? Jeremy Thomerson On 6/29/05, Mark Doliner < Mar...@sa... <mailto:Mar...@sa...> > wrote: I'm not really sure how applets work... Normally the cobertura.ser file is updated only when the JVM exits. So if you access the applet from a web browser, would you have to exit the web browser to cause the JVM to be killed? Also, applets run on the machine you access them with, not the machine they're served from, right? (So the cobertura.ser would be written to the client's hard drive.) I have a feeling they're the same in this case, but that might be something to look out for. -Mark > -----Original Message----- > From: cob...@li... <mailto:cob...@li...> > [mailto: cob...@li... <mailto:cob...@li...> ] On > Behalf Of Mick Francis > Sent: Wednesday, June 29, 2005 10:06 AM > To: ' cob...@li... <mailto:cob...@li...> ' > Subject: [Cobertura-devel] Use with Applets > > Sorry if this is a dumb question, but how can I get cobertura > to work with a > JApplet? > It just doesn't seem to write to the cobertura.ser file. I've done the > following: > > 1) Added: > -Dnet.sourceforge.cobertura.datafile=C:/cobertura.ser > to the java runtime params in the plugin control panel, > and checked that > System.getProperty("net.sourceforge.cobertura.datafile") agrees. > > 2) The Applet is in a signed jar along with all the other > classes that are > required. If > I add a "public static main(String[] args) {...}" method, > and run this > from the command > line, the cobertura.ser file is accessed as it should be. > > The Applet is able to create and write to files as part of its > functionality, so this > isn't the issue. > > 3) I've searched all my drives for cobertura.ser files, and > there are no > others. > > Any help very gratefully received! > > Thanks, > > Mick. > > > > > > > > > > This message has been scanned for viruses by MailController - > www.MailController.altohiway.com <http://www.MailController.altohiway.com> > > > ------------------------------------------------------- > SF.Net <http://SF.Net> email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477 <http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click> &alloc_id=16492&op=click > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... <mailto:Cob...@li...> > https://lists.sourceforge.net/lists/listinfo/cobertura-devel <https://lists.sourceforge.net/lists/listinfo/cobertura-devel> > ------------------------------------------------------- SF.Net <http://SF.Net> email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77 <http://ads.osdn.com/?ad_idt77&alloc_id492&opclick> &alloc_id492&opclick _______________________________________________ Cobertura-devel mailing list Cob...@li... <mailto:Cob...@li...> https://lists.sourceforge.net/lists/listinfo/cobertura-devel <https://lists.sourceforge.net/lists/listinfo/cobertura-devel> |
From: Jared R. <Jar...@sa...> - 2005-06-29 14:35:05
|
Try downloading HotJava from Sun. It has a much cleaner applet = implementation and might get the ser file. I haven't tried this, but for = coverage purposes, it shouldn't matter which browser you use, right? =20 http://java.sun.com/products/archive/hotjava/ =20 Jared Ship It! is shipping! http://www.jaredrichardson.net <http://www.jaredrichardson.net>=20 http://www.pragmaticprogrammer.com/titles/prj/ = <http://www.pragmaticprogrammer.com/titles/prj/>=20 ________________________________ From: cob...@li... = [mailto:cob...@li...] On Behalf Of Mick = Francis Sent: Wednesday, June 29, 2005 10:28 AM To: 'je...@th...'; Mark Doliner Cc: cob...@li... Subject: RE: [Cobertura-devel] Use with Applets =09 =09 Hi Jeremy, =20 Thanks for the reply. =20 The Applet runs in Internet Explorer. I've looked at the .class files = in the .jar, and they all contain instrumentation. The fact that it = works when I run the 'main' method (added for testing) from the command = line (using exactly the same .jar file) implies to me that the problem = lies somewhere in the Applet mechanism... =20 Mick. -----Original=20 |
From: Mick F. <mic...@li...> - 2005-06-29 14:51:14
|
Hi Jared, Thanks for the reply. While I was downloading HotJava, I thought I'd try a 'hack' and put a System.exit(0) in the destroy() method of the Applet, and it worked! Clearly this is no good for normal running, but I can enable the System.exit(0) in a properties file when it comes to test time. I wonder if there's a method in the cobertura classes I can call to force the writing rather than it waiting for exit? That way I could just test for the existence of the class, and call the method if it's there - no properties file jiggery-pokery that way... Regards, Mick. -----Original Message----- From: Jared Richardson [mailto:Jar...@sa...] Sent: 29 June 2005 15:35 To: Mick Francis; je...@th...; Mark Doliner Cc: cob...@li... Subject: RE: [Cobertura-devel] Use with Applets Try downloading HotJava from Sun. It has a much cleaner applet implementation and might get the ser file. I haven't tried this, but for coverage purposes, it shouldn't matter which browser you use, right? http://java.sun.com/products/archive/hotjava/ <http://java.sun.com/products/archive/hotjava/> Jared Ship It! is shipping! <http://www.jaredrichardson.net> http://www.jaredrichardson.net <http://www.pragmaticprogrammer.com/titles/prj/> http://www.pragmaticprogrammer.com/titles/prj/ _____ From: cob...@li... [mailto:cob...@li...] On Behalf Of Mick Francis Sent: Wednesday, June 29, 2005 10:28 AM To: 'je...@th...'; Mark Doliner Cc: cob...@li... Subject: RE: [Cobertura-devel] Use with Applets Hi Jeremy, Thanks for the reply. The Applet runs in Internet Explorer. I've looked at the .class files in the .jar, and they all contain instrumentation. The fact that it works when I run the 'main' method (added for testing) from the command line (using exactly the same .jar file) implies to me that the problem lies somewhere in the Applet mechanism... Mick. -----Original This message has been scanned for viruses by MailController - www.MailController.altohiway.com |
From: Mark D. <Mar...@sa...> - 2005-06-29 14:56:55
|
The static method = net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(= ) should cause the currently bufferred coverage data to be flushed to = cobertura.ser (or whichever file you've specified), if it helps -Mark=20 > -----Original Message----- > From: Mick Francis [mailto:mic...@li...]=20 > Sent: Wednesday, June 29, 2005 10:50 AM > To: Jared Richardson; je...@th...; Mark Doliner > Cc: cob...@li... > Subject: RE: [Cobertura-devel] Use with Applets >=20 > Hi Jared, > =20 > Thanks for the reply. > =20 > While I was downloading HotJava, I thought I'd try a 'hack'=20 > and put a System.exit(0) in the destroy() method of the=20 > Applet, and it worked! > Clearly this is no good for normal running, but I can enable=20 > the System.exit(0) in a properties file when it comes to test time. > =20 > I wonder if there's a method in the cobertura classes I can=20 > call to force the writing rather than it waiting for exit?=20 > That way I could just test for the existence of the class,=20 > and call the method if it's there - no properties file=20 > jiggery-pokery that way... > =20 > Regards, > =20 > Mick. >=20 > -----Original Message----- > From: Jared Richardson [mailto:Jar...@sa...] > Sent: 29 June 2005 15:35 > To: Mick Francis; je...@th...; Mark Doliner > Cc: cob...@li... > Subject: RE: [Cobertura-devel] Use with Applets > =09 > =09 > Try downloading HotJava from Sun. It has a much cleaner=20 > applet implementation and might get the ser file. I haven't=20 > tried this, but for coverage purposes, it shouldn't matter=20 > which browser you use, right? > =20 > http://java.sun.com/products/archive/hotjava/ > =20 > Jared >=20 > Ship It! is shipping! > http://www.jaredrichardson.net <http://www.jaredrichardson.net>=20 > http://www.pragmaticprogrammer.com/titles/prj/=20 > <http://www.pragmaticprogrammer.com/titles/prj/>=20 >=20 >=20 > ________________________________ >=20 > From:=20 > cob...@li...=20 > [mailto:cob...@li...] On=20 > Behalf Of Mick Francis > Sent: Wednesday, June 29, 2005 10:28 AM > To: 'je...@th...'; Mark Doliner > Cc: cob...@li... > Subject: RE: [Cobertura-devel] Use with Applets > =09 > =09 > Hi Jeremy, > =20 > Thanks for the reply. > =20 > The Applet runs in Internet Explorer. I've=20 > looked at the .class files in the .jar, and they all contain=20 > instrumentation. The fact that it works when I run the 'main'=20 > method (added for testing) from the command line (using=20 > exactly the same .jar file) implies to me that the problem=20 > lies somewhere in the Applet mechanism... > =20 > Mick. >=20 > -----Original=20 >=20 >=20 >=20 >=20 > This message has been scanned for viruses by MailController=20 > <http://www.mailcontroller.altohiway.com/> . >=20 >=20 |
From: Mick F. <mic...@li...> - 2005-06-29 15:00:09
|
Great - thanks Mark, Mick. > -----Original Message----- > From: Mark Doliner [mailto:Mar...@sa...] > Sent: 29 June 2005 15:57 > To: Mick Francis > Cc: cob...@li... > Subject: RE: [Cobertura-devel] Use with Applets > > > The static method > net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalP > rojectData() should cause the currently bufferred coverage > data to be flushed to cobertura.ser (or whichever file you've > specified), if it helps > -Mark > > > -----Original Message----- > > From: Mick Francis [mailto:mic...@li...] > > Sent: Wednesday, June 29, 2005 10:50 AM > > To: Jared Richardson; je...@th...; Mark Doliner > > Cc: cob...@li... > > Subject: RE: [Cobertura-devel] Use with Applets > > > > Hi Jared, > > > > Thanks for the reply. > > > > While I was downloading HotJava, I thought I'd try a 'hack' > > and put a System.exit(0) in the destroy() method of the > > Applet, and it worked! > > Clearly this is no good for normal running, but I can enable > > the System.exit(0) in a properties file when it comes to test time. > > > > I wonder if there's a method in the cobertura classes I can > > call to force the writing rather than it waiting for exit? > > That way I could just test for the existence of the class, > > and call the method if it's there - no properties file > > jiggery-pokery that way... > > > > Regards, > > > > Mick. > > > > -----Original Message----- > > From: Jared Richardson [mailto:Jar...@sa...] > > Sent: 29 June 2005 15:35 > > To: Mick Francis; je...@th...; Mark Doliner > > Cc: cob...@li... > > Subject: RE: [Cobertura-devel] Use with Applets > > > > > > Try downloading HotJava from Sun. It has a much cleaner > > applet implementation and might get the ser file. I haven't > > tried this, but for coverage purposes, it shouldn't matter > > which browser you use, right? > > > > http://java.sun.com/products/archive/hotjava/ > > > > Jared > > > > Ship It! is shipping! > > http://www.jaredrichardson.net <http://www.jaredrichardson.net> > > http://www.pragmaticprogrammer.com/titles/prj/ > > <http://www.pragmaticprogrammer.com/titles/prj/> > > > > > > ________________________________ > > > > From: > > cob...@li... > > [mailto:cob...@li...] On > > Behalf Of Mick Francis > > Sent: Wednesday, June 29, 2005 10:28 AM > > To: 'je...@th...'; Mark Doliner > > Cc: cob...@li... > > Subject: RE: [Cobertura-devel] Use with Applets > > > > > > Hi Jeremy, > > > > Thanks for the reply. > > > > The Applet runs in Internet Explorer. I've > > looked at the .class files in the .jar, and they all contain > > instrumentation. The fact that it works when I run the 'main' > > method (added for testing) from the command line (using > > exactly the same .jar file) implies to me that the problem > > lies somewhere in the Applet mechanism... > > > > Mick. > > > > -----Original > > > > > > > > > > This message has been scanned for viruses by MailController > > <http://www.mailcontroller.altohiway.com/> . > > > > > |
From: Mick F. <mic...@li...> - 2005-06-29 16:04:59
|
Thanks everyone for input on this. In the end I opted for the following in my applet: /** * If we're running a cobertura-instrumented Applet, we need to flush out the data, as not all Browsers * call System.exit(0), which is the normal flush trigger. If the cobertura classes are not available * we do nothing - this is the normal situation. */ public void destroy() { try { Class c = Class.forName("net.sourceforge.cobertura.coveragedata.ProjectData"); Method m = c.getMethod("saveGlobalProjectData", new Class[0]); m.invoke(null, new Object[0]); } catch (Exception e) {} } Regards, Mick. > -----Original Message----- > From: Mark Doliner [mailto:Mar...@sa...] > Sent: 29 June 2005 15:57 > To: Mick Francis > Cc: cob...@li... > Subject: RE: [Cobertura-devel] Use with Applets > > > The static method > net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalP > rojectData() should cause the currently bufferred coverage > data to be flushed to cobertura.ser (or whichever file you've > specified), if it helps > -Mark > > > -----Original Message----- > > From: Mick Francis [mailto:mic...@li...] > > Sent: Wednesday, June 29, 2005 10:50 AM > > To: Jared Richardson; je...@th...; Mark Doliner > > Cc: cob...@li... > > Subject: RE: [Cobertura-devel] Use with Applets > > > > Hi Jared, > > > > Thanks for the reply. > > > > While I was downloading HotJava, I thought I'd try a 'hack' > > and put a System.exit(0) in the destroy() method of the > > Applet, and it worked! > > Clearly this is no good for normal running, but I can enable > > the System.exit(0) in a properties file when it comes to test time. > > > > I wonder if there's a method in the cobertura classes I can > > call to force the writing rather than it waiting for exit? > > That way I could just test for the existence of the class, > > and call the method if it's there - no properties file > > jiggery-pokery that way... > > > > Regards, > > > > Mick. > > > > -----Original Message----- > > From: Jared Richardson [mailto:Jar...@sa...] > > Sent: 29 June 2005 15:35 > > To: Mick Francis; je...@th...; Mark Doliner > > Cc: cob...@li... > > Subject: RE: [Cobertura-devel] Use with Applets > > > > > > Try downloading HotJava from Sun. It has a much cleaner > > applet implementation and might get the ser file. I haven't > > tried this, but for coverage purposes, it shouldn't matter > > which browser you use, right? > > > > http://java.sun.com/products/archive/hotjava/ > > > > Jared > > > > Ship It! is shipping! > > http://www.jaredrichardson.net <http://www.jaredrichardson.net> > > http://www.pragmaticprogrammer.com/titles/prj/ > > <http://www.pragmaticprogrammer.com/titles/prj/> > > > > > > ________________________________ > > > > From: > > cob...@li... > > [mailto:cob...@li...] On > > Behalf Of Mick Francis > > Sent: Wednesday, June 29, 2005 10:28 AM > > To: 'je...@th...'; Mark Doliner > > Cc: cob...@li... > > Subject: RE: [Cobertura-devel] Use with Applets > > > > > > Hi Jeremy, > > > > Thanks for the reply. > > > > The Applet runs in Internet Explorer. I've > > looked at the .class files in the .jar, and they all contain > > instrumentation. The fact that it works when I run the 'main' > > method (added for testing) from the command line (using > > exactly the same .jar file) implies to me that the problem > > lies somewhere in the Applet mechanism... > > > > Mick. > > > > -----Original > > > > > > > > > > This message has been scanned for viruses by MailController > > <http://www.mailcontroller.altohiway.com/> . > > > > > |
From: Jeremy T. <jer...@gm...> - 2005-06-29 14:26:55
|
I guess to follow up on this to see if we can help, the most important=20 question would be: how are you running the applet? 98% of the time when we= =20 get these questions (although we haven't necessarily had any for an applet= =20 yet), it's that the instrumented classes either aren't in the runtime=20 classpath or are below the un-instrumented classes. Have you verified that= =20 the classes in your jar are the instrumented ones? Jeremy Thomerson On 6/29/05, Mark Doliner <Mar...@sa...> wrote:=20 >=20 > I'm not really sure how applets work... Normally the cobertura.ser file i= s=20 > updated only when the JVM exits. So if you access the applet from a web= =20 > browser, would you have to exit the web browser to cause the JVM to be=20 > killed? Also, applets run on the machine you access them with, not the=20 > machine they're served from, right? (So the cobertura.ser would be writte= n=20 > to the client's hard drive.) I have a feeling they're the same in this ca= se,=20 > but that might be something to look out for. >=20 > -Mark >=20 > > -----Original Message----- > > From: cob...@li... > > [mailto:cob...@li...] On > > Behalf Of Mick Francis > > Sent: Wednesday, June 29, 2005 10:06 AM > > To: 'cob...@li...' > > Subject: [Cobertura-devel] Use with Applets > > > > Sorry if this is a dumb question, but how can I get cobertura > > to work with a > > JApplet? > > It just doesn't seem to write to the cobertura.ser file. I've done the > > following: > > > > 1) Added: > > -Dnet.sourceforge.cobertura.datafile=3DC:/cobertura.ser > > to the java runtime params in the plugin control panel, > > and checked that > > System.getProperty("net.sourceforge.cobertura.datafile") agrees. > > > > 2) The Applet is in a signed jar along with all the other > > classes that are > > required. If > > I add a "public static main(String[] args) {...}" method, > > and run this > > from the command > > line, the cobertura.ser file is accessed as it should be. > > > > The Applet is able to create and write to files as part of its > > functionality, so this > > isn't the issue. > > > > 3) I've searched all my drives for cobertura.ser files, and > > there are no > > others. > > > > Any help very gratefully received! > > > > Thanks, > > > > Mick. > > > > > > > > > > > > > > > > > > > > This message has been scanned for viruses by MailController - > > www.MailController.altohiway.com<http://www.MailController.altohiway.co= m> > > > > > > ------------------------------------------------------- > > SF.Net <http://SF.Net> email is sponsored by: Discover Easy Linux=20 > Migration Strategies > > from IBM. Find simple to follow Roadmaps, straightforward articles, > > informative Webcasts and more! Get everything you need to get up to > > speed, fast. http://ads.osdn.com/?ad_id=3D7477&alloc_id=3D16492&op=3Dcl= ick > > _______________________________________________ > > Cobertura-devel mailing list > > Cob...@li... > > https://lists.sourceforge.net/lists/listinfo/cobertura-devel > > >=20 >=20 > ------------------------------------------------------- > SF.Net <http://SF.Net> email is sponsored by: Discover Easy Linux=20 > Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick > _______________________________________________ > Cobertura-devel mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobertura-devel >=20 >=20 > |