Class InputParameterModel.Builder
- java.lang.Object
-
- de.rwth.swc.coffee4j.engine.configuration.model.InputParameterModel.Builder
-
- All Implemented Interfaces:
Buildable<InputParameterModel>
- Enclosing class:
- InputParameterModel
public static final class InputParameterModel.Builder extends Object implements Buildable<InputParameterModel>
Realization of the builder pattern for constructing aInputParameterModel
. Entry point isInputParameterModel.inputParameterModel(String)
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputParameterModel
build()
Builds the testModel.InputParameterModel.Builder
errorConstraint(Constraint errorConstraint)
Adds a error constraint to the testModel.InputParameterModel.Builder
errorConstraints(Constraint... errorConstraints)
Adds all error constraints to the testModel.InputParameterModel.Builder
errorConstraints(Collection<Constraint> errorConstraints)
Adds all error constraints to the testModel.InputParameterModel.Builder
exclusionConstraint(Constraint exclusionConstraint)
Adds a exclusion constraint to the testModel.InputParameterModel.Builder
exclusionConstraints(Constraint... exclusionConstraints)
Adds all exclusion constraints to the testModel.InputParameterModel.Builder
mixedStrengthGroup(StrengthGroup.Builder mixedStrengthGroup)
Adds the given mixed strength group for positive combinatorial testing to the model.InputParameterModel.Builder
mixedStrengthGroups(StrengthGroup.Builder... mixedStrengthGroups)
Adds the given mixed strength groups for positive combinatorial testing to the model.InputParameterModel.Builder
name(String name)
Sets the name.InputParameterModel.Builder
negativeTestingStrength(int strength)
Sets the negative testing strength.InputParameterModel.Builder
parameter(Parameter parameter)
Adds a parameter to the testModel.InputParameterModel.Builder
parameter(Parameter.Builder parameter)
Adds the parameter builders to the testModel by building them.InputParameterModel.Builder
parameters(Parameter.Builder... parameters)
Builds all given builders and adds the result parameters to the testModel.InputParameterModel.Builder
parameters(Parameter... parameters)
Adds all parameters to the testModel.InputParameterModel.Builder
parameters(Collection<Parameter> parameters)
Adds all parameters to the testModel.InputParameterModel.Builder
positiveTestingStrength(int strength)
Sets the positive testing strength.InputParameterModel.Builder
removeExclusionConstraints()
Removes all exclusion constraints added until now.InputParameterModel.Builder
seed(Seed.Builder seed)
Adds a seed test case for positive combinatorial testing to the testModel.InputParameterModel.Builder
seed(String errorConstraintName, Seed.Builder seed)
Adds a seed test case for the negative combinatorial test of one error constraint to the testModel.InputParameterModel.Builder
seeds(Seed.Builder... seeds)
Adds multiple seed test cases for positive combinatorial testing to the testModel.InputParameterModel.Builder
seeds(String errorConstraintName, Seed.Builder... seeds)
Adds multiple seed test cases for the negative combinatorial test of one error constraint to the testModel A seed test will always be included in the final test suite.
-
-
-
Method Detail
-
positiveTestingStrength
public InputParameterModel.Builder positiveTestingStrength(int strength)
Sets the positive testing strength. Default is one.- Parameters:
strength
- the testing strength- Returns:
- this
-
negativeTestingStrength
public InputParameterModel.Builder negativeTestingStrength(int strength)
Sets the negative testing strength. Default is zero.- Parameters:
strength
- the testing strength- Returns:
- this
-
name
public InputParameterModel.Builder name(String name)
Sets the name. This may not benull
whenbuild()
is called.- Parameters:
name
- a descriptive name for the testModel- Returns:
- this
-
parameter
public InputParameterModel.Builder parameter(Parameter parameter)
Adds a parameter to the testModel.- Parameters:
parameter
- the parameter. Must not benull
- Returns:
- this
-
parameter
public InputParameterModel.Builder parameter(Parameter.Builder parameter)
Adds the parameter builders to the testModel by building them. This is a convenience method as now the user does not have to callParameter.Builder.build()
himself, therefore creating more readable code.- Parameters:
parameter
- the parameter to be build. Must not benull
- Returns:
- this
-
parameters
public InputParameterModel.Builder parameters(Parameter... parameters)
Adds all parameters to the testModel.- Parameters:
parameters
- all parameters to be added. Must not be, nor containnull
- Returns:
- this
-
parameters
public InputParameterModel.Builder parameters(Collection<Parameter> parameters)
Adds all parameters to the testModel.- Parameters:
parameters
- all parameters to be added. Must not be, nor containnull
- Returns:
- this
-
parameters
public InputParameterModel.Builder parameters(Parameter.Builder... parameters)
Builds all given builders and adds the result parameters to the testModel.- Parameters:
parameters
- the parameters to be added. Must not be, nor containnull
- Returns:
- this
-
exclusionConstraint
public InputParameterModel.Builder exclusionConstraint(Constraint exclusionConstraint)
Adds a exclusion constraint to the testModel.- Parameters:
exclusionConstraint
- the exclusion constraint to be added. Must not benull
- Returns:
- this
-
exclusionConstraints
public InputParameterModel.Builder exclusionConstraints(Constraint... exclusionConstraints)
Adds all exclusion constraints to the testModel.- Parameters:
exclusionConstraints
- the exclusion constraints to be added. Must not be, nor containnull
- Returns:
- this
-
removeExclusionConstraints
public InputParameterModel.Builder removeExclusionConstraints()
Removes all exclusion constraints added until now.- Returns:
- this
-
errorConstraint
public InputParameterModel.Builder errorConstraint(Constraint errorConstraint)
Adds a error constraint to the testModel.- Parameters:
errorConstraint
- the error constraint to be added. Must not benull
- Returns:
- this
-
errorConstraints
public InputParameterModel.Builder errorConstraints(Constraint... errorConstraints)
Adds all error constraints to the testModel.- Parameters:
errorConstraints
- the error constraints to be added. Must not be, nor containnull
- Returns:
- this
-
errorConstraints
public InputParameterModel.Builder errorConstraints(Collection<Constraint> errorConstraints)
Adds all error constraints to the testModel.- Parameters:
errorConstraints
- the error constraints to be added. Must not be, nor containnull
- Returns:
- this
-
seed
public InputParameterModel.Builder seed(Seed.Builder seed)
Adds a seed test case for positive combinatorial testing to the testModel. A seed test will always be included in the final test suite.This method needs to be called after all parameters have been added.
- Parameters:
seed
- the (partial) seed test case. Must not benull
- Returns:
- this
-
seed
public InputParameterModel.Builder seed(String errorConstraintName, Seed.Builder seed)
Adds a seed test case for the negative combinatorial test of one error constraint to the testModel. A seed test will always be included in the final test suite.This method needs to be called after all parameter have been added.
- Parameters:
errorConstraintName
- the unique name of the error constraint to which's negative combinatorial test this seed is addedseed
- the (partial) seed test case. Must not benull
- Returns:
- this
-
seeds
public InputParameterModel.Builder seeds(Seed.Builder... seeds)
Adds multiple seed test cases for positive combinatorial testing to the testModel. A seed test will always be included in the final test suite.This method needs to be called after all parameter have been added.
- Parameters:
seeds
- the (partial) seed test cases. Must not benull
- Returns:
- this
-
seeds
public InputParameterModel.Builder seeds(String errorConstraintName, Seed.Builder... seeds)
Adds multiple seed test cases for the negative combinatorial test of one error constraint to the testModel A seed test will always be included in the final test suite.This method needs to be called after all parameter have been added.
- Parameters:
errorConstraintName
- the unique name of the error constraint to which's negative combinatorial test this seeds are addedseeds
- the (partial) seed test cases. Must not benull
- Returns:
- this
-
mixedStrengthGroup
public InputParameterModel.Builder mixedStrengthGroup(StrengthGroup.Builder mixedStrengthGroup)
Adds the given mixed strength group for positive combinatorial testing to the model. A positive combinatorial test suite must cover each mixed strength group at the given higher strength.This method needs to be called after all parameters have been added.
- Parameters:
mixedStrengthGroup
- the mixed strength group to add for positive combinatorial testing- Returns:
- this
-
mixedStrengthGroups
public InputParameterModel.Builder mixedStrengthGroups(StrengthGroup.Builder... mixedStrengthGroups)
Adds the given mixed strength groups for positive combinatorial testing to the model. A positive combinatorial test suite must cover each mixed strength group at the given higher strength.This method needs to be called after all parameters have been added.
- Parameters:
mixedStrengthGroups
- the mixed strength groups to add for positive combinatorial testing- Returns:
- this
-
build
public InputParameterModel build()
Builds the testModel. Add least one parameter needs to have been added by now.- Specified by:
build
in interfaceBuildable<InputParameterModel>
- Returns:
- the constructed testModel
-
-