sofya.viewers
Class TestHistoryViewer

java.lang.Object
  extended by sofya.viewers.Viewer
      extended by sofya.viewers.TestHistoryViewer

public class TestHistoryViewer
extends Viewer

The TestHistoryViewer is used to display the contents of a test history file in human-readable form.

Usage:
java sofya.viewers.TestHistoryViewer <histfile> [COUNT|LIST] [OutputFile]
     [COUNT|LIST] : Format of the output to be displayed
     [OutputFile] : Redirect output of viewer to OutputFile
     (histfile must include any necessary path information, relative or absolute.)

This class is modeled upon the th_printer tool available in the Aristotle system.

Version:
09/23/2003
Author:
Alex Kinneer

Field Summary
 
Fields inherited from class sofya.viewers.Viewer
destStream, inputFile, LINE_SEP, outputFile, stdin
 
Constructor Summary
TestHistoryViewer(java.lang.String inputFile, java.lang.String className, boolean count)
          Standard constructor, creates a TestHistoryViewer to display the formatted contents of the specified test history file to the system console (System.out).
TestHistoryViewer(java.lang.String inputFile, java.lang.String className, java.io.OutputStream stream, boolean count)
          Standard constructor, creates a TestHistoryViewer to display the formatted contents of the specified test history file to the specified output stream.
TestHistoryViewer(java.lang.String inputFile, java.lang.String className, java.lang.String outputFile, boolean count)
          Standard constructor, creates a TestHistoryViewer to display the formatted contents of the specified test history file to the specified output file.
 
Method Summary
static void main(java.lang.String[] argv)
          Entry point for TestHistoryViewer.
 void print(java.io.PrintWriter stream)
          Prints the test history information to the specified stream.
 
Methods inherited from class sofya.viewers.Viewer
print, printMethodName, rightJust, setInputFile, setOutputFile, setOutputStream, sizeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestHistoryViewer

public TestHistoryViewer(java.lang.String inputFile,
                         java.lang.String className,
                         boolean count)
Standard constructor, creates a TestHistoryViewer to display the formatted contents of the specified test history file to the system console (System.out).

Parameters:
inputFile - Name of the test history file to be displayed.
className - Name of the class for which the test history was constructed, include .java extension.
count - If true, the viewer will print a count of the number of tests, otherwise the standard list is printed.

TestHistoryViewer

public TestHistoryViewer(java.lang.String inputFile,
                         java.lang.String className,
                         java.lang.String outputFile,
                         boolean count)
                  throws SameFileNameException,
                         java.io.IOException
Standard constructor, creates a TestHistoryViewer to display the formatted contents of the specified test history file to the specified output file.

Parameters:
inputFile - Name of the test history file to be displayed.
className - Name of the class for which the test history was constructed, include .java extension.
outputFile - Name of the file to which the viewer output should be written.
count - If true, the viewer will print a count of the number of tests, otherwise the standard list is printed.
Throws:
SameFileNameException - If the specified output file and input file are the same file.
java.io.IOException - If there is an error creating the output file.

TestHistoryViewer

public TestHistoryViewer(java.lang.String inputFile,
                         java.lang.String className,
                         java.io.OutputStream stream,
                         boolean count)
Standard constructor, creates a TestHistoryViewer to display the formatted contents of the specified test history file to the specified output stream.

Note: When using Viewer.print(), an output file specified using Viewer.setOutputFile(java.lang.String) takes precedence over the specified stream.

Parameters:
inputFile - Name of the test history file to be displayed.
className - Name of the class for which the test history was constructed, include .java extension.
stream - Stream to which the viewer output should be written.
count - If true, the viewer will print a count of the number of tests, otherwise the standard list is printed.
Method Detail

print

public void print(java.io.PrintWriter stream)
           throws java.io.IOException
Prints the test history information to the specified stream.

Specified by:
print in class Viewer
Parameters:
stream - Stream to which the test history information should be written.
Throws:
java.io.IOException - If there is an error writing to the stream, or creating the output file, if applicable.

main

public static void main(java.lang.String[] argv)
Entry point for TestHistoryViewer.