public static class ReducerCommand.Options extends Object
[-f function]
[-g genDef]
[-r resampleFactor]
[-R]
[-s sampleCount]
[-t baseTestDef]
[-T contentType]
inputDef
where:
-f function
If -f is defined, update only the test case generator for the given function. Otherwise, update the test case generators for all functions.
-g genDef
If -g is defined, update the generator specified in the given genDef file. Otherwise, update the default generator definition file:
the corresponding *-Generators
file in the same directory as the inputDef.
-r resampleFactor
If -r is defined, use the given resampleFactor to determine the number of samples in the next round of reducing.
Depending on the resampleFactor, the next round may use more or fewer samples. If the previous round
called for N
samples and produced a reduction, then the number of samples for the next round will be
N * ( 1 + resampleFactor)
. To increase sample count with each round, define resampleFactor > 0.
To decrease sample count with each round, define -1 < resampleFactor < 0. If resampleFactor is omitted,
the default value is 0.
-R
Ignore any random seed defined in the genDef file and search for a new seed to reduce test cases.
-s sampleCount
Defines the number of samples for the initial round of reducing.
If omitted, the default sampleCount is 10.
-t testDef
If -t is defined, generate test cases based on the test definitions in the specified testDef file,
relative to the directory containing the inputDef.
-T contentType
Defines the default content type for the files read and produced. The contentType must be one of "json" or "xml".
The default content type is assumed for any file that is not specified explicitly or that does not have a recognized extension.
If omitted, the default content type is derived from the inputDef name.
inputDef
The system input definition is read from the first one of the following files
that can be located.
- inputDef
- inputDef-Input.xml
- inputDef.xml
- inputDef-Input.json
- inputDef.json
Modifier and Type | Class and Description |
---|---|
static class |
ReducerCommand.Options.Builder |
Constructor and Description |
---|
Options()
Creates a new Options object.
|
Options(String[] args)
Creates a new Options object.
|
Modifier and Type | Method and Description |
---|---|
static ReducerCommand.Options.Builder |
builder()
Returns a new Options builder.
|
Resource.Type |
getContentType()
Returns the default file content type.
|
String |
getFunction()
Returns the function for which tests cases are reduced.
|
File |
getGenDef()
Returns the generator definition file.
|
File |
getInputDef()
Returns the input definition file
|
ReducerOptions |
getReducerOptions()
Returns the
ReducerOptions |
double |
getResampleFactor()
Returns the
resample factor . |
int |
getSamples()
Returns the initial number of samples.
|
File |
getTestDef()
Returns the base test definition file.
|
protected void |
handleArgs(String[] args,
int i)
Handles the non-option arguments i, i+1, ...
|
protected int |
handleOption(String[] args,
int i)
Handles the i'th option and return the index of the next argument.
|
boolean |
isNewSeed()
Returns if ignoring current random seed used by generators.
|
protected void |
printUsage()
Prints usage information to standard error.
|
void |
setContentType(Resource.Type contentType)
Changes the default file content type.
|
void |
setContentType(String option)
Changes the default file content type.
|
void |
setFunction(String function)
Changes the function for which tests cases are reduced.
|
void |
setGenDef(File genDef)
Changes the generator definition file.
|
void |
setInputDef(File inputDef)
Changes the input definition file
|
void |
setNewSeed(boolean newSeed)
Changes if ignoring current random seed used by generators.
|
void |
setResampleFactor(double resampleFactor)
Changes the resample factor.
|
void |
setSamples(int samples)
Changes the initial number of samples.
|
void |
setShowVersion(boolean showVersion)
Changes if the current version should be shown.
|
void |
setTestDef(File testDef)
Changes the base test definition file.
|
boolean |
showVersion()
Returns if the current version should be shown.
|
protected void |
throwHelpException()
Throws a HelpException after printing usage information to standard error.
|
String |
toString() |
public Options()
public Options(String[] args)
protected int handleOption(String[] args, int i)
protected void handleArgs(String[] args, int i)
protected void throwHelpException()
protected void printUsage()
public void setSamples(int samples)
public int getSamples()
public void setFunction(String function)
public String getFunction()
public void setTestDef(File testDef)
public File getTestDef()
public void setGenDef(File genDef)
public File getGenDef()
public void setInputDef(File inputDef)
public File getInputDef()
public void setResampleFactor(double resampleFactor)
resampleFactor
determines the number of samples in the next round of reducing.
Depending on the resampleFactor
, the next round may use more or fewer samples.
If the previous round called for N
samples and produced a reduction, then the number of samples for the
next round will be N * ( 1 + resampleFactor)
. To increase sample count with each round, define
resampleFactor
> 0. To decrease sample count with each round, define -1 <
resampleFactor
< 0.public double getResampleFactor()
resample factor
.public void setNewSeed(boolean newSeed)
public boolean isNewSeed()
public ReducerOptions getReducerOptions()
ReducerOptions
public void setContentType(String option)
public void setContentType(Resource.Type contentType)
public Resource.Type getContentType()
public void setShowVersion(boolean showVersion)
public boolean showVersion()
public static ReducerCommand.Options.Builder builder()
Copyright © 2020 The Cornutum Project. All rights reserved.