roast
Class Roast

java.lang.Object
  |
  +--roast.Roast

public class Roast
extends java.lang.Object

The Roast class handles command-line parsing, control and communication between four unit operations, logging utility and failure messages, and logging test case summary statistics.


Field Summary
static int excErrorCount
          The number of #excMonitor failures.
static int totalCaseCount
          The number of test cases.
static int valueErrorCount
          The number of #valueCheck failures.
 
Constructor Summary
Roast()
           
 
Method Summary
static void logFailureMessage(java.lang.String message, int lineNumber)
          Write a failure message to the log file.
static void logUtilityMessage(java.lang.String message, int level)
          Write a utility message to the log file if level is less than or equal to currentMessageLevel.
static CommandLine parseArgs(FlagSpec[] flagSpecs, java.lang.String[] args)
          Parse command-line arguments.
static void printCounts()
          Write summary statistics to the log file.
static void setMessageLevel(int level)
          Set the current message level.
static void startUnitOps(GenerateUnitOp generate, FilterUnitOp filter, ExecuteUnitOp execute, CheckUnitOp check)
          Called by driver to start unit operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalCaseCount

public static int totalCaseCount
The number of test cases.

valueErrorCount

public static int valueErrorCount
The number of #valueCheck failures.

excErrorCount

public static int excErrorCount
The number of #excMonitor failures.
Constructor Detail

Roast

public Roast()
Method Detail

startUnitOps

public static void startUnitOps(GenerateUnitOp generate,
                                FilterUnitOp filter,
                                ExecuteUnitOp execute,
                                CheckUnitOp check)
Called by driver to start unit operations.
Transitions
Let g, f, e, and c be instances of the tester's generate, filter, execute, and check unit operations. The framework pseudocode for control of the unit operations is:
	while g.hasMoreTuples()
		t = g.nextTuple()
		if f.isValidTuple(t)
			r = e.executeTuple(t)
			c.checkTuple(r)
 
Tuples are requested one at a time until the test tuple set has been exhausted. The framework filters out test tuples deemed undesirable by the tester. If a tuple is discarded, the framework requests the next tuple. The framework invokes executeTuple(t) with each valid test tuple and passes the result to checkTuple.
See Also:
GenerateUnitOp, FilterUnitOp, ExecuteUnitOp, CheckUnitOp

parseArgs

public static CommandLine parseArgs(FlagSpec[] flagSpecs,
                                    java.lang.String[] args)
                             throws ParameterException
Parse command-line arguments. The default flag arguments are all optional:
	-logfile 
	-serialize
	-level 
 
-serialize is valid only if -logfile is present. If -serialize is present, the logfile will be output as serialized message object which can be display by the Roast Log Message Viewer.

The flagSpecs parameter is an array of FlagSpec objects. This allows client-defined flag arguments to be specified and parsed.

Parameters:
flagSpec - array of client-defined command-line flag specifications; null if only the default flags are allowed
args - the array of command-line arguments
Returns:
a CommandLine object
Throws:
ParameterException - if a CommandLine object cannot be constructed
See Also:
CommandLine, FlagSpec, LogViewer

logUtilityMessage

public static void logUtilityMessage(java.lang.String message,
                                     int level)
Write a utility message to the log file if level is less than or equal to currentMessageLevel. The input parameters are used to create a UtilityMessage object.
Parameters:
message - the utility message text
level - the utility message level
See Also:
LogFile

logFailureMessage

public static void logFailureMessage(java.lang.String message,
                                     int lineNumber)
Write a failure message to the log file. The input parameters are used to create a FailureMessage object.
Parameters:
message - the failure message text
lineNumber - the test script line number of the failure
See Also:
LogFile

printCounts

public static void printCounts()
Write summary statistics to the log file. The number of test cases, the number of #valueCheck failures, and the number of #excMonitor failures are written to the log file as level 0 utility messages.

setMessageLevel

public static void setMessageLevel(int level)
Set the current message level.
See Also:
LogFile