net.sourceforge.cobertura.instrument
public class Main extends Object
Add coverage instrumentation to existing classes.
It means Cobertura will look at each class you give it. It loads the bytecode into memory. For each line of source, Cobertura adds a few extra instructions. These instructions do the following:
After every line in a class has been "instrumented," Cobertura edits the bytecode for the class one more time and adds "implements net.sourceforge.cobertura.coveragedata.HasBeenInstrumented" This is basically just a flag used internally by Cobertura to determine whether a class has been instrumented or not, so as not to instrument the same class twice.
Field Summary | |
---|---|
ClassPattern | classPattern |
File | destinationDirectory |
Collection | ignoreBranchesRegexes |
Collection | ignoreRegexes |
static Logger | logger |
ProjectData | projectData |
Method Summary | |
---|---|
void | addInstrumentation(CoberturaFile coberturaFile) |
boolean | addInstrumentationToArchive(CoberturaFile file, InputStream archive, OutputStream output) |
boolean | addInstrumentationToArchive(CoberturaFile file, ZipInputStream archive, ZipOutputStream output) |
void | addInstrumentationToArchive(Archive archive) |
void | addInstrumentationToArchive(CoberturaFile archive) |
void | addInstrumentationToSingleClass(File file) |
static boolean | isClass(ZipEntry entry) |
static void | main(String[] args) |
void | parseArguments(String[] args) |
Parameters: entry A zip entry.
Returns: True if the specified entry has "class" as its extension, false otherwise.