Mercurial > hg > MauveTestCoverage
changeset 7:342d366654ce
2012-01-27 Pavel Tisnovsky <ptisnovs@redhat.com>
* templates/style.css:
New styles added which is used in generated test report.
* src/FileUtils.java:
* src/PrintClassList.java:
* src/PrintPublicMethods.java:
* src/PrintTestCoverage.java:
Minor changes - JavaDoc
* templates/all_classes_template.html:
* templates/all_packages_template.html:
* templates/class_template.html:
* templates/package_template.html:
* templates/summary.html:
Removed useless character ^M in the XML declarations.
author | Pavel Tisnovsky <ptisnovs@redhat.com> |
---|---|
date | Fri, 27 Jan 2012 16:35:26 +0100 |
parents | 5849d5bfbee0 |
children | a929d697c161 |
files | ChangeLog src/FileUtils.java src/PrintClassList.java src/PrintPublicMethods.java src/PrintTestCoverage.java templates/all_classes_template.html templates/all_packages_template.html templates/class_template.html templates/package_template.html templates/style.css templates/summary.html |
diffstat | 11 files changed, 114 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Jan 18 16:52:43 2012 +0100 +++ b/ChangeLog Fri Jan 27 16:35:26 2012 +0100 @@ -1,3 +1,19 @@ +2012-01-27 Pavel Tisnovsky <ptisnovs@redhat.com> + + * templates/style.css: + New styles added which is used in generated test report. + * src/FileUtils.java: + * src/PrintClassList.java: + * src/PrintPublicMethods.java: + * src/PrintTestCoverage.java: + Minor changes - JavaDoc + * templates/all_classes_template.html: + * templates/all_packages_template.html: + * templates/class_template.html: + * templates/package_template.html: + * templates/summary.html: + Removed useless character ^M in the XML declarations. + 2012-01-18 Pavel Tisnovsky <ptisnovs@redhat.com> * templates/class_template.html:
--- a/src/FileUtils.java Wed Jan 18 16:52:43 2012 +0100 +++ b/src/FileUtils.java Fri Jan 27 16:35:26 2012 +0100 @@ -164,6 +164,7 @@ // try to close the buffered reader try { + // for the easier use, it is possible to call this method with null parameter if (bufferedReader != null) { bufferedReader.close(); @@ -186,6 +187,7 @@ // try to close the buffered writer try { + // for the easier use, it is possible to call this method with null parameter if (bufferedWriter != null) { bufferedWriter.close(); @@ -249,6 +251,7 @@ */ static int readOneByte(FileInputStream fileInputStream) throws IOException { + // try to read one byte from the input stream int i = fileInputStream.read(); // -1 means that EOF is reached if (i == EOF) @@ -269,6 +272,7 @@ */ static int readTwoBytes(FileInputStream fileInputStream) throws IOException { + // try to read two bytes from the input stream int i1 = readOneByte(fileInputStream); int i2 = readOneByte(fileInputStream); // combine all two read bytes into a word @@ -286,6 +290,7 @@ */ static int readFourBytes(FileInputStream fileInputStream) throws IOException { + // try to read four bytes from the input stream int i1 = readOneByte(fileInputStream); int i2 = readOneByte(fileInputStream); int i3 = readOneByte(fileInputStream);
--- a/src/PrintClassList.java Wed Jan 18 16:52:43 2012 +0100 +++ b/src/PrintClassList.java Fri Jan 27 16:35:26 2012 +0100 @@ -117,6 +117,7 @@ jarFile.close(); } catch (IOException e) { + // oops, something wrong happens e.printStackTrace(); } }
--- a/src/PrintPublicMethods.java Wed Jan 18 16:52:43 2012 +0100 +++ b/src/PrintPublicMethods.java Fri Jan 27 16:35:26 2012 +0100 @@ -72,17 +72,22 @@ } // some exceptions could be thrown by Class.forName() catch (ClassNotFoundException e) { + // it might happen return null; } catch (UnsatisfiedLinkError e) { + // it might happen return null; } catch (ExceptionInInitializerError e) { + // it might happen return null; } catch (NoClassDefFoundError e) { + // it might happen return null; } + // it is not a class at all or the class is not public return null; } @@ -221,6 +226,7 @@ */ private static void printAllConstructors(String className) { + // iterate over all constructors for (String methodSignature : getAllConstructors(className)) { System.out.println(methodSignature); @@ -235,6 +241,7 @@ */ private static void printAllPublicMethods(String className) { + // iterate over all public methods for (String methodSignature : getAllPublicMethodsForClass(className)) { System.out.println(methodSignature);
--- a/src/PrintTestCoverage.java Wed Jan 18 16:52:43 2012 +0100 +++ b/src/PrintTestCoverage.java Fri Jan 27 16:35:26 2012 +0100 @@ -176,6 +176,11 @@ abstract public String toString(ConstantPoolRecord[] poolEntries); } +/** + * Class representing class record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class ClassRecord extends ConstantPoolRecord { private int classNameIndex; @@ -217,6 +222,11 @@ } } +/** + * Class representing field reference record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class FieldReferenceRecord extends ConstantPoolRecord { private int classIndex; @@ -269,6 +279,11 @@ } } +/** + * Class representing method reference record stored in constant pool. + * + * @author Pavel Tisnovsky + */ @SuppressWarnings("boxing") class MethodReferenceRecord extends ConstantPoolRecord { @@ -426,6 +441,11 @@ } } +/** + * Class representing interface record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class InterfaceReferenceRecord extends ConstantPoolRecord { public int classIndex; @@ -468,6 +488,11 @@ } } +/** + * Class representing name and type record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class NameAndTypeRecord extends ConstantPoolRecord { public int nameIndex; @@ -508,6 +533,11 @@ } } +/** + * Class representing string record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class StringRecord extends ConstantPoolRecord { public int stringIndex; @@ -539,6 +569,11 @@ } } +/** + * Class representing integer constant record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class IntegerRecord extends ConstantPoolRecord { public int integerConstant; @@ -563,6 +598,11 @@ } } +/** + * Class representing long constant record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class LongRecord extends ConstantPoolRecord { public long longConstant; @@ -587,6 +627,11 @@ } } +/** + * Class representing float constant record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class FloatRecord extends ConstantPoolRecord { public float floatConstant; @@ -611,6 +656,11 @@ } } +/** + * Class representing double constant record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class DoubleRecord extends ConstantPoolRecord { public double doubleConstant; @@ -636,6 +686,11 @@ } } +/** + * Class representing UTF-8 string record stored in constant pool. + * + * @author Pavel Tisnovsky + */ class Utf8Record extends ConstantPoolRecord { public String string;
--- a/templates/all_classes_template.html Wed Jan 18 16:52:43 2012 +0100 +++ b/templates/all_classes_template.html Fri Jan 27 16:35:26 2012 +0100 @@ -1,4 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
--- a/templates/all_packages_template.html Wed Jan 18 16:52:43 2012 +0100 +++ b/templates/all_packages_template.html Fri Jan 27 16:35:26 2012 +0100 @@ -1,4 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
--- a/templates/class_template.html Wed Jan 18 16:52:43 2012 +0100 +++ b/templates/class_template.html Fri Jan 27 16:35:26 2012 +0100 @@ -1,4 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
--- a/templates/package_template.html Wed Jan 18 16:52:43 2012 +0100 +++ b/templates/package_template.html Fri Jan 27 16:35:26 2012 +0100 @@ -1,4 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
--- a/templates/style.css Wed Jan 18 16:52:43 2012 +0100 +++ b/templates/style.css Fri Jan 27 16:35:26 2012 +0100 @@ -25,3 +25,28 @@ .method-name {} .method-params {} +table.package_list { + border-width: 0px; + border-spacing: 0px; + border-style: dashed; + border-color: black; + border-collapse: collapse; + background-color: white; + width: 100%; +} +table.package_list th { + border-width: 1px; + padding: 1px; + border-style: inset; + border-color: gray; + background-color: #c0c0ff; + -moz-border-radius: ; +} +table.package_list td { + border-width: 1px; + padding: 1px; + border-style: inset; + border-color: gray; + -moz-border-radius: ; +} +
--- a/templates/summary.html Wed Jan 18 16:52:43 2012 +0100 +++ b/templates/summary.html Fri Jan 27 16:35:26 2012 +0100 @@ -1,4 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>