0

I have a sample code with me which compiles and runs properly on my windows machine. My sample code consist of simple .java file and after compilation i got .class file also. I need to do code coverage for that using cobertura.

I tried giving command as:

C:\Users\rk\workspace\CodeCoverage\cobertura-2.0.3>cobertura-instrument.bat --destination C:\Users\rk\workspace\CodeCoverage\src C:\Users\rk\workspace\CodeCoverage\bin

All the files related to cobertura are present at CodeCoverage folder, .java file is present at src folder and .class file is present at bin.

Can anyone help me in generating coverage reports. Thanks in advance.

Dylan
  • 2,161
  • 2
  • 27
  • 51
mRajKap
  • 1
  • 1
  • 1
  • Please give more details: which version/distribution of cobertura you're using, and also what error(s) are you getting as a result of running the given command ? – Patrice M. Jan 18 '14 at 15:04
  • @PatriceM. : I am using cobertura 2.0.3.. I am getting error viz Error: Could not find or load main class net.sourceforge.cobertura.instrument.Main – mRajKap Jan 20 '14 at 06:06

1 Answers1

0

If it is a Maven project; then the command line will be :

            mvn package cobertura:cobertura

But before this,its better you execute :

                   mvn clean install -U

so that the project builds.