0

I'm using grails 1.3.7.I installed code-coverage plugin.And placed the cobertura 1.9.4.jar and asm2.2.3.jar in project lib folder in STS workspace.Running using grails test-app -coverage command.When i'm doing this it runs the whole Junit test casses as well it generate the report in Cobertura folder in target.But in generated HTML code it showing Zero classes and all others are zero.

In console at last it displays 0 classes loading and 0 classes saving like this after running the test casses.

As well I tried in BuildConfig.groovy to add,

coverage { sourceInclusions = ['grails-app/target*'] }

It's not resolving the path

So how can i solve this problem to get correct cobertura report..??

While i'm running using the above mentioned command will the code-coverage (cobertura) automatically instrument the classes or mannually we have to say..??

I go through the cobertura instrumentation ref via comment lines document..in that they used cobertura-instrumented.bat --destination ... if use these comments cobertura-instrumented.bat is not internal or external command like this error is comming..

How to correct this and make this plugin work correct to get correct result rather than 0%..??

Thanks..

mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128
Suseendran P
  • 557
  • 1
  • 5
  • 18

2 Answers2

0

Make sure your app is not running at the same time you are running the test suite. Cobertura needs to instrument your compiled code and if the app is running it can interfere with that.

doelleri
  • 19,232
  • 5
  • 61
  • 65
  • While i'm running using the above mentioned command will the code-coverage (cobertura) automatically instrument the classes or mannually we have to say..?? – Suseendran P Jan 04 '13 at 17:11
  • When you run `grails test-app -coverage` your classes will be instrumented. That's how Cobertura works. – doelleri Jan 04 '13 at 18:34
0

Code-Coverage correctly shows the output after i changed the lib jars as asm2.2.1 to asm3.1 as well asm-util.jar and oro.jar was added on it.

Suseendran P
  • 557
  • 1
  • 5
  • 18