net.sourceforge.groboutils.codecoverage.v2.util
Class ClassfileCheckerCLI

java.lang.Object
  extended bynet.sourceforge.groboutils.codecoverage.v2.util.ClassfileCheckerCLI

public class ClassfileCheckerCLI
extends java.lang.Object

This file joins the class detail files, original class files, and covered class files with the source, into a STDOUT report.

Since:
January 15, 2004
Version:
$Date: 2004/04/15 05:48:26 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
ClassfileCheckerCLI()
           
 
Method Summary
protected  java.util.Map createAnalysisModuleIndexMap(IMetaDataReader mdr)
           
protected  org.apache.bcel.classfile.JavaClass createJavaClass(java.io.File filename)
           
protected  IMetaDataReader createMetaDataReader(java.io.File datadir)
           
protected  java.lang.String format8(int i)
           
protected  java.lang.String[] formatWidth(java.lang.String t, int width)
           
 java.io.File getClassFileForClass(java.lang.String classname, java.io.File classdir)
          Returns only the class file for the given class name.
 java.io.File[] getClassFilesForClass(java.lang.String classname, java.io.File classdir)
          Returns all class files related to the given classname.
protected  java.lang.String getClassName(org.apache.bcel.classfile.ConstantPool cp, int typeIndex)
           
protected  java.lang.String getJustClassName(java.lang.String classname)
           
protected  java.lang.String[] getMachingClassSignatures(java.lang.String classname, java.lang.String[] sigs)
           
 MarkRecord[] getMarkRecords(java.lang.String classname, IMetaDataReader mdr)
           
protected  java.lang.String getPackageName(java.lang.String classname)
           
 java.io.File getSourceFileForClass(java.lang.String classname, java.io.File srcdir)
          Returns only the class file for the given class name.
protected  java.lang.String indexCode(int i)
           
static void main(java.lang.String[] args)
           
 java.lang.String[] markedLine(MarkRecord[] mrL, int lineNo)
          Returns the measure names of the analysis modules that marked this particular line.
protected  void printCodeException(java.lang.String type, org.apache.bcel.classfile.CodeException[] ce, int pos, org.apache.bcel.classfile.ConstantPool cp, java.io.PrintStream out)
           
protected  int printLegend(java.util.Map amToIndex, java.io.PrintStream out)
           
protected  void printSideBySide(java.lang.String left, java.lang.String right, int width, java.lang.String sep, java.lang.String indent, java.io.PrintStream out)
           
 void reportAddedMethod(org.apache.bcel.classfile.Method cov, java.io.PrintStream out)
           
 void reportClassDiff(java.lang.String classname, java.io.File originalClassDir, java.io.File coveredClassDir, java.io.PrintStream out)
          Perform a diff on the covered and original class files for a specific class.
 void reportMarkedSource(java.lang.String classname, java.io.File coveredDataDir, java.io.File srcDir, java.io.PrintStream out)
           
 void reportMarkedSource(java.lang.String classname, IMetaDataReader mdr, java.io.File srcFile, java.io.PrintStream out)
          Comment the source code for the given class with the line number and which analysis module marked each line.
 void reportMethodDiff(org.apache.bcel.classfile.Method orig, org.apache.bcel.classfile.Method cov, org.apache.bcel.classfile.ConstantPool origCP, org.apache.bcel.classfile.ConstantPool covCP, java.io.PrintStream out)
           
 void reportRemovedMethod(org.apache.bcel.classfile.Method orig, java.io.PrintStream out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassfileCheckerCLI

public ClassfileCheckerCLI()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException

reportMarkedSource

public void reportMarkedSource(java.lang.String classname,
                               java.io.File coveredDataDir,
                               java.io.File srcDir,
                               java.io.PrintStream out)
                        throws java.io.IOException
Throws:
java.io.IOException

reportMarkedSource

public void reportMarkedSource(java.lang.String classname,
                               IMetaDataReader mdr,
                               java.io.File srcFile,
                               java.io.PrintStream out)
                        throws java.io.IOException
Comment the source code for the given class with the line number and which analysis module marked each line.

Throws:
java.io.IOException

reportClassDiff

public void reportClassDiff(java.lang.String classname,
                            java.io.File originalClassDir,
                            java.io.File coveredClassDir,
                            java.io.PrintStream out)
                     throws java.io.IOException
Perform a diff on the covered and original class files for a specific class. This only does a diff on the code, not the fields.

Throws:
java.io.IOException

reportMethodDiff

public void reportMethodDiff(org.apache.bcel.classfile.Method orig,
                             org.apache.bcel.classfile.Method cov,
                             org.apache.bcel.classfile.ConstantPool origCP,
                             org.apache.bcel.classfile.ConstantPool covCP,
                             java.io.PrintStream out)

reportRemovedMethod

public void reportRemovedMethod(org.apache.bcel.classfile.Method orig,
                                java.io.PrintStream out)

reportAddedMethod

public void reportAddedMethod(org.apache.bcel.classfile.Method cov,
                              java.io.PrintStream out)

markedLine

public java.lang.String[] markedLine(MarkRecord[] mrL,
                                     int lineNo)
Returns the measure names of the analysis modules that marked this particular line.


getClassFilesForClass

public java.io.File[] getClassFilesForClass(java.lang.String classname,
                                            java.io.File classdir)
Returns all class files related to the given classname. That is, the class and its inner classes.


getClassFileForClass

public java.io.File getClassFileForClass(java.lang.String classname,
                                         java.io.File classdir)
                                  throws java.io.IOException
Returns only the class file for the given class name.

Throws:
java.io.IOException

getSourceFileForClass

public java.io.File getSourceFileForClass(java.lang.String classname,
                                          java.io.File srcdir)
                                   throws java.io.IOException
Returns only the class file for the given class name.

Throws:
java.io.IOException

getMarkRecords

public MarkRecord[] getMarkRecords(java.lang.String classname,
                                   IMetaDataReader mdr)
                            throws java.io.IOException
Throws:
java.io.IOException

createJavaClass

protected org.apache.bcel.classfile.JavaClass createJavaClass(java.io.File filename)
                                                       throws java.io.IOException
Throws:
java.io.IOException

getMachingClassSignatures

protected java.lang.String[] getMachingClassSignatures(java.lang.String classname,
                                                       java.lang.String[] sigs)

getPackageName

protected java.lang.String getPackageName(java.lang.String classname)

getJustClassName

protected java.lang.String getJustClassName(java.lang.String classname)

createMetaDataReader

protected IMetaDataReader createMetaDataReader(java.io.File datadir)
                                        throws java.io.IOException
Throws:
java.io.IOException

createAnalysisModuleIndexMap

protected java.util.Map createAnalysisModuleIndexMap(IMetaDataReader mdr)
                                              throws java.io.IOException
Throws:
java.io.IOException

printLegend

protected int printLegend(java.util.Map amToIndex,
                          java.io.PrintStream out)

indexCode

protected java.lang.String indexCode(int i)

format8

protected java.lang.String format8(int i)

formatWidth

protected java.lang.String[] formatWidth(java.lang.String t,
                                         int width)

printCodeException

protected void printCodeException(java.lang.String type,
                                  org.apache.bcel.classfile.CodeException[] ce,
                                  int pos,
                                  org.apache.bcel.classfile.ConstantPool cp,
                                  java.io.PrintStream out)

printSideBySide

protected void printSideBySide(java.lang.String left,
                               java.lang.String right,
                               int width,
                               java.lang.String sep,
                               java.lang.String indent,
                               java.io.PrintStream out)

getClassName

protected java.lang.String getClassName(org.apache.bcel.classfile.ConstantPool cp,
                                        int typeIndex)


Copyright © 2001-2003 by The GroboUtils Project