Thanks Thomas,

I tried what you suggested and now we have the code coverage report for
all our modules.

Thanks
Khurram

> On 1 July 2012 03:51,  <[email protected]> wrote:
>> Yes, I have moduleA, moduleB, moduleC, moduleD, moduleE and module F. I
>> run JUnit tests from module F.
>
> This is not the way the Cobertura plugin expects you to do stuff. I
> have solved this scenario with a mix if Maven and And. If you are
> interested, take a look at
> http://thomassundberg.wordpress.com/2012/02/18/test-coverage-in-a-multi-module-maven-project/
>
> HTH
> Thomas
>
>
>
>>
>> The report in the moduleF/target... directory has the required coverage
>> information. However, the coverage report in the other modules reports
>> line and code coverage as zero.
>>
>> I did try to use the aggregate option with setting it to true, to see an
>> aggregate coverage report for all modules, it gives the aggregate
>> report,
>> but again only for packages in moduleF(from where we run JUnit tests)
>> and
>> reports as zero for all other modules.
>>
>> I am trying what was suggested in the first response to this question.
>>
>> Is there a way that we generate the code coverage report for all
>> modules,
>> with out using ant and only with use of cobertura ?
>>
>> Thanks
>>
>>> Aggregated cobertura report will execute cobertura on each module and
>>> then
>>> merge the single reports. It will not help if, for example, you have
>>> tests
>>> in module A and want to have coverage of module B.
>>>
>>>
>>> On Sat, Jun 30, 2012 at 10:46 AM, Patrick Mohr <[email protected]>
>>> wrote:
>>>
>>>> On Sat, Jun 30, 2012 at 12:18 AM, Aliaksei Lahachou <
>>>> [email protected]> wrote:
>>>>
>>>> > Hi!
>>>> >
>>>> > cobertura:cobertura executes it's own lifecycle: instruments the
>>>> classes,
>>>> > instrumented classes are saved to
>>>> target/generated-classes/cobertura,
>>>> and
>>>> > executes unit tests. Instrumented classes dump coverage data to
>>>> > target/conbertura/cobertura.ser. There are two things to understand:
>>>> >
>>>> > 1. When cobertura:cobertura is executed, dependencies are not
>>>> instrumented.
>>>> > You have to have enabled instrumentation, see cobertura:instrument
>>>> goal.
>>>> > This will produce jars with instrumented classes, so be careful not
>>>> to
>>>> > distribute them.
>>>> > 2. Each module will write coverage data to it's own
>>>> > target/conbertura/cobertura.ser file. I think it's possible to
>>>> configure
>>>> > instrumentation so that all jars write to the same cobertura.ser
>>>> file,
>>>> but
>>>> > I don't know whether it's normal, and I never tried that.
>>>> >
>>>> >
>>>> I want to say that there's a cobertura target.  Something like
>>>> cobertura:aggregate that will combine the results off all the unit
>>>> tests,
>>>> for the module that's being tested.  That probably won't be what you
>>>> want,
>>>> but I think it would be a lot closer.  This is all from memory though,
>>>> so
>>>> make sure to check it's actually what you want.
>>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>
>
> --
> Thomas Sundberg
> M. Sc. in Computer Science
>
> Mobile: +46 70 767 33 15
> Blog: http://thomassundberg.wordpress.com/
> Twitter: @thomassundberg
>
> Better software through faster feedback
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to