Re: [m2] cobertura code coverage for dbunit test classes with testNG and OpenJPA?

2008-04-15 Thread Mick Knutson
I am still having an issue with this...
Can someone please help me track down the issue here? I do not get any
errors, but I just get no test coverage (everything is at zero).


On Mon, Mar 31, 2008 at 1:32 PM, Mick Knutson <[EMAIL PROTECTED]> wrote:

> So I am still having this intermittant issue.
> I looked at http://mojo.codehaus.org/cobertura-maven-plugin/usage.html and
> have a small question about the
>
> clean
>
> So does this mean that cobertura instruments the code during the clean?
>
> I am suspecting that there is an issue with my openJPA plugin trying to
> run some instrumentation (or something) on my code. Is this conflicting with
> Cobertura?
>
>
>
>
> On Mon, Mar 24, 2008 at 10:42 AM, Mick Knutson <[EMAIL PROTECTED]>
> wrote:
>
> > So I need to mention again, I am using the openJPA plugin to enhance the
> > byte code in this project.
> >
> > But it seems strange. I uncommented check then got an error
> > as I am under 25% coverage (as expected), then commented it out again so the
> > site:site would complete. Then BAM! I got my coverage report.
> >
> > Then I ran another clean install, and the report stopped again. So I
> > uncommented check, ran the build again that failed, commented
> > check again, and BAM it worked again.
> >
> > I am not fully sure whate the trick is, but it seems I need to not clean
> > the build, and run the plugin with check in order to make this
> > work.
> >
> > Has anyone run into this as well?
> >
> >
> > On Mon, Mar 24, 2008 at 4:20 AM, Erez Nahir <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Hi Mick,
> > >
> > > We have surefire 2.4.2 + testng + cobertura 2.2 works.
> > > Your cofiguration looks fine to me, but, I'm missing the cobertura
> > > definition in the  section.
> > > The only difference I see from out build (other then the need to add
> > > cobertuar to reporting section) is usage of ${basedir} as value. Try
> > > to
> > > remove it, I know surefire has some issues passing values of
> > > ${properties}.
> > >
> > > Here is what we have:
> > > In surefire plugin:
> > >
> > > net.sourceforge.cobertura.datafile
> > >  target/cobertura/cobertura.ser
> > >   
> > > 
> > > In the reporting section:
> > >  
> > > 
> > > ...
> > > ...
> > >  
> > >org.codehaus.mojo
> > > cobertura-maven-plugin
> > >2.2
> > >   
> > >
> > >  
> > > HTH,
> > > Erez.
> > > On Sun, Mar 23, 2008 at 12:48 PM, Mick Knutson <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > Anyone have any ideas?
> > > > I have tried cobertura 2.0 and 2.2 maven plugin and still the same
> > > result.
> > > >
> > > >
> > > > On Fri, Mar 21, 2008 at 2:36 PM, Mick Knutson <[EMAIL PROTECTED]
> > > >
> > > > wrote:
> > > >
> > > > > I have a Spring, OpenJPA, DBUnit, TestNG, HSQL build with Maven
> > > 2.0.8and
> > > > > there are 20 DAO tests that now pass. I am trying to now add
> > > cobertura
> > > > to
> > > > > this. I have used Cobertura extensively in the past, but never
> > > with
> > > > DBUnit.
> > > > >
> > > > > So, I am getting the report to generate, but everything is zero.
> > > So it
> > > > > appears that nothing was instrumented.
> > > > > Here is my surefire and cobertura plugins:
> > > > >
> > > > > 
> > > > > 
> > > > >
> > > maven-surefire-report-plugin
> > > > > 2.4.2
> > > > > 
> > > > > 
> > > > > **/*.java
> > > > > 
> > > > > 
> > > > > **/*Point*.java
> > > > > 
> > > > > 
> > > > > 
> > > > >
> > > net.sourceforge.cobertura.datafile
> > > > > 
> > > > >
> > > > > ${basedir}/target/cobertura/cobertura.ser
> > > > > 
> > > > > 
> > > > > -Xmx256m
> > > > > true
> > > > > 
> > > > > 
> > > > >
> > > > > ...
> > > > >
> > > > >
> > > > > 
> > > > > org.codehaus.mojo
> > > > > dbunit-maven-plugin
> > > > > 1.0-beta-1
> > > > > 
> > > > >
> > > ${dbunit.dataTypeFactoryName
> > > > > }
> > > > > ${jdbc.driverClassName}
> > > > > ${jdbc.username}
> > > > > ${jdbc.password}
> > > > > ${jdbc.url}
> > > > > src/test/resources/test-data.xml
> > > > > ${dbunit.operation.type}
> > > > > ${dbunit.schema}
> > > > > ${maven.test.skip}
> > > > > 
> > > > > 
> > > > > 
> > > > > test-compile
> > > > > 
> > > > > operation
> > > > > 
> > > > >   

Re: [m2] cobertura code coverage for dbunit test classes with testNG and OpenJPA?

2008-03-31 Thread Mick Knutson
So I am still having this intermittant issue.
I looked at http://mojo.codehaus.org/cobertura-maven-plugin/usage.html and
have a small question about the

clean

So does this mean that cobertura instruments the code during the clean?

I am suspecting that there is an issue with my openJPA plugin trying to run
some instrumentation (or something) on my code. Is this conflicting with
Cobertura?



On Mon, Mar 24, 2008 at 10:42 AM, Mick Knutson <[EMAIL PROTECTED]>
wrote:

> So I need to mention again, I am using the openJPA plugin to enhance the
> byte code in this project.
>
> But it seems strange. I uncommented check then got an error
> as I am under 25% coverage (as expected), then commented it out again so the
> site:site would complete. Then BAM! I got my coverage report.
>
> Then I ran another clean install, and the report stopped again. So I
> uncommented check, ran the build again that failed, commented
> check again, and BAM it worked again.
>
> I am not fully sure whate the trick is, but it seems I need to not clean
> the build, and run the plugin with check in order to make this
> work.
>
> Has anyone run into this as well?
>
>
> On Mon, Mar 24, 2008 at 4:20 AM, Erez Nahir <[EMAIL PROTECTED]> wrote:
>
> > Hi Mick,
> >
> > We have surefire 2.4.2 + testng + cobertura 2.2 works.
> > Your cofiguration looks fine to me, but, I'm missing the cobertura
> > definition in the  section.
> > The only difference I see from out build (other then the need to add
> > cobertuar to reporting section) is usage of ${basedir} as value. Try to
> > remove it, I know surefire has some issues passing values of
> > ${properties}.
> >
> > Here is what we have:
> > In surefire plugin:
> >
> > net.sourceforge.cobertura.datafile
> >  target/cobertura/cobertura.ser
> >   
> > 
> > In the reporting section:
> >  
> > 
> > ...
> > ...
> >  
> >org.codehaus.mojo
> > cobertura-maven-plugin
> >2.2
> >   
> >
> >  
> > HTH,
> > Erez.
> > On Sun, Mar 23, 2008 at 12:48 PM, Mick Knutson <[EMAIL PROTECTED]>
> > wrote:
> >
> > > Anyone have any ideas?
> > > I have tried cobertura 2.0 and 2.2 maven plugin and still the same
> > result.
> > >
> > >
> > > On Fri, Mar 21, 2008 at 2:36 PM, Mick Knutson <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > I have a Spring, OpenJPA, DBUnit, TestNG, HSQL build with Maven
> > 2.0.8and
> > > > there are 20 DAO tests that now pass. I am trying to now add
> > cobertura
> > > to
> > > > this. I have used Cobertura extensively in the past, but never with
> > > DBUnit.
> > > >
> > > > So, I am getting the report to generate, but everything is zero. So
> > it
> > > > appears that nothing was instrumented.
> > > > Here is my surefire and cobertura plugins:
> > > >
> > > > 
> > > > 
> > > >
> > maven-surefire-report-plugin
> > > > 2.4.2
> > > > 
> > > > 
> > > > **/*.java
> > > > 
> > > > 
> > > > **/*Point*.java
> > > > 
> > > > 
> > > > 
> > > > net.sourceforge.cobertura.datafile
> > > > 
> > > >
> > > > ${basedir}/target/cobertura/cobertura.ser
> > > > 
> > > > 
> > > > -Xmx256m
> > > > true
> > > > 
> > > > 
> > > >
> > > > ...
> > > >
> > > >
> > > > 
> > > > org.codehaus.mojo
> > > > dbunit-maven-plugin
> > > > 1.0-beta-1
> > > > 
> > > > ${
> > dbunit.dataTypeFactoryName
> > > > }
> > > > ${jdbc.driverClassName}
> > > > ${jdbc.username}
> > > > ${jdbc.password}
> > > > ${jdbc.url}
> > > > src/test/resources/test-data.xml
> > > > ${dbunit.operation.type}
> > > > ${dbunit.schema}
> > > > ${maven.test.skip}
> > > > 
> > > > 
> > > > 
> > > > test-compile
> > > > 
> > > > operation
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > ${jdbc.groupId}
> > > > ${jdbc.artifactId}
> > > > ${jdbc.version}
> > > > 
> > > > 
> > > > 
> > > > 
> > > > org.codehaus.mojo
> > > > cobertura-maven-plugin
> > > > 2.2
> > > >
> > > > 
> > > > 
> >

Re: [m2] cobertura code coverage for dbunit test classes with testNG and OpenJPA?

2008-03-24 Thread Mick Knutson
So I need to mention again, I am using the openJPA plugin to enhance the
byte code in this project.

But it seems strange. I uncommented check then got an error as
I am under 25% coverage (as expected), then commented it out again so the
site:site would complete. Then BAM! I got my coverage report.

Then I ran another clean install, and the report stopped again. So I
uncommented check, ran the build again that failed, commented
check again, and BAM it worked again.

I am not fully sure whate the trick is, but it seems I need to not clean the
build, and run the plugin with check in order to make this
work.

Has anyone run into this as well?

On Mon, Mar 24, 2008 at 4:20 AM, Erez Nahir <[EMAIL PROTECTED]> wrote:

> Hi Mick,
>
> We have surefire 2.4.2 + testng + cobertura 2.2 works.
> Your cofiguration looks fine to me, but, I'm missing the cobertura
> definition in the  section.
> The only difference I see from out build (other then the need to add
> cobertuar to reporting section) is usage of ${basedir} as value. Try to
> remove it, I know surefire has some issues passing values of
> ${properties}.
>
> Here is what we have:
> In surefire plugin:
>
> net.sourceforge.cobertura.datafile
>  target/cobertura/cobertura.ser
>   
> 
> In the reporting section:
>  
> 
> ...
> ...
>  
>org.codehaus.mojo
> cobertura-maven-plugin
>2.2
>   
>
>  
> HTH,
> Erez.
> On Sun, Mar 23, 2008 at 12:48 PM, Mick Knutson <[EMAIL PROTECTED]>
> wrote:
>
> > Anyone have any ideas?
> > I have tried cobertura 2.0 and 2.2 maven plugin and still the same
> result.
> >
> >
> > On Fri, Mar 21, 2008 at 2:36 PM, Mick Knutson <[EMAIL PROTECTED]>
> > wrote:
> >
> > > I have a Spring, OpenJPA, DBUnit, TestNG, HSQL build with Maven
> 2.0.8and
> > > there are 20 DAO tests that now pass. I am trying to now add cobertura
> > to
> > > this. I have used Cobertura extensively in the past, but never with
> > DBUnit.
> > >
> > > So, I am getting the report to generate, but everything is zero. So it
> > > appears that nothing was instrumented.
> > > Here is my surefire and cobertura plugins:
> > >
> > > 
> > > 
> > > maven-surefire-report-plugin
> > > 2.4.2
> > > 
> > > 
> > > **/*.java
> > > 
> > > 
> > > **/*Point*.java
> > > 
> > > 
> > > 
> > > net.sourceforge.cobertura.datafile
> > > 
> > >
> > > ${basedir}/target/cobertura/cobertura.ser
> > > 
> > > 
> > > -Xmx256m
> > > true
> > > 
> > > 
> > >
> > > ...
> > >
> > >
> > > 
> > > org.codehaus.mojo
> > > dbunit-maven-plugin
> > > 1.0-beta-1
> > > 
> > > ${dbunit.dataTypeFactoryName
> > > }
> > > ${jdbc.driverClassName}
> > > ${jdbc.username}
> > > ${jdbc.password}
> > > ${jdbc.url}
> > > src/test/resources/test-data.xml
> > > ${dbunit.operation.type}
> > > ${dbunit.schema}
> > > ${maven.test.skip}
> > > 
> > > 
> > > 
> > > test-compile
> > > 
> > > operation
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ${jdbc.groupId}
> > > ${jdbc.artifactId}
> > > ${jdbc.version}
> > > 
> > > 
> > > 
> > > 
> > > org.codehaus.mojo
> > > cobertura-maven-plugin
> > > 2.2
> > >
> > > 
> > > 
> > > xml
> > > html
> > > 
> > >
> > > 
> > > 
> > > org.apache.commons.logging.*
> > 
> > > 
> > > 
> > > com/**/*Test.class
> > >
> > >
> > org/apache/log4j/**/*.class
> > >
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > clean
> > > 
> > > 
> > > 
> > > 
> > >
> > > 
> > > org.co

Re: [m2] cobertura code coverage for dbunit test classes with testNG and OpenJPA?

2008-03-24 Thread Erez Nahir
Hi Mick,

We have surefire 2.4.2 + testng + cobertura 2.2 works.
Your cofiguration looks fine to me, but, I'm missing the cobertura
definition in the  section.
The only difference I see from out build (other then the need to add
cobertuar to reporting section) is usage of ${basedir} as value. Try to
remove it, I know surefire has some issues passing values of ${properties}.

Here is what we have:
In surefire plugin:
   
 net.sourceforge.cobertura.datafile
 target/cobertura/cobertura.ser
   
 
In the reporting section:
  

...
...
  
org.codehaus.mojo
cobertura-maven-plugin
2.2
  

  
HTH,
Erez.
On Sun, Mar 23, 2008 at 12:48 PM, Mick Knutson <[EMAIL PROTECTED]>
wrote:

> Anyone have any ideas?
> I have tried cobertura 2.0 and 2.2 maven plugin and still the same result.
>
>
> On Fri, Mar 21, 2008 at 2:36 PM, Mick Knutson <[EMAIL PROTECTED]>
> wrote:
>
> > I have a Spring, OpenJPA, DBUnit, TestNG, HSQL build with Maven 2.0.8and
> > there are 20 DAO tests that now pass. I am trying to now add cobertura
> to
> > this. I have used Cobertura extensively in the past, but never with
> DBUnit.
> >
> > So, I am getting the report to generate, but everything is zero. So it
> > appears that nothing was instrumented.
> > Here is my surefire and cobertura plugins:
> >
> > 
> > 
> > maven-surefire-report-plugin
> > 2.4.2
> > 
> > 
> > **/*.java
> > 
> > 
> > **/*Point*.java
> > 
> > 
> > 
> > net.sourceforge.cobertura.datafile
> > 
> >
> > ${basedir}/target/cobertura/cobertura.ser
> > 
> > 
> > -Xmx256m
> > true
> > 
> > 
> >
> > ...
> >
> >
> > 
> > org.codehaus.mojo
> > dbunit-maven-plugin
> > 1.0-beta-1
> > 
> > ${dbunit.dataTypeFactoryName
> > }
> > ${jdbc.driverClassName}
> > ${jdbc.username}
> > ${jdbc.password}
> > ${jdbc.url}
> > src/test/resources/test-data.xml
> > ${dbunit.operation.type}
> > ${dbunit.schema}
> > ${maven.test.skip}
> > 
> > 
> > 
> > test-compile
> > 
> > operation
> > 
> > 
> > 
> > 
> > 
> > ${jdbc.groupId}
> > ${jdbc.artifactId}
> > ${jdbc.version}
> > 
> > 
> > 
> > 
> > org.codehaus.mojo
> > cobertura-maven-plugin
> > 2.2
> >
> > 
> > 
> > xml
> > html
> > 
> >
> > 
> > 
> > org.apache.commons.logging.*
> 
> > 
> > 
> > com/**/*Test.class
> >
> >
> org/apache/log4j/**/*.class
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > clean
> > 
> > 
> > 
> > 
> >
> > 
> > org.codehaus.mojo
> > openjpa-maven-plugin
> > 
> > 
> > JPA Enhance
> > process-classes
> > 
> > enhance
> > 
> > 
> > 
> > 
> > 
> > 
> > addDefaultConstructor
> > true
> > 
> > 
> > enforcePropertyRestrictions
> > true
> > 
> > 
> > 
> > 
> >
> >
> >
> > When I run mvn site:site to a txt file, I started looking through the
> > trace and noticed:
> >
> > *[INFO] [cobertura:instrument]
> > [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT
> file
> > Cobertura: Loaded information on 

Re: [m2] cobertura code coverage for dbunit test classes with testNG and OpenJPA?

2008-03-23 Thread Mick Knutson
Anyone have any ideas?
I have tried cobertura 2.0 and 2.2 maven plugin and still the same result.


On Fri, Mar 21, 2008 at 2:36 PM, Mick Knutson <[EMAIL PROTECTED]> wrote:

> I have a Spring, OpenJPA, DBUnit, TestNG, HSQL build with Maven 2.0.8 and
> there are 20 DAO tests that now pass. I am trying to now add cobertura to
> this. I have used Cobertura extensively in the past, but never with DBUnit.
>
> So, I am getting the report to generate, but everything is zero. So it
> appears that nothing was instrumented.
> Here is my surefire and cobertura plugins:
>
> 
> 
> maven-surefire-report-plugin
> 2.4.2
> 
> 
> **/*.java
> 
> 
> **/*Point*.java
> 
> 
> 
> net.sourceforge.cobertura.datafile
> 
>
> ${basedir}/target/cobertura/cobertura.ser
> 
> 
> -Xmx256m
> true
> 
> 
>
> ...
>
>
> 
> org.codehaus.mojo
> dbunit-maven-plugin
> 1.0-beta-1
> 
> ${dbunit.dataTypeFactoryName
> }
> ${jdbc.driverClassName}
> ${jdbc.username}
> ${jdbc.password}
> ${jdbc.url}
> src/test/resources/test-data.xml
> ${dbunit.operation.type}
> ${dbunit.schema}
> ${maven.test.skip}
> 
> 
> 
> test-compile
> 
> operation
> 
> 
> 
> 
> 
> ${jdbc.groupId}
> ${jdbc.artifactId}
> ${jdbc.version}
> 
> 
> 
> 
> org.codehaus.mojo
> cobertura-maven-plugin
> 2.2
>
> 
> 
> xml
> html
> 
>
> 
> 
> org.apache.commons.logging.*
> 
> 
> com/**/*Test.class
>
> org/apache/log4j/**/*.class
>
> 
> 
> 
> 
> 
> 
> clean
> 
> 
> 
> 
>
> 
> org.codehaus.mojo
> openjpa-maven-plugin
> 
> 
> JPA Enhance
> process-classes
> 
> enhance
> 
> 
> 
> 
> 
> 
> addDefaultConstructor
> true
> 
> 
> enforcePropertyRestrictions
> true
> 
> 
> 
> 
>
>
>
> When I run mvn site:site to a txt file, I started looking through the
> trace and noticed:
>
> *[INFO] [cobertura:instrument]
> [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
> Cobertura: Loaded information on 13 classes.
> Instrumenting 13 files to
> C:\opt\temp\myproject\core\target\generated-classes\cobertura
> Cobertura: Saved information on 13 classes.
> Instrument time: 266ms
>
> [INFO] Instrumentation was successful.
> *
>
>
> So am I missing something with DBUnit plugin, or openJPA plugin as to
> point to *target\generated-classes\cobertura instead of **target\classes
> ???
>
>
> *--
> Thanks,
> Mick Knutson
>
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.linkedin.com/in/mickknutson
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/BLiNCMagazine
> http://tahoe.baselogic.com
> ---




-- 
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---


[m2] cobertura code coverage for dbunit test classes with testNG and OpenJPA?

2008-03-21 Thread Mick Knutson
I have a Spring, OpenJPA, DBUnit, TestNG, HSQL build with Maven 2.0.8 and
there are 20 DAO tests that now pass. I am trying to now add cobertura to
this. I have used Cobertura extensively in the past, but never with DBUnit.

So, I am getting the report to generate, but everything is zero. So it
appears that nothing was instrumented.
Here is my surefire and cobertura plugins:



maven-surefire-report-plugin
2.4.2


**/*.java


**/*Point*.java



net.sourceforge.cobertura.datafile

${basedir}/target/cobertura/cobertura.ser


-Xmx256m
true



...



org.codehaus.mojo
dbunit-maven-plugin
1.0-beta-1

${dbunit.dataTypeFactoryName
}
${jdbc.driverClassName}
${jdbc.username}
${jdbc.password}
${jdbc.url}
src/test/resources/test-data.xml
${dbunit.operation.type}
${dbunit.schema}
${maven.test.skip}



test-compile

operation





${jdbc.groupId}
${jdbc.artifactId}
${jdbc.version}




org.codehaus.mojo
cobertura-maven-plugin
2.2



xml
html




org.apache.commons.logging.*


com/**/*Test.class

org/apache/log4j/**/*.class







clean






org.codehaus.mojo
openjpa-maven-plugin


JPA Enhance
process-classes

enhance






addDefaultConstructor
true


enforcePropertyRestrictions
true







When I run mvn site:site to a txt file, I started looking through the trace
and noticed:

*[INFO] [cobertura:instrument]
[INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Cobertura: Loaded information on 13 classes.
Instrumenting 13 files to
C:\opt\temp\myproject\core\target\generated-classes\cobertura
Cobertura: Saved information on 13 classes.
Instrument time: 266ms

[INFO] Instrumentation was successful.
*


So am I missing something with DBUnit plugin, or openJPA plugin as to point
to *target\generated-classes\cobertura instead of **target\classes ???


*--
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.linkedin.com/in/mickknutson
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/BLiNCMagazine
http://tahoe.baselogic.com
---