sofya.tools
Class TestHistoryBuilder

java.lang.Object
  extended by sofya.tools.TestHistoryBuilder
All Implemented Interfaces:
SConstants

public final class TestHistoryBuilder
extends java.lang.Object
implements SConstants

The TestHistoryBuilder gathers coverage information from trace files produced by the TraceHandler attached to a ProgramEventDispatcher and uses it to produce test history files for test subjects.

Usage:
java sofya.tools.TestHistoryBuilder -<B|E|X|C> [-tag <tag>] <tracedir> <histfile> <classname|classlist_file>

Note: Arguments must be given in exactly the order shown, including optional arguments when used.

A class list file should be a simple text file ending with the extension ".prog" which contains a list of classes, one per line, including all package qualifications. If the fourth argument does not end in ".prog", it will be treated as a single class name.

Version:
05/13/2005
Author:
Alex Kinneer
See Also:
TestHistory, TestHistoryHandler, TestHistoryViewer

Nested Class Summary
 
Nested classes/interfaces inherited from interface sofya.base.SConstants
SConstants.BlockLabel, SConstants.BlockObjectType, SConstants.BlockSubType, SConstants.BlockType, SConstants.BranchObjectType, SConstants.BranchType, SConstants.EDObjectType, SConstants.TraceObjectType
 
Field Summary
 
Fields inherited from interface sofya.base.SConstants
DEFAULT_PORT, INST_COMPATIBLE, INST_OLD_UNSUPPORTED, INST_OPT_NORMAL, INST_OPT_SEQUENCE, SIG_CHKALIVE, SIG_ECHO
 
Constructor Summary
TestHistoryBuilder(int typeFlags)
          Creates a test history builder which prints its outputs to the standard streams (System.out and System.err).
TestHistoryBuilder(int typeFlags, java.lang.String tag)
          Creates a test history builder which prints its outputs to the standard streams (System.out and System.err).
TestHistoryBuilder(int typeFlags, java.lang.String tag, java.io.PrintStream stdout, java.io.PrintStream stderr)
          Creates a test history builder which prints its outputs to the specified streams.
 
Method Summary
 boolean buildTestHistory(java.lang.String traceDir, java.lang.String thFile, java.util.List classList)
          Builds test history information for a subject class from a set of traces and writes it to a file.
static void main(java.lang.String[] argv)
          Entry point for the test history builder.
 void setStderrStream(java.io.PrintStream stderr)
          Sets the stream to which standard error outputs will be printed.
 void setStdoutStream(java.io.PrintStream stdout)
          Sets the stream to which standard outputs will be printed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestHistoryBuilder

public TestHistoryBuilder(int typeFlags)
Creates a test history builder which prints its outputs to the standard streams (System.out and System.err).

Parameters:
typeFlags - Bit mask representing the types of blocks to be instrumented.

TestHistoryBuilder

public TestHistoryBuilder(int typeFlags,
                          java.lang.String tag)
Creates a test history builder which prints its outputs to the standard streams (System.out and System.err).

Parameters:
typeFlags - Bit mask representing the types of blocks to be instrumented.

TestHistoryBuilder

public TestHistoryBuilder(int typeFlags,
                          java.lang.String tag,
                          java.io.PrintStream stdout,
                          java.io.PrintStream stderr)
Creates a test history builder which prints its outputs to the specified streams.

Parameters:
typeFlags - Bit mask representing the types of blocks to be instrumented.
Method Detail

setStdoutStream

public void setStdoutStream(java.io.PrintStream stdout)
Sets the stream to which standard outputs will be printed.

Parameters:
stdout - Stream to which standard outputs will be printed.

setStderrStream

public void setStderrStream(java.io.PrintStream stderr)
Sets the stream to which standard error outputs will be printed.

Parameters:
stderr - Stream to which error outputs will be printed.

buildTestHistory

public boolean buildTestHistory(java.lang.String traceDir,
                                java.lang.String thFile,
                                java.util.List classList)
Builds test history information for a subject class from a set of traces and writes it to a file.

Parameters:
traceDir - Path to the directory containing the traces from which to gather test history information.
thFile - Name of the test history file to be created.
classList - List of the classes for which test history information is being constructed.
Returns:
true if the test history file was successfully written. If false, the reason for failure will be printed to the error stream.

main

public static void main(java.lang.String[] argv)
Entry point for the test history builder.