Domanda

I'm using Cobertura 2.3.0 from http://cobertura.github.io/cobertura/ to analyze my project for test coverage, and I'm getting a

Error: Could not find or load main class net.sourceforge.cobertura.instrument.Main

When trying to execute cobertura-instrument.bat from the command line. I've looked at this batch file and it's trying to load several JARs from the %COBERTURA_HOME%/lib folder that don't exist. I've manually downloaded these JARs but am getting other strange errors.

java.lang.IncompatibleClassChangeError: class net.sourceforge.cobertura.instrument.pass1.DetectIgnoredCodeClassVisitor has interface org.objectweb.asm.ClassVisitor as super class

Is it possible that this release was incorrectly updated? I don't see a way to make this work any other way. Further, does anybody know of a working test-coverage utility, preferably a working different version of Cobertura?

I've tried Nounit and several others, but have not gotten the type of clean output that I know Cobertura can produce.

È stato utile?

Soluzione

Answering my own question in hopes it can help somebody.

At time of writing, there is a known bug with Cobertura throwing a ClassNotFoundException in certain circumstances. See the following issue tracker page: https://github.com/cobertura/cobertura/issues/74#issuecomment-41383903

For the time being, I've gone with EclEmma Eclipse plugin for EMMA for my test code coverage, and got nice, pretty results the way I wanted.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top