| java.lang.Object org.quilt.reg.Registry org.quilt.reg.QuiltRegistry org.quilt.cover.stmt.StmtRegistry
StmtRegistry | public class StmtRegistry extends QuiltRegistry (Code) | | Registry for statement coverage information. As Quilt-instrumented
classes are loaded, they register their q$$q hit count
arrays and are assigned an ID unique in the life of the registry.
The registry maintains:
- hit counts, keyed on class name
- method end counter indexes, keyed on class and method name
- line number ranges, keyed on class and counter index
This and other information in the registry allows it the generate
a number of reports summarizing coverage at
- package level (soon)
- class level (now)
- method level (now)
- line level (soonish)
The registry is associated with the Quilt class loader when it
is created. Information can been retrieved from the registry at
any time. It will be accumulated as new instances of Quilt-instrumented
classes are run.
author: Jim Dixon |
StmtRegistry | public StmtRegistry(QuiltClassLoader qcl)(Code) | | Constructor specifying Quilt class loader the registry is
associated with.
|
getClassCoverage | int getClassCoverage(String className)(Code) | | Get the percentage of counters in the class that have counts
greater than zero. The percentage is rounded down. If no
class information is found, returns zero.
an integer between 0 and 100, zero if class not found |
getCounts | public int[] getCounts(String className)(Code) | | Get a reference to the hit count array for a class.
|
getInstance | public static StmtRegistry getInstance()(Code) | | Returns a reference to the latest instance to announce itself.
|
getMethodCoverage | int getMethodCoverage(String className, int n)(Code) | | Get the percentage of counters in the Nth method that have counts
greater than zero. The percentage is rounded down. If no
class or method information is found, returns zero.
XXX The 'methodEnds' array actually contains cumulative counts,
so values must be reduced by one.
an integer between 0 and 100, zero if class not found |
getQuiltVersion | public int getQuiltVersion(String className)(Code) | | |
getReport | public String getReport()(Code) | | Dump the registry as plain text.
|
putEphemera | boolean putEphemera(String className, Ephemera eph)(Code) | | add temporary data for class to registry
|
registerClass | public int registerClass(String name, org.quilt.cover.stmt.QIC junk)(Code) | | STUB
|
registerCounts | public int registerCounts(String className, int[] counts)(Code) | | Register a class by passing a reference to its integer hit count
array. Returns a class ID which is unique within this run. The
ID will be stored in a static in the class, public static int q$$qID
XXX So far absolutely no value to using String array as key; could
just be String.
Parameters: className - Name of the class being registered. Parameters: counts - Reference to the class's public static hit count array. A unique class ID on success, -1 on failure. |
registerMethods | public void registerMethods(String className, String[] methods, int[] endCounts)(Code) | | |
removeEphemera | Ephemera removeEphemera(String className)(Code) | | Remove the reference from the registry.
Parameters: className - Name of the class we are storing information about The reference or null if none was found or null was the stored value. |
reset | public void reset()(Code) | | Clear counters associated with registry entries.
|
|
|