Mailingliste - Einträge 2005


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Code Coverage


  • Subject: Re: [qftestJUI] Code Coverage
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Thu, 03 Nov 2005 14:42:01 -0000

[I'm sending this to the list again as there are some potentially
interesting answers]

Hi Michael,

what the "Stop client" node does is force the SUT to call
System.exit(), then wait 10 seconds for the process to die and if it
doesn't die, kill it explicitely. This it what causes your problem.

The clean solution to this is to use the following construct for
terminating the SUT:

+ Try
  + MPRC File->Exit
  + Wait for process to terminate (timeout 120000 = 2 minutes so
                                   Cobertura has sufficient time)
  + Catch ClientNotTerminatedException (set max error level to error)
    Stop client

Setting the max error level will cause an error to be logged if the
SUT doesn't exit cleanly.

Best regards,
    Greg

"Glicksman, Michael" <Michael_Glicksman@?.com> writes:

> Gregor,
>
> I believe we have found the issue I was having, as well as another issue of
> lesser impact.
>
>
> Issue:
>
> 1.  Cobertura is not done re-creating it's serialized file after the tests
> are done, but JUI Tests exits anyways leaving the serialized file corrupted.
>
>
> 	-We added a 60 second delay after closing the AUT through JUI Test,
> but before ending the JUI Test.  This gave Cobertura enough time to
> re-create it's serialized file.  However we feel this is only a work around,
> any ideas on how to handle this better would be greatly appreciated.
>
>
>
> Other potential Issue, of lesser magnitude:
>
> 2.   If we use File-Exit in our AUT to shut it down, Cobertura will take
> that as signal to re-generate its serialized file. However, if we use the
> Stop Client Node, which is what we would prefer to do, Cobertura does not
> re-generate its .ser file.
>
> What is the difference between the way the Stop Client Node and a File -
> Exit ( File - Exit is using System.Exit() I will verify that) through the
> AUT would work?
>
>
> Thank you for your time and patience with this.
>
> Thanks Again,
>
> Mike Glicksman
> Trevor Chandler
>
>
> -----Original Message-----
> From: Gregor Schmid [mailto:Gregor.Schmid@?.de]
> Sent: Wednesday, November 02, 2005 11:56 AM
> To: Glicksman, Michael
> Subject: Re: [qftestJUI] Code Coverage
>
>
> Hi Michael,
>
> I'm sorry, but that's for you to answer. I have no idea how Cobertura works.
>
>
> Just think completely indepentent of qftestjUI: How do you need to start
> your software so you'll get a coverage report from Cobertura?
> Put that information into a batch file (.bat) to start your software.
> Ask your developers to help you if necessary.
>
> Only once that works, get back to qftestJUI and create a "Start SUT client"
> node that uses that .bat file as the executable. Then you should be all set.
>
> Best regards,
>     Greg
>
> "Glicksman, Michael" <Michael_Glicksman@?.com> writes:
>
> > What would my script look like then?  How would I launch the SUT
> > within my script that will use my instrumented code?
> >
> > -----Original Message-----
> > From: Gregor Schmid [mailto:Gregor.Schmid@?.de]
> > Sent: Monday, October 31, 2005 12:41 AM
> > To: qftestJUI-list@?.de
> > Cc: Glicksman, Michael
> > Subject: Re: [qftestJUI] Code Coverage
> >
> >
> > Hi Michael,
> >
> > there are a few success stories in the list archive, e.g. from Scott:
> >
> > http://www.qfs.de/archive/qftest-list/2004/msg00777.html
> > http://www.qfs.de/archive/qftest-list/2004/msg00822.html
> >
> > The easiest way to integrate these with qftestJUI is to set up a
> > script that will run your SUT with the instrumented classes (if
> > instrumentation is
> > required) and store the coverage reports in the desired place.
> >
> > Then use a "Start SUT client" node from qftest to run that script and
> > you should be fine. This avoids having to build the right command line
> > in the "Start Java SUT client" node which people sometimes are having
> > difficulties with.
> >
> > Best regards,
> >     Greg
> >
> > "Glicksman, Michael" <Michael_Glicksman@?.com> writes:
> >
> > > Has anyone ever gotten code coverage reports using jui tests?  Using
> > > any code coverage tools?
> > >
> > > I have also modified my Maven scripts to use the
> > > de.qfs.apps.qftest.start.TestRunner class instead and launch it via
> > > a ant:java task, but it looks like this class does not accept the -J
> > > option, which I need to use with Cobertura.
> > >
> > > thx
> > >
> > > -----Original Message-----
> > > From: Gregor Schmid [mailto:Gregor.Schmid@?.de]
> > > Sent: Wednesday, October 26, 2005 9:19 AM
> > > To: qftestJUI-list@?.de
> > > Cc: Glicksman, Michael
> > > Subject: Re: [qftestJUI] Code Coverage
> > >
> > >
> > > Hi Michael,
> > >
> > > I can't help you directly with your problem because I don't have any
> > > experience with either maven or Cobertura, but from your description
> > > it sounds as if the problem is in your build script and not related
> > > to qftestJUI.
> > >
> > > If Cobertura needs requires code instrumentation, another
> > > possibility is that the SUT started from qftestJUI uses the
> > > non-instrumented classes instead of the instrumented ones. Try to
> > > add -dbg to the command line for qftestJUI, then look at the program
> > > output for the SUT in the qftestJUI run-log under the "Start SUT client"
> node.
> > > That may give you some hints.
> > >
> > > Best regards,
> > >     Greg
> > >
> > > "Glicksman, Michael" <Michael_Glicksman@?.com> writes:
> > >
> > > >    Hello,
> > > >
> > > >    I am trying to figure out how I can get code coverage reports using
> > > >    Cobertura.  We have a script we launch using Maven that runs the
> > > >    jui-tests and then create a Cobertura report from the results, but
> > > >    nothing but a N/A shows up in the result.  It appears as the
> > Cobertura
> > > >    serialized file gets re-created for every run, which wipes out the
> > > >    original instrumented code.
> > > >
> > > >
> > > >
> > > >    I have seen on some posts that others have been using emma, and
> > sounds
> > > >    like they figured out how to get this to work.  But there are no
> > > >    details as to how they got this to work.  Any details, settings,
> > > >    properties, etc... would help out a lot.
>
> --
> Gregor Schmid                                Gregor.Schmid@?.de
> Quality First Software GmbH                     http://www.qfs.de
> Tulpenstr. 41                                Tel: +49 8171 919870
> DE-82538 Geretsried                          Fax: +49 8171 919876
>

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Dokumentation Kaufen Gratis Testen