Class AbstractCharacteristic<T>
- java.lang.Object
-
- de.cuioss.test.generator.internal.net.java.quickcheck.characteristic.AbstractCharacteristic<T>
-
- Type Parameters:
T- Type of generated random test instances.
- All Implemented Interfaces:
Characteristic<T>
public abstract class AbstractCharacteristic<T> extends Object implements Characteristic<T>
AbstractCharacteristicis an implementation ofCharacteristicwithClassificationhandling. The methodsclassify(Object)andclassify(boolean, Object)can be used to classify test data.
-
-
Constructor Summary
Constructors Constructor Description AbstractCharacteristic()AbstractCharacteristic(String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidclassify(boolean predicate, Object classification)Add a classification with the given key if the predicate is true.protected voidclassify(Object classification)Add a classification with the given key.protected abstract voiddoSpecify(T any)Implement this method to specify the characteristic (Characteristic.specify(Object)).ClassificationgetClassification()Classificationdata about the test cases executed.Stringname()Unique name for this characteristic instance.voidsetUp()Set up operation beforeCharacteristic.specify(Object)is executed.voidspecify(T any)Checks the characteristic's specification for a test case instance.voidtearDown()Clean up operation afterCharacteristic.specify(Object)was executed.
-
-
-
Constructor Detail
-
AbstractCharacteristic
public AbstractCharacteristic()
-
AbstractCharacteristic
public AbstractCharacteristic(String name)
-
-
Method Detail
-
specify
public void specify(T any) throws Throwable
Checks the characteristic's specification for a test case instance. This method will calldoSpecify(Object).- Specified by:
specifyin interfaceCharacteristic<T>- Parameters:
any- for which to check the characteristic- Throws:
Throwable- if the instance does not confirm to the characteristic's specification
-
classify
protected void classify(boolean predicate, Object classification)
Add a classification with the given key if the predicate is true.- Parameters:
predicate- Predicate for the classification.classification- classification key.
-
classify
protected void classify(Object classification)
Add a classification with the given key.- Parameters:
classification- classification key.
-
doSpecify
protected abstract void doSpecify(T any) throws Throwable
Implement this method to specify the characteristic (Characteristic.specify(Object)).- Throws:
Throwable
-
getClassification
public Classification getClassification()
Classificationdata about the test cases executed.
-
setUp
public void setUp() throws Exception
Description copied from interface:CharacteristicSet up operation beforeCharacteristic.specify(Object)is executed.- Specified by:
setUpin interfaceCharacteristic<T>- Throws:
Exception
-
tearDown
public void tearDown() throws Exception
Description copied from interface:CharacteristicClean up operation afterCharacteristic.specify(Object)was executed.- Specified by:
tearDownin interfaceCharacteristic<T>- Throws:
Exception
-
name
public String name()
Description copied from interface:CharacteristicUnique name for this characteristic instance.- Specified by:
namein interfaceCharacteristic<T>- Returns:
- name of the characteristic.
-
-