3

I am using Corbetura-2.0.3 with java 1.7 and I am trying to instrument the classes in our build system via command line. Stuck at instrumenting classes. Please assist.

Here is the command:

./cobertura-instrument.sh 
   --basedir /ariba/9r2_sourcing/roots-S49r2/install/classes/ariba.app.approvable.zip 
   --destination /ariba/9r2_sourcing/Instrument 
   -auxClasspath /ariba/9r2_sourcing/roots-S49r2/install/classes

Wherein,

  • /ariba/9r2_sourcing/roots-S49r2/install/classes/ariba.app.approvable.zip – zip containing classes which I would like to instrument
  • /ariba/9r2_sourcing/Instrument – Folder to save instrumented classes
  • /ariba/9r2_sourcing/roots-S49r2/install/classes – path where all other reference classes are present.

Output:

-bash-4.1$ ./cobertura-instrument.sh --basedir /ariba/9r2_sourcing/roots-S49r2/install/classes/ariba.app.approvable.zip --destination /ariba/9r2_sourcing/Instrument -auxClasspath /ariba/9r2_sourcing/roots-S49r2/install/classes
Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Apr 29, 2014 4:53:27 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
INFO: Cobertura: Loaded information on 0 classes.
Apr 29, 2014 4:53:27 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData
INFO: Cobertura: Saved information on 0 classes.

Also tried with:

  • archivesdepth parameter as well; it gives the same above error.
  • I have updated the cobertura-instrument.sh file with the right versions of jars present in Cobertura installed location.
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

1 Answers1

0

I see , in command you have not mentioned classes which you need to instrument.

Example: Below command works.

sh cobertura-instrument.sh --basedir `pwd` GenerateReports.class My_lib.class

Note:
Classes need to be mentioned as complete filename (e.g. mycls.class)
-auxClasspath : Add any classes/jars that cobertura is unable to find during instrumentation i.e. classes to exclude from coverage

Shubhangi
  • 2,229
  • 2
  • 14
  • 14