net.sourceforge.cobertura.coverage
Class Main
java.lang.Object
net.sourceforge.cobertura.coverage.Main
- public class Main
- extends java.lang.Object
Add coverage instrumentation to existing classes.
What does that mean, exactly?
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:
- Get an instance of the CoverageData class.
- Call a method in this CoverageData class that increments
a counter for this line of code.
After every line in a class has been "instrumented," Cobertura
edits the bytecode for the class one more time and adds an
"implements net.sourceforge.cobertura.coverage.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.
Constructor Summary |
Main()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private static final org.apache.log4j.Logger logger
destinationDirectory
private java.io.File destinationDirectory
baseDir
private java.io.File baseDir
ignoreRegexp
private java.util.regex.Pattern ignoreRegexp
Main
public Main()
isClass
private static boolean isClass(java.io.File file)
- Parameters:
file
- A file.
- Returns:
- True if the specified file has "class" as its extension,
false otherwise.
addInstrumentation
private void addInstrumentation(java.io.File file)
addInstrumentation
private void addInstrumentation(java.lang.String filename)
parseArguments
private void parseArguments(java.lang.String[] args)
main
public static void main(java.lang.String[] args)