de.web.databasesupport.tools.test
Class MakeHTMLLog

java.lang.Object
  |
  +--de.web.databasesupport.tools.test.MakeHTMLLog

public class MakeHTMLLog
extends java.lang.Object

Generates a HTML-Log-file


Field Summary
static java.util.Vector links
           
 
Constructor Summary
MakeHTMLLog()
           
 
Method Summary
static java.lang.String bodyHTML(TestedMethod tMethod)
          generates a HTML-body using de.gmx.ndewitt.tools.test.TestedMenthod - objects.
static java.lang.String bodyHTML(TestedMethod[] tMethods)
          generates a HTML-body using de.gmx.ndewitt.tools.test.TestedMenthod - objects.
static java.lang.String footerHTML()
          generates a HTML-footer.
static java.lang.String generateLink(java.lang.String methodName)
          generates a links from the method-name
static java.lang.String generateLinkList(java.util.Vector links)
          generates a link-list from given HTML-Strings
static java.lang.String getDate(long date)
          generates a Date-String (YYYY-MM-DD) from a date given in milliseconds since 1970.
static java.lang.String getTime(long date)
          generates a Time-String (HH:MM:SS) from a date given in milliseconds since 1970.
static java.lang.String headerHTML(java.lang.String title)
          generates a standard HTML-header
static java.lang.String headerHTML(java.lang.String classname, java.lang.String classDescription, java.lang.String tester, java.lang.String date, java.lang.String time)
          generates a HTML-header including classname, tester, date, time and a class-description.
static java.lang.String makeAnchorTarget(java.lang.String methodName)
          generates a anchor-point at the method-name
static boolean makeHTML(java.lang.String classDescription, TestedMethod[] tMethods, java.io.File dest, boolean overwrite)
          generates a complete HTML-file and checks if file exists already.
static java.lang.String makeToTop()
          generates a link to the top (target is #linklist).
static java.util.Vector showResult(java.sql.ResultSet resultset)
          generates from a ResultSet a Vector of Strings including a header, columnname and content.
static java.util.Vector showStringArray(java.lang.String[] array)
          generates from a String-array a Vector of Strings including a header, columnname and content.
static java.util.Vector showStringVector(java.util.Vector vec)
          Adds to a Vector a information header at the front.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

links

public static java.util.Vector links
Constructor Detail

MakeHTMLLog

public MakeHTMLLog()
Method Detail

makeHTML

public static boolean makeHTML(java.lang.String classDescription,
                               TestedMethod[] tMethods,
                               java.io.File dest,
                               boolean overwrite)
                        throws java.io.IOException
generates a complete HTML-file and checks if file exists already.
Parameters:
classDescription - The description of the used class.
tMethods - All tested methods with there results.
dest - Destination-file where to put the information from tMethods in.
overwrite - Flag if overwriting an existing file is allowed (true is allowed, false otherwise).
Returns:
Returns true if writing was successfull, false if file already exists and it is not allowed to overwrite it.
Throws:
java.io.IOException - - if something went wrong with the writing, or creating of the destination-file.

getDate

public static java.lang.String getDate(long date)
generates a Date-String (YYYY-MM-DD) from a date given in milliseconds since 1970.
Parameters:
date - The milliseconds since 1970.
Returns:
Returns the date as String.

getTime

public static java.lang.String getTime(long date)
generates a Time-String (HH:MM:SS) from a date given in milliseconds since 1970.
Parameters:
date - The milliseconds since 1970.
Returns:
Returns the time as String.

headerHTML

public static java.lang.String headerHTML(java.lang.String classname,
                                          java.lang.String classDescription,
                                          java.lang.String tester,
                                          java.lang.String date,
                                          java.lang.String time)
generates a HTML-header including classname, tester, date, time and a class-description.
Parameters:
classname - The name of the tested class.
classDescription - The Description about the tested class.
tester - The name of the tester.
date - The date of the test.
time - The beginning of the test.
Returns:
The HTML-Code as a String.

headerHTML

public static java.lang.String headerHTML(java.lang.String title)
generates a standard HTML-header
Parameters:
title - The title of the HTML-document.
Returns:
The HTML-Code as String

footerHTML

public static java.lang.String footerHTML()
generates a HTML-footer.
Returns:
The HTML-Code of the footer as a String.

bodyHTML

public static java.lang.String bodyHTML(TestedMethod[] tMethods)
generates a HTML-body using de.gmx.ndewitt.tools.test.TestedMenthod - objects.
Parameters:
tMethods - The TestedMethod-Objects to get information about the test.
Returns:
The HTML-Body-code as a String including all Information from the tMethods-Objects.

bodyHTML

public static java.lang.String bodyHTML(TestedMethod tMethod)
generates a HTML-body using de.gmx.ndewitt.tools.test.TestedMenthod - objects.
Parameters:
tMethod - The TestedMethod-Object to get information about the test.
Returns:
The HTML-Body-code as a String including all Information from the tMethod-Object.

generateLinkList

public static java.lang.String generateLinkList(java.util.Vector links)
generates a link-list from given HTML-Strings
Parameters:
links - The HTML-Strings, containing the links.
Returns:
The HTML-Code for the link-list.

generateLink

public static java.lang.String generateLink(java.lang.String methodName)
generates a links from the method-name
Parameters:
methodName - The name of the method.
Returns:
The HTML-Code containing the link to spezified method.

makeAnchorTarget

public static java.lang.String makeAnchorTarget(java.lang.String methodName)
generates a anchor-point at the method-name
Parameters:
methodName - The name of the method.
Returns:
The HTML-Code containing the anchor for the spezified method.

makeToTop

public static java.lang.String makeToTop()
generates a link to the top (target is #linklist).
Returns:
The HTML-Code containing the link to the top and a 100% horizontal ruler with a size of 10.

showResult

public static java.util.Vector showResult(java.sql.ResultSet resultset)
generates from a ResultSet a Vector of Strings including a header, columnname and content.
Parameters:
resultset - The ResultSet to generate a Vector of Strings from.
Returns:
A Vector of String including a header, columnname and content.

showStringArray

public static java.util.Vector showStringArray(java.lang.String[] array)
generates from a String-array a Vector of Strings including a header, columnname and content.
Parameters:
array - The String-array to generate a Vector of Strings from.
Returns:
A Vector of String including a header, columnname and content.

showStringVector

public static java.util.Vector showStringVector(java.util.Vector vec)
Adds to a Vector a information header at the front.
Parameters:
vec - The Vector of Strings to add a header to.
Returns:
Adds to a Vector a information header at the front.