korat.config
Class ConfigManager

java.lang.Object
  extended by korat.config.ConfigManager

public class ConfigManager
extends Object

Single point for obtaining korat options

Author:
Aleksandar Milicevic

Field Summary
 String[] args
          Array of arguments to be passed to the finitization method.
 String className
          Full class name of the class under test.
 String config
          Name of the config file (if used, null otherwise).
private  ConfigLoader configLoader
           
 boolean cvDelta
          Whether or not to use delta file format for storing candidate vectors.
 long cvEnd
          Index in the cvFile of the ending candidate vector which the search algorithm should search to.
 long cvExpected
          Expected number of total explored vectors.
 String cvFile
          Name of the file that contains candidate vectors.
 int cvFullFormatRatio
          Ratio of full format vectors (makes sense only if delta file format is used, i.e.
 long cvStart
          Index in the cvFile of the starting candidate vector which the search algorithm should start searching from.
 boolean cvWrite
          Whether or not to write explored candidate vectors to disk.
 int cvWriteNum
          Number of equi-distant vectors to be written to disk (makes sense only if cvFrite is set to true.
 boolean dumpBytecodes
          Whether or not to dump instrumented bytecodes.
 String[] excludePackages
          Comma separated list of packages to be excluded from instrumentation.
 String finitization
          Name of the finitization method.
private static ConfigManager instance
           
 String[] listeners
          Comma separated list of ITestCaseListener listeners to be attached to testCradle instance.
 long maxStructs
          Max number of test cases to be generated.
 String predicate
          Name of the predicate method to be used.
 boolean print
          Whether or not to print generated test cases to standard output (toString method would be called on each of the valid test cases generated).
 boolean printCandVects
          Whether or not to print candidate vector and access field list during the search process.
 long progress
          Print progress during search on every progress-th generated test case.
 String serialize
          Serialize valid test cases to file with given name.
 boolean visualize
          Whether or not to visualize valid test cases.
 
Constructor Summary
private ConfigManager()
           
 
Method Summary
static ConfigManager getInstance()
           
 void parseCmdLine(String[] args)
          Parses the cmd line options (actually, delegates the job to configLoader).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static ConfigManager instance

configLoader

private ConfigLoader configLoader

args

public String[] args
Array of arguments to be passed to the finitization method.


className

public String className
Full class name of the class under test.


config

public String config
Name of the config file (if used, null otherwise).


cvDelta

public boolean cvDelta
Whether or not to use delta file format for storing candidate vectors.


cvEnd

public long cvEnd
Index in the cvFile of the ending candidate vector which the search algorithm should search to.


cvExpected

public long cvExpected
Expected number of total explored vectors. This piece of information can help in optimal equi-distancing when cvWriteNum is set to true.


cvFile

public String cvFile
Name of the file that contains candidate vectors.


cvFullFormatRatio

public int cvFullFormatRatio
Ratio of full format vectors (makes sense only if delta file format is used, i.e. cvDelta is set to true).


cvStart

public long cvStart
Index in the cvFile of the starting candidate vector which the search algorithm should start searching from.


cvWrite

public boolean cvWrite
Whether or not to write explored candidate vectors to disk.


cvWriteNum

public int cvWriteNum
Number of equi-distant vectors to be written to disk (makes sense only if cvFrite is set to true.


dumpBytecodes

public boolean dumpBytecodes
Whether or not to dump instrumented bytecodes.


excludePackages

public String[] excludePackages
Comma separated list of packages to be excluded from instrumentation.


finitization

public String finitization
Name of the finitization method. If not set, defaults to "fin".


listeners

public String[] listeners
Comma separated list of ITestCaseListener listeners to be attached to testCradle instance.


maxStructs

public long maxStructs
Max number of test cases to be generated. The search algorithm stops when maxStructs number of test cases is generated.


predicate

public String predicate
Name of the predicate method to be used. If not set, defaults to "repOK".


print

public boolean print
Whether or not to print generated test cases to standard output (toString method would be called on each of the valid test cases generated).


printCandVects

public boolean printCandVects
Whether or not to print candidate vector and access field list during the search process. Should be used for debugging purposes.


progress

public long progress
Print progress during search on every progress-th generated test case.


serialize

public String serialize
Serialize valid test cases to file with given name.


visualize

public boolean visualize
Whether or not to visualize valid test cases. To use this options, "dot" program from "GraphViz" package (http://www.graphviz.org) must be installed and added to system's PATH environment variable.

Constructor Detail

ConfigManager

private ConfigManager()
Method Detail

getInstance

public static ConfigManager getInstance()

parseCmdLine

public void parseCmdLine(String[] args)
Parses the cmd line options (actually, delegates the job to configLoader). Korat sets its options using 3 level hierarchy (with ascending priorities):
  1. all non-required options have their default values
  2. options can be specified through the config file
  3. options can be specified through the cmd line
This means that it first searches cmd line, then config file (if provided) and finally if the option is not specified neither in cmd line or config file, the default value will be used (if the options is not required, otherwise, an exception will be thrown and execution will stop). Format of the config file should be like the format of the cmd line with a couple of additional possibilities:
  1. line breaks are allowed
  2. all lines starting with "#" are ignored (considered as comments)

Parameters:
args - cmd line arguments
See Also:
ConfigLoader.parseCmdLine(String[])